diff --git a/.github/workflows/gambit.yml b/.github/workflows/gambit.yml index 5d05820..9594343 100644 --- a/.github/workflows/gambit.yml +++ b/.github/workflows/gambit.yml @@ -33,7 +33,7 @@ jobs: sudo mv solc /usr/bin/solc fi - name: Build and Test - run: make all_linux + run: SOLC=solc make all_linux - name: Rename gambit binary if: startsWith(github.event.ref, 'refs/tags/v') # only on new tag creation @@ -71,7 +71,7 @@ jobs: sudo mv solc-macos /usr/local/bin/solc fi - name: Build and Test - run: make all_macos + run: SOLC=solc make all_macos - name: Darwin link as Universal run: lipo -create -output gambit-macos target/aarch64-apple-darwin/release/gambit target/x86_64-apple-darwin/release/gambit @@ -130,4 +130,24 @@ jobs: else gh release upload $TAG gambit-linux-$TAG/gambit-linux-$TAG gh release upload $TAG gambit-macos-$TAG/gambit-macos-$TAG - fi \ No newline at end of file + fi + + check-docs: + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v2 + + - name: PIP install + run: pip install ansi + + - name: Check that RTD Docs are Up To Date + run: python3 scripts/check_rtd_docs_up_to_date.py + + - name: Check Exit Code + run: | + if [[ $? -ne 0 ]]; then + echo "Error: documentation is not synced" + exit 1 + fi + diff --git a/.gitignore b/.gitignore index 0bfcc3a..5463df2 100644 --- a/.gitignore +++ b/.gitignore @@ -18,3 +18,6 @@ Cargo.lock # vscode .vscode/ + +# python +**/__pycache__/ diff --git a/Cargo.toml b/Cargo.toml index 03a4533..a708207 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,22 +1,26 @@ [package] name = "gambit" -version = "0.2.1" +version = "1.0.0" edition = "2021" authors = [ "Chandrakana Nandi ", "Samwise Parkinson ", - "Ben Kushigian ", + "Ben Kushigian ", ] # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] +solang = { git = "https://github.com/hyperledger/solang.git", rev = "70af554c42748009e414e6263dd4607fb380e5dc", default-features = false } ansi_term = "0.12" clap = { version = "4.0.29", features = ["derive"] } clap_complete = "4.0.6" csv = "1.2.1" env_logger = { version = "0.10.0", default-features = false } log = "0.4" +num-bigint = "0.4" +num-rational = "0.4" +num-traits = "0.2" project-root = "0.2" rand_pcg = "0.3.0" rand = { version = "0.8.5", features = ["std"] } @@ -26,6 +30,7 @@ scanner-rust = "2.0.16" serde = { version = "1", features = ["derive"] } serde_json = "1" similar = "2" +solang-parser = { git = "https://github.com/hyperledger/solang.git", rev = "70af554c42748009e414e6263dd4607fb380e5dc" } strum = "0.24.1" strum_macros = "0.24.3" tempfile = "3" diff --git a/README.md b/README.md index be97d66..59bc49f 100644 --- a/README.md +++ b/README.md @@ -1,380 +1,467 @@ -# Gambit: Mutant Generation for Solidity + -Gambit is a state-of-the-art mutation system for Solidity. -By applying predefined syntax transformations called _mutation operators_ (for - example, `a + b` -> `a - b`) to a Solidity program's source code, Gambit - generates variants of the program called _mutants_. -Mutants can be used to evaluate test suites or specs used for formal - verification: each mutant represents a potential bug in the program, and - stronger test suites and specifications should detect more mutants. + -
-Generated 34 mutants in 0.69 seconds
-
+ Raw markdown doesn't support this syntax, so we use an HTML comment + containing the contents "ANCHOR (content-title)=": -_**Note:** The mutated file must located within your current working directory or -one of its subdirectories. If you want to mutate code in an arbitrary directory, -use the `--sourceroot` option._ + ```markdown + -
-gambit_out
-├── gambit_results.json
-├── input_json
-│   ├── BinaryOpMutation.sol_json.ast
-│   └── BinaryOpMutation.sol_json.ast.json
-├── mutants
-│   ├── 1
-│   ├── 2
-│   └── 3
-└── mutants.log
-
+ and end with a line ending with `_`: -See the [Results Directory](#results-directory) section for a detailed -explanation of this layout. The `gambit summary` command -pretty prints each mutant for easy inspection: + ```markdown + and this is the last line of my note._ + ``` -![The output of `gambit summary`](doc/gambit-summary.png) + So, a full note would look like: -By default `gambit summary` prints info on all mutants. If you are interested in -particular mutants you can specify a subset of mutant ids with the `--mids` flag. -For instance, `gambit summary --mids 3 4 5` will only print info for mutant ids -3 through 5. + ```markdown + _**Note:** + This is a note. The opening tag is on its own line, and the closing italic + is at the end of the final line. This is to make parsing easy, and to keep + diffs minimal!_ + ``` + +--> + -### Example 4: Specifying solc Pass-through Arguments -Solc may need some extra information to successfully run on a file or a project. -Gambit enables this with _pass-through arguments_ that, as the name suggests, -are passed directly through to the solc compiler. + +# Gambit: Mutant Generation for Solidity - ```bash - gambit mutate --filename path/to/file.sol --solc_base_path base/path/dir/. - ``` +Gambit is a state-of-the-art mutant generation system for Solidity. Gambit +injects faults into a Solidity program by applying predefined syntactic +transformations, called _mutation _operators_, to the program's source code. The +resulting faulty programs, called _mutants_, are used to evaluate a test suite +or a specification: each mutant represents a potential bug in the program, and +stronger test suites and specifications should detect more mutants as faulty. -* **Specify remappings:** To indicate where Solidity should find libraries, - use solc's [import remapping][remapping] syntax with `--solc_remappings`: +## Requirements - ```bash - gambit mutate --filename path/to/file.sol \ - --solc_remappings @openzeppelin=node_modules/@openzeppelin @foo=node_modules/@foo - ``` +1. Gambit is written in Rust. You'll need to [install Rust and + Cargo](https://www.rust-lang.org/tools/install) to build Gambit. +2. Gambit uses the `solc` Solidity compiler to validate generated mutants. By + default Gambit looks for `solc` on `$PATH`. Users can specify a particular + `solc` executable with the `--solc` option, or disable validation entirely + with `gambit mutate --skip_validate` (see `gambit mutate --help` for more + details). -* **Specify allow-paths:** To include additional allowed paths via solc's - [--allow-paths][allowed] argument, use `--solc_allow_paths`: +## Installation - ```bash - gambit mutate --filename path/to/file.sol \ - --solc_allow_paths PATH1 --solc_allow_paths PATH2 ... - ``` +You can download prebuilt Gambit binaries for Mac and Linux from our +[releases](https://github.com/Certora/gambit/releases) page. -* **Specify include-path:** To make an additional source directory available - to the default import callback via solc's [--include-path][included] argument, use - `--solc_include_path`: +To build Gambit from source, clone [the Gambit +repository](https://github.com/Certora/gambit) and run - ```bash - gambit mutate --filename path/to/file.sol --solc_include_path PATH - ``` +``` +cargo build --release +``` -* **Use optimization:** To run the solidity compiler with optimizations (solc's - `--optimize` argument), use `--solc_optimize`: +from this repository's root. This will create the `target/release/gambit` +binary. To install globally, run - ```bash - gambit mutate --filename path/to/file.sol --solc_optimize - ``` +``` +cargo install --path . +``` -[remapping]: https://docs.soliditylang.org/en/v0.8.17/path-resolution.html#import-remapping -[basepath]: https://docs.soliditylang.org/en/v0.8.17/path-resolution.html#base-path-and-include-paths -[allowed]: https://docs.soliditylang.org/en/v0.8.17/path-resolution.html#allowed-paths - -### Example 5: The `--sourceroot` Option - -Gambit needs to track the location of sourcefiles that it mutates within a -project: for instance, imagine there are files `foo/Foo.sol` and `bar/Foo.sol`. -These are separate files, and their path prefixes are needed to determine this. -Gambit addresses this with the `--sourceroot` option: the sourceroot indicates -to Gambit the root of the files that are being mutated, and all source file -paths (both original and mutated) are reported relative to this sourceroot. - -_If Gambit encounters a source file that does not belong to the sourceroot it -will print an error message and exit._ - -_When running `gambit mutate` with the `--filename` option, -sourceroot defaults to the current working directory. -When running `gambit mutate` with the `--json` option, -sourceroot defaults to the directory containing the configuration JSON._ - -Here are some examples of using the `--sourceroot` option. - -1. From the root of the Gambit repository, run: - - ```bash - gambit mutate -f benchmarks/BinaryOpMutation/BinaryOpMutation.sol -n 1 - cat gambit_out/mutants.log - find gambit_out/mutants -name "*.sol" - ``` - - This should output the following: - -
-   Generated 1 mutants in 0.13 seconds
-   1,BinaryOpMutation,benchmarks/BinaryOpMutation/BinaryOpMutation.sol,23:10, % ,*
-   gambit_out/mutants/1/benchmarks/BinaryOpMutation/BinaryOpMutation.sol
-   
- - The first command generates a single mutant, and its sourcepath is relative to `.`, - the default sourceroot. We can see that the reported paths in `mutants.log`, - and the mutant file path in `gambit_out/mutants/1`, are the relative to this - sourceroot: `benchmarks/BinaryOpMutation/BinaryOpMutation.sol` +This will build Gambit and install it to a globally visible +location on your `PATH`. + +## Usage + +Gambit has two main commands: the [`mutate` command](#the-mutate-command), which +is responsible for generating mutants, and the [`summary` +command](#the-summary-command), which allows the user to get a high-level +summary of a `gambit mutate` execution. + + + +## The `mutate` command + +Gambit's `mutate` command expects user-provided _mutation parameters_ describing +which files to mutate, which mutation operators to apply, and several other +options. By default, these mutation parameters are specified by the user with +[command line arguments](#running-mutate-with-command-line-arguments). To handle +more complex use cases, and to allow for easy reproducibility, Gambit +can read mutation parameters from a +[JSON configuration file](#running-mutate-with-a-configuration-file) with the +`--json` argument. + +The `mutate` command does the following: + +1. **Parse:** Gambit begins by parsing the specified Solidity files provided on + command line or in the configuration file + +2. **Function filters:** The `mutate` command provides two ways to filter which + functions are mutated: the `--functions` filter and the `--contract` filter. + When `--functions` is specified, Gambit will only mutate functions with a name + contained in the provided list of functions. When `--contract` is specified, + Gambit will only mutate functions within the specified contract. If neither + option is specified, Gambit will mutate all functions. + +3. **Mutation:** Gambit recursively visits the body of each function not + filtered out in (2) and applies the mutation operators specified by the user; + if no mutation operators were specified then Gambit uses a default set of + mutation operators. + +4. **Validation:** By default Gambit will _validate_ each generated mutant by + compiling it with the `solc` compiler. If compilation fails Gambit will not + export the mutant to disk or report it in `gambit_results.json` or + `mutants.log`. Validation can be skipped with the `--skip_validate` option. + To log invalidated mutants, use the `--log_invalid` option. + +5. **Random down sampling:** If the user provides the `--num_mutants n` + argument, Gambit will randomly down sample to `n` mutants. -2. Suppose we want our paths to be reported relative to - `benchmarks/BinaryOpMutation`. We can run +6. **Write to disk:** After all mutants are generated, validated, and optionally + down sampled, the `mutate` command exports the generated mutants and writes + to the output directory (`gambit_out` by default), and writes a summary of + each mutant to `gambit_out/gambit_results.json`. + + +### Running `mutate` with command line arguments - ```bash - gambit mutate -f benchmarks/BinaryOpMutation/BinaryOpMutation.sol -n 1 --sourceroot benchmarks/BinaryOpMutation - cat gambit_out/mutants.log - find gambit_out/mutants -name "*.sol" - ``` +By default the `mutate` command expects mutation parameters to be specified +on the command line: - which will output: +``` +gambit mutate FILENAME [ARGS...] +``` - -
-   Generated 1 mutants in 0.13 seconds
-   1,BinaryOpMutation,BinaryOpMutation.sol,23:10, % ,*
-   gambit_out/mutants/1/BinaryOpMutation.sol
-   
- The reported filenames, and the offset path inside of - `gambit_out/mutants/1/`, are now relative to the sourceroot that we - specified. + +#### `mutate` command line interface options -3. Finally, suppose we use a sourceroot that doesn't contain the source file: +Gambit's `mutate` command line interface supports the following options: - ```bash - gambit mutate -f benchmarks/BinaryOpMutation/BinaryOpMutation.sol -n 1 --sourceroot scripts - ``` - This will try to find the specified file inside of `scripts`, and since it - doesn't exist Gambit reports the error: +| Option | Description | +| :------------------- | :--------------------------------------------------------------------------------------------------------------------------- | +| `--contract` | specify a specific contract name to mutate; by default mutate all contracts | +| `--functions` | specify one or more functions to mutate; by default mutate all functions | +| `--log_invalid` | log any invalid mutants found during validation | +| `--mutations` | specify one or more mutation operators to use; only generates mutants that are created using the specified operators | +| `--no_export` | do not export mutant sources to output directory | +| `--no_overwrite` | do not overwrite an output directory; if the output directory exists, print an error and exit | +| `--num_mutants` | randomly downsample to a given number of mutants. | +| `--outdir` | specify Gambit's output directory (defaults to `gambit_out`) | +| `--random_seed` | use a random seed. Note that this overrides any value specified by `--seed` | +| `--seed` | specify a random seed. For reproducibility, Gambit defaults to using the seed `0`. To randomize the seed use `--random_seed` | +| `--skip_validate` | only generate mutants without validating them by compilation | +| `--solc` | specify a `solc` binary to use during validation | +| `--solc_allow_paths` | passes a value to `solc`'s `--allow-paths` argument | - -
-   [ERROR gambit] [!!] Illegal Configuration: Resolved filename `/Users/USER/Gambit/benchmarks/BinaryOpMutation/BinaryOpMutation.sol` is not prefixed by the derived sourceroot /Users/USER/Gambit/scripts
-   
- Gambit prints an error and exits. -### Example 6: Running Gambit Through a Configuration File + +### Running `mutate` with a Configuration File -To run gambit with a configuration file, use the `--json` argument: -```bash -gambit mutate --json benchmarks/config-jsons/test1.json +Gambit allows the user to specify mutation parameters in a JSON file, allowing +the user to store complex parameters, or even multiple parameters at once. +To run `mutate` with a configuration file, use: + +``` +gambit mutate --json CONFIGURATION_JSON ``` -The configuration file is a JSON file containing the command line arguments for -`gambit` and additional configuration options: + +A set of mutation parameters are stored as a JSON object mapping option names to +values. For instance, if we wanted to mutate the `ERC20` contract from the +[OpenZeppelin Contracts](https://github.com/OpenZeppelin/openzeppelin-contracts) +repository we could use the following configuration file ```json { - "filename": "../10Power/TenPower.sol", - "sourceroot": "..", - "solc_remappings": [ - "@openzeppelin=node_modules/@openzeppelin" - ], + "filename": "contracts/token/ERC20/ERC20.sol", + "solc": "solc8.20", + "outdir": "gambit_out", + "import_paths": ["."] } ``` -In addition to specifying the command line arguments, you can list the specific -mutants that you want to apply, the specific functions you wish to mutate, and -more. See the [`benchmark/config-jsons` directory][config-examples] for -examples. -_**Note:** Any paths provided by the configuration file are resolved relative to -the configuration file's parent directory._ +Gambit also supports specifying multiple sets of mutation parameters in a file, +and this allows you to create mutant sets that are tailored to your needs. +For instance, if you wanted to mutate functions `transferFrom` and `_transfer` +with one set of mutations and functions `_update` and `_mint` with another set +of mutations, and create exactly 2 mutants for each, you could use the following +configuration file: -## Configuration Files -Configuration files allow you to save complex configurations and perform -multiple mutations at once. Gambit uses a simple JSON object format to store -mutation options, where each `--option VALUE` specified on the CLI is -represented as a `"option": VALUE` key/value pair in the JSON object. Boolean -`--flag`s are enabled by storing them as true: `"flag": true`. For instance, -`--no_overwrite` would be written as `"no_overwrite": true"`. +```json +[ + { + "filename": "contracts/token/ERC20/ERC20.sol", + "solc": "solc8.20", + "outdir": "gambit_out", + "num_mutants": 2, + "functions": ["transferFrom", "_transfer"], + "mutations": ["statement-deletion"], + "import_paths": ["."] + }, + { + "filename": "contracts/token/ERC20/ERC20.sol", + "solc": "solc8.20", + "outdir": "gambit_out", + "num_mutants": 2, + "functions": ["_update", "_mint"], + "mutations": ["relational-operator-replacement"], + "import_paths": ["."] + } +] +``` -As an example, consider the command from Example 1: +If we store this to `conf2.json`, then we can run it as follows: -```bash -gambit mutate -f benchmarks/BinaryOpMutation/BinaryOpMutation.sol +``` +$ gambit mutate --json conf2.json +Generated 4 mutants in 0.22 seconds +$ gambit summary + +ROR: 2 ( 50.00%) +STD: 2 ( 50.00%) +--------------------- +TOT: 4 (100.00%) ``` -To execute this using a configuration file you would write the following to -`example-1.json` to the root of this repository and run `gambit mutate --json -example-1.json` +#### Paths in Configuration Files -```json -{ - "filename": "benchmarks/BinaryOpMutation/BinaryOpMutation.sol" -} +Relative paths in a Gambit configuration file are _relative to the parent +directory of the configuration file_. This allows Gambit to be run from any +location without affecting the build configuration. + +_**Warning:** +Remapping targets are **not relative paths**! If you specify a remapping +`@map=expanded/@map`, the target `expanded/@map` doesn't need to be a valid +path. Instead, it needs to be be valid when extending a provided `import_path`. +So if the only import path is `.`, then `./expanded/@map` has to exist. But if +import paths `contracts` and `modules` are given, then one of either +`contracts/expanded/@map` or `modules/expanded/@map` needs to exist._ + +### Import Paths and Remappings + +Gambit resolves imports while parsing, and this requires that you specify any +import paths and remappings that you would pass to `solc`. + +Instead of `solc`'s `--base-path` and `--include-path` arguments, Gambit uses +a simpler scheme and replaces both of these with a single `--import_paths` +argument. For instance, if the `solc` invocation is `solc C.sol --base-path . +--include-path modules` , then the Gambit invocation becomes `gambit mutate C.sol +--import_paths . modules`. + +Remappings are specified with the `--import_maps` argument. If the `solc` +invocation is `solc C.sol @openzeppelin=node_modules/@openzeppelin`, then the +Gambit invocation becomes `gambit mutate C.sol --import_maps +@openzeppelin=node_modules/@openzeppelin`. + +### Mutant Validation + +Gambit uses provided import paths and import remappings to invoke `solc`. For +instance, if you invoke `gambit mutate C.sol --import_paths A B C --import_maps +@x=y/@x`, then Gambit will validate a generated mutant by calling `solc +MutatedC.sol --base-path A --include-path B --include-path C @x=y/@x`. If +you need to specify a `solc` `--allow-paths` argument, use the `mutate` +command's `--solc_allow_paths` argument. + + +## The `summary` command + +The `summary` command allows the user to see a summary of a `mutate` run: + +``` +$ gambit mutate benchmarks/Ops/AOR/AOR.sol +Generated 27 mutants in 0.41 seconds + +$ gambit summary +STD: 5 ( 18.52%) +AOR: 22 ( 81.48%) +--------------------- +TOT: 27 (100.00%) ``` -Gambit also supports using multiple configurations in the same file: instead of -a single JSON object, your configuration file should contain an array of objects: +To print the diffs of specific mutants, pass the `--mids` option: -```json -[ - { - "filename": "Foo.sol", - "contract": "C", - "functions": ["bar", "baz"], - "solc": "solc8.12", - "solc_optimize": true - }, - { - "filename": "Blip.sol", - "contract": "D", - "functions": ["bang"], - "solc": "solc8.12" - "mutations": [ - "binary-op-mutation", - "swap-arguments-operator-mutation" - ] - } -] ``` +$ gambit summary --mids 1 2 -This configuration file will perform all mutations on `Foo.sol`'s functions -`bar` and `baz` in the contract `C`, and only `binary-op-mutation` and -`swap-arguments-operator-mutation` mutations on the function `bang` in the -contract `D`. Both will compile using the Solidity compiler version `solc5.12`. + === Mutant ID: 1 [StatementDeletion] === -### Paths in Configuration Files +--- original ++++ mutant +@@ -9,8 +9,9 @@ + // a * b + // a / b + // a % b ++ /// StatementDeletion(`return a + b` |==> `assert(true)`) of: `return a + b;` + function plus(int256 a, int256 b) public pure returns (int256) { +- return a + b; ++ assert(true); + } -Relative paths in a Gambit configuration file are _relative to the parent -directory of the configuration file_. So if the JSON file listed above was moved -to the `benchmarks/` directory the `"filename"` would need to be updated to -`BinaryOpMutation/BinaryOpMutation.sol`. + // Expect 4 mutants: + +Path: mutants/1/benchmarks/Ops/AOR/AOR.sol + + + === Mutant ID: 2 [ArithmeticOperatorReplacement] === + +--- original ++++ mutant +@@ -9,8 +9,9 @@ + // a * b + // a / b + // a % b ++ /// ArithmeticOperatorReplacement(`+` |==> `-`) of: `return a + b;` + function plus(int256 a, int256 b) public pure returns (int256) { +- return a + b; ++ return a - b; + } + + // Expect 4 mutants: + +Path: mutants/2/benchmarks/Ops/AOR/AOR.sol + +Pass the `--short` option to print a shorter summary of each mutant: + +``` +$ gambit summary --mids 1 2 3 4 5 --short + +(1) STD [mutants/1/benchmarks/Ops/AOR/AOR.sol@13:9] return a + b -> assert(true) +(2) AOR [mutants/2/benchmarks/Ops/AOR/AOR.sol@13:18] + -> - +(3) AOR [mutants/3/benchmarks/Ops/AOR/AOR.sol@13:18] + -> * +(4) AOR [mutants/4/benchmarks/Ops/AOR/AOR.sol@13:18] + -> / +(5) AOR [mutants/5/benchmarks/Ops/AOR/AOR.sol@13:18] + -> % +``` + +_**Note:** +The `summary` command is currently experimental, and its output and interface +may change in future releases._ + + ## Results Directory `gambit mutate` produces all results in an output directory (default: `gambit_out`). Here is an example: -```bash -gambit mutate -f benchmarks/BinaryOpMutation/BinaryOpMutation.sol -n 5 -tree gambit_out -L 2 ``` - -
-Generated 5 mutants in 0.15 seconds
-
+$ gambit mutate benchmarks/Ops/AOR/AOR.sol -n 5
+Generated 5 mutants in 0.14 seconds
+$ tree gambit_out -L 2
 gambit_out
 ├── gambit_results.json
-├── input_json
 ├── mutants
 │   ├── 1
 │   ├── 2
@@ -383,61 +470,58 @@ gambit_out
 │   └── 5
 └── mutants.log
 
-
+``` This has the following structure: + `gambit_results.json`: a JSON file with detailed results -+ `input_json/`: intermediate files produced by `solc` that are used during mutation + `mutants/`: exported mutants. Each mutant is in its own directory named after its mutant ID (mid) 1, 2, 3, ... + `mutants.log`: a log file with all mutant information. This is similar to `results.json` but in a different format and with different information -## CLI Options - `gambit mutate` supports the following options; for a comprehensive list, run - `gambit mutate --help`: + +## Testing +Gambit has _unit tests_ and _regression tests_. Run unit tests with `cargo +test`. -| Option | Description | -| :-------------------- | :--------------------------------------------------------------------------------------------------------------------------- | -| `-o`, `--outdir` | specify Gambit's output directory (defaults to `gambit_out`) | -| `--no_overwrite` | do not overwrite an output directory; if the output directory exists, print an error and exit | -| `-n`, `--num_mutants` | randomly downsample to a given number of mutants. | -| `-s`, `--seed` | specify a random seed. For reproducability, Gambit defaults to using the seed `0`. To randomize the seed use `--random-seed` | -| `--random_seed` | use a random seed. Note this overrides any value specified by `--seed` | -| `--contract` | specify a specific contract name to mutate; by default mutate all contracts | -| `--functions` | specify one or more functions to mutate; by default mutate all functions | -| `--mutations` | specify one or more mutation operators to use; only generates mutants that are created using the specified operators | +_**Note:** +All unit tests (`cargo test`) are currently run using `solc8.13`. Tests may fail +if `solc` points at a different version of the compiler._ -Gambit also supports _pass-through arguments_, which are arguments that are -passed directly to solc. All pass-through arguments are prefixed with `solc-`: +Run regression tests with `scripts/run_regressions.sh`. This script runs +`gambit mutate` on all configuration files in `benchmarks/config-jsons` and +compares the output against the expected output in `resources/regressions`. + +_**Note:** +To update regression tests (e.g., in case of new test cases, new mutation +operators, altered mutation operators, etc), use the +`scripts/make_regressions.sh` script._ + + -| Option | Description | -| :-------------------- | :---------------------------------------------------------------------------- | -| `--solc_base_path` | passes a value to solc's `--base-path` argument | -| `--solc_allow_paths` | passes a value to solc's `--allow-paths` argument | -| `--solc_include_path` | passes a value to solc's `--include-path` argument | -| `--solc_remappings` | passes a value to directly to solc: this should be of the form `prefix=path`. | ## Mutation Operators Gambit implements the following mutation operators -| Mutation Operator | Description | Example | -| ------------------------------------ | -------------------------------------------------------- | ---------------------------------------------- | -| **binary-op-mutation** | Replace a binary operator with another | `a+b` -> `a-b` | -| **unary-operator-mutation** | Replace a unary operator with another | `~a` -> `-a` | -| **require-mutation** | Alter the condition of a `require` statement | `require(some_condition())` -> `require(true)` | -| **assignment-mutation** | Replaces the rhs of a mutation | `x = foo();` -> `x = -1;` | -| **delete-expression-mutation** | Replace an expression statement with `assert(true)` | `foo();` -> `assert(true);` | -| **if-cond-mutation** | Mutate the conditional of an `if` statement | `if (C) {...}` -> `if (true) {...}` | -| **swap-arguments-operator-mutation** | Swap the order of non-commutative operators | `a - b` -> `b - a` | -| **elim-delegate-mutation** | Change a `delegatecall()` to a `call()` | `_c.delegatecall(...)` -> `_c.call(...)` | -| **function-call-mutation** | **(Disabled)** Changes arguments of a function | `add(a, b)` -> `add(a, a)` | -| **swap-arguments-function-mutation** | **(Disabled)** Swaps the order of a function's arguments | `add(a, b)` -> `add(b, a)` | - -For more details on each mutation type, refer to the [full documentation](https://docs.certora.com/en/latest/docs/gambit/gambit.html#mutation-types). - +| Mutation Operator | Description | Example | +| ----------------------------------- | --------------------------------------------------------------- | -------------------------------------------- | +| **arithmetic-operator-replacement** | Replace an arithmetic operator with another | `a + b` -> `a - b` | +| **bitwise-operator-replacement** | Replace a bitwise operator with another | `a ^ b` -> `a & b` | +| **elim-delegate-call** | Change a `delegatecall()` to a `call()` | `_c.delegatecall(...)` -> `_c.call(...)` | +| **expression-value-repalcement** | **(Experimental)** Replace expression with a value of same type | `a + b * 3` -> `0` | +| **literal-value-replacement** | Replace a literal value with another | `1` -> `0` | +| **logical-operator-replacement** | Replace a logical expression | `a && b` -> `false` | +| **relational-operator-replacement** | Replace a relational expression | `a < b` -> `true` | +| **shift-operator-replacement** | Replace a shift operator with another | `a << b` -> `a >> b` | +| **unary-operator-replacement** | Replace a unary operator with another | `-b` -> `~b` | +| **statement-deletion** | Replace a statement with a no-op (`assert(true)`) | `self.checkInvariants();` -> `assert(true);` | + +For more details on each mutation type, refer to the [full +documentation](https://docs.certora.com/en/latest/docs/gambit/gambit.html#mutation-types). + + ## Contact If you have ideas for interesting mutations or other features, we encourage you to make a PR or [email](mailto:chandra@certora.com) us. @@ -448,6 +532,7 @@ We thank [Vishal Canumalla](https://homes.cs.washington.edu/~vishalc/) for their excellent contributions to an earlier prototype of Gambit. + [config-examples]: https://github.com/Certora/gambit/blob/master/benchmarks/config-jsons/ [test6]: https://github.com/Certora/gambit/blob/master/benchmarks/config-jsons/test6.json diff --git a/benchmarks/10Power/TenPower.sol b/benchmarks/10Power/TenPower.sol deleted file mode 100644 index 38385d1..0000000 --- a/benchmarks/10Power/TenPower.sol +++ /dev/null @@ -1,12 +0,0 @@ -// SPDX-License-Identifier: GPL-3.0-only -pragma solidity >0.7.0; -pragma experimental ABIEncoderV2; - -contract TenPower { - function get10PowerDecimals(uint8 decimals) public pure returns (uint256) { - uint256 a = 10; - uint256 res = a ** decimals; - return res; - // return 10 ** decimals; - } -} diff --git a/benchmarks/AssignmentMutation/AssignmentMutation.sol b/benchmarks/AssignmentMutation/AssignmentMutation.sol deleted file mode 100644 index a409a57..0000000 --- a/benchmarks/AssignmentMutation/AssignmentMutation.sol +++ /dev/null @@ -1,19 +0,0 @@ -// SPDX-License-Identifier: GPL-3.0-only -pragma solidity >0.7.0; -pragma experimental ABIEncoderV2; - -contract AssignmentMutation { - uint256 public x; - uint256 public y; - uint256 public z; - bool public a; - bool public b; - - constructor() { - x = 42; // original: 42 - y = 13; // original: 13 - z = 3110; // original: 3110 - a = true; // original: true - b = false; // original: false - } -} diff --git a/benchmarks/AssignmentMutation/expected.sol b/benchmarks/AssignmentMutation/expected.sol deleted file mode 100644 index c58edba..0000000 --- a/benchmarks/AssignmentMutation/expected.sol +++ /dev/null @@ -1,20 +0,0 @@ -// SPDX-License-Identifier: GPL-3.0-only -pragma solidity >0.7.0; -pragma experimental ABIEncoderV2; - -contract AssignmentMutation { - uint256 public x; - uint256 public y; - uint256 public z; - bool public a; - bool public b; - - constructor() { - x = 42; // original: 42 - y = 13; // original: 13 - z = 3110; // original: 3110 - a = true; // original: true - /// AssignmentMutation of: b = false; // original: false - b = true; // original: false - } -} diff --git a/benchmarks/BinaryOpMutation/BinaryOpMutation.sol b/benchmarks/BinaryOpMutation/BinaryOpMutation.sol deleted file mode 100644 index 9331079..0000000 --- a/benchmarks/BinaryOpMutation/BinaryOpMutation.sol +++ /dev/null @@ -1,30 +0,0 @@ -// SPDX-License-Identifier: GPL-3.0-only -pragma solidity >0.7.0; -pragma experimental ABIEncoderV2; - -contract BinaryOpMutation { - function myAddition(uint256 x, uint256 y) public pure returns (uint256) { - return x + y; - } - - function mySubtraction(uint256 x, uint256 y) public pure returns (uint256) { - return x - y; - } - - function myMultiplication(uint256 x, uint256 y) public pure returns (uint256) { - return x * y; - } - - function myDivision(uint256 x, uint256 y) public pure returns (uint256) { - return x / y; - } - - function myModulo(uint256 x, uint256 y) public pure returns (uint256) { - return x % y; - } - - function myExponentiation(uint256 x, uint256 y) public pure returns (uint256) { - return x ** y; - } - -} diff --git a/benchmarks/BinaryOpMutation/expected.sol b/benchmarks/BinaryOpMutation/expected.sol deleted file mode 100644 index 4a9a637..0000000 --- a/benchmarks/BinaryOpMutation/expected.sol +++ /dev/null @@ -1,31 +0,0 @@ -// SPDX-License-Identifier: GPL-3.0-only -pragma solidity >0.7.0; -pragma experimental ABIEncoderV2; - -contract BinaryOpMutation { - function myAddition(uint256 x, uint256 y) public pure returns (uint256) { - return x + y; - } - - function mySubtraction(uint256 x, uint256 y) public pure returns (uint256) { - /// BinaryOpMutation of: return x - y; - return x + y; - } - - function myMultiplication(uint256 x, uint256 y) public pure returns (uint256) { - return x * y; - } - - function myDivision(uint256 x, uint256 y) public pure returns (uint256) { - return x / y; - } - - function myModulo(uint256 x, uint256 y) public pure returns (uint256) { - return x % y; - } - - function myExponentiation(uint256 x, uint256 y) public pure returns (uint256) { - return x ** y; - } - -} diff --git a/benchmarks/DeleteExpressionMutation/DeleteExpressionMutation.sol b/benchmarks/DeleteExpressionMutation/DeleteExpressionMutation.sol deleted file mode 100644 index 6b199df..0000000 --- a/benchmarks/DeleteExpressionMutation/DeleteExpressionMutation.sol +++ /dev/null @@ -1,14 +0,0 @@ -// SPDX-License-Identifier: GPL-3.0-only -pragma solidity >0.7.0; -pragma experimental ABIEncoderV2; - -contract DeleteExpressionMutation { - - function myIdentity(uint256 x) public pure returns (uint256) { - uint256 result = 0; - for (uint256 i = 0; i < x; i++) { - result ++; - } - return result; - } -} diff --git a/benchmarks/DeleteExpressionMutation/expected.sol b/benchmarks/DeleteExpressionMutation/expected.sol deleted file mode 100644 index 096241e..0000000 --- a/benchmarks/DeleteExpressionMutation/expected.sol +++ /dev/null @@ -1,15 +0,0 @@ -// SPDX-License-Identifier: GPL-3.0-only -pragma solidity >0.7.0; -pragma experimental ABIEncoderV2; - -contract DeleteExpressionMutation { - - function myIdentity(uint256 x) public pure returns (uint256) { - uint256 result = 0; - /// DeleteExpressionMutation of: for (uint256 i = 0; i < x; i++) { - for (uint256 i = 0; i < x; assert(true)) { - result ++; - } - return result; - } -} diff --git a/benchmarks/ElimDelegateMutation/ElimDelegateMutation.sol b/benchmarks/ElimDelegateMutation/ElimDelegateMutation.sol deleted file mode 100644 index 9731cfb..0000000 --- a/benchmarks/ElimDelegateMutation/ElimDelegateMutation.sol +++ /dev/null @@ -1,31 +0,0 @@ -// SPDX-License-Identifier: GPL-3.0-only -pragma solidity ^0.8.13; - -contract B { - uint public num; - address public sender; - uint public value; - - function setVars(uint _num) public payable { - num = _num; - sender = msg.sender; - value = msg.value; - } -} - -contract A { - uint public num; - address public sender; - uint public value; - bool public delegateSuccessful; - bytes public myData; - - - function setVars(address _contract, uint _num) public payable { - (bool success, bytes memory data) = _contract.delegatecall( - abi.encodeWithSignature("setVars(uint256)", _num) - ); - delegateSuccessful = success; - myData = data; - } -} diff --git a/benchmarks/ElimDelegateMutation/expected.sol b/benchmarks/ElimDelegateMutation/expected.sol deleted file mode 100644 index 1aa8acf..0000000 --- a/benchmarks/ElimDelegateMutation/expected.sol +++ /dev/null @@ -1,32 +0,0 @@ -// SPDX-License-Identifier: GPL-3.0-only -pragma solidity ^0.8.13; - -contract B { - uint public num; - address public sender; - uint public value; - - function setVars(uint _num) public payable { - num = _num; - sender = msg.sender; - value = msg.value; - } -} - -contract A { - uint public num; - address public sender; - uint public value; - bool public delegateSuccessful; - bytes public myData; - - - function setVars(address _contract, uint _num) public payable { - /// ElimDelegateMutation of: (bool success, bytes memory data) = _contract.delegatecall( - (bool success, bytes memory data) = _contract.call( - abi.encodeWithSignature("setVars(uint256)", _num) - ); - delegateSuccessful = success; - myData = data; - } -} diff --git a/benchmarks/FallbackMutations/Fallback.sol b/benchmarks/FallbackMutations/Fallback.sol new file mode 100644 index 0000000..e1936be --- /dev/null +++ b/benchmarks/FallbackMutations/Fallback.sol @@ -0,0 +1,17 @@ +// SPDX-License-Identifier: GPL-3.0-only + +pragma solidity ^0.8.13; + +contract Fallback { + function checkArgumentsAreReplaced( + uint256 num, + address addr, + bool b + ) public returns (uint256) { + if (num == 0) { + return 0; + } else { + return checkArgumentsAreReplaced(num - 1, addr, !b); + } + } +} diff --git a/benchmarks/FunctionCallMutation/FunctionCallMutation.sol b/benchmarks/FunctionCallMutation/FunctionCallMutation.sol deleted file mode 100644 index 067c4f1..0000000 --- a/benchmarks/FunctionCallMutation/FunctionCallMutation.sol +++ /dev/null @@ -1,13 +0,0 @@ -// SPDX-License-Identifier: GPL-3.0-only -pragma solidity >0.7.0; -pragma experimental ABIEncoderV2; - -contract FunctionCallMutation { - function myAddition(uint256 x, uint256 y) public pure returns (uint256) { - return x + y; - } - - function myOtherAddition(uint256 x, uint256 y) public pure returns (uint256) { - return myAddition(x, y); - } -} diff --git a/benchmarks/FunctionCallMutation/expected.sol b/benchmarks/FunctionCallMutation/expected.sol deleted file mode 100644 index 802c577..0000000 --- a/benchmarks/FunctionCallMutation/expected.sol +++ /dev/null @@ -1,14 +0,0 @@ -// SPDX-License-Identifier: GPL-3.0-only -pragma solidity >0.7.0; -pragma experimental ABIEncoderV2; - -contract FunctionCallMutation { - function myAddition(uint256 x, uint256 y) public pure returns (uint256) { - return x + y; - } - - function myOtherAddition(uint256 x, uint256 y) public pure returns (uint256) { - /// FunctionCallMutation of: return myAddition(x, y); - return x; - } -} diff --git a/benchmarks/IfStatementMutation/IfStatementMutation.sol b/benchmarks/IfStatementMutation/IfStatementMutation.sol deleted file mode 100644 index c36144b..0000000 --- a/benchmarks/IfStatementMutation/IfStatementMutation.sol +++ /dev/null @@ -1,14 +0,0 @@ -// SPDX-License-Identifier: GPL-3.0-only -pragma solidity >0.7.0; -pragma experimental ABIEncoderV2; - -contract IfStatementMutation { - function myBooleanNegation(bool a) public pure returns (bool) { - if (a) { - return true; - } - else { - return false; - } - } -} diff --git a/benchmarks/IfStatementMutation/expected.sol b/benchmarks/IfStatementMutation/expected.sol deleted file mode 100644 index 34a76c9..0000000 --- a/benchmarks/IfStatementMutation/expected.sol +++ /dev/null @@ -1,15 +0,0 @@ -// SPDX-License-Identifier: GPL-3.0-only -pragma solidity >0.7.0; -pragma experimental ABIEncoderV2; - -contract IfStatementMutation { - function myBooleanNegation(bool a) public pure returns (bool) { - /// IfStatementMutation of: if (a) { - if (false) { - return true; - } - else { - return false; - } - } -} diff --git a/benchmarks/ImportMaps/contracts/B.sol b/benchmarks/ImportMaps/contracts/B.sol new file mode 100644 index 0000000..6cf0942 --- /dev/null +++ b/benchmarks/ImportMaps/contracts/B.sol @@ -0,0 +1,6 @@ +// SPDX-License-Identifier: GPL-3.0-only +pragma solidity >0.7.0; + +import "@lib/Lib.sol"; + +contract B {} diff --git a/benchmarks/ImportMaps/contracts/Contract.sol b/benchmarks/ImportMaps/contracts/Contract.sol new file mode 100644 index 0000000..3f123ec --- /dev/null +++ b/benchmarks/ImportMaps/contracts/Contract.sol @@ -0,0 +1,11 @@ +// SPDX-License-Identifier: GPL-3.0-only +pragma solidity >0.7.0; + +import "@lib/Lib.sol"; +import "contracts/B.sol"; + +contract Contract { + function plus(int256 a, int256 b) public pure returns (int256) { + return a + b; + } +} diff --git a/benchmarks/ImportMaps/node_modules/lib/Lib.sol b/benchmarks/ImportMaps/node_modules/lib/Lib.sol new file mode 100644 index 0000000..9dcb859 --- /dev/null +++ b/benchmarks/ImportMaps/node_modules/lib/Lib.sol @@ -0,0 +1,7 @@ +// SPDX-License-Identifier: GPL-3.0-only +pragma solidity >0.7.0; + + +contract Lib { + +} \ No newline at end of file diff --git a/benchmarks/NoImportPath/README.md b/benchmarks/NoImportPath/README.md new file mode 100644 index 0000000..578aa84 --- /dev/null +++ b/benchmarks/NoImportPath/README.md @@ -0,0 +1,14 @@ +# README + +This file tests the case where a configuration file doesn't have an import path. +This should print a warning: + +``` +Warning: No `import_paths` specified in config + Adding default import path /Users/benku/Gambit/benchmarks/NoImportPath. + To fix, add + "import_paths": ["/Users/benku/Gambit/benchmarks/NoImportPath"], + to benchmarks/NoImportPath/gambit.json +``` + +and generate mutants. \ No newline at end of file diff --git a/resources/regressions/multiple-contracts-2.json/mutants/1/MultipleContracts/C.sol b/benchmarks/NoImportPath/contracts/C.sol similarity index 91% rename from resources/regressions/multiple-contracts-2.json/mutants/1/MultipleContracts/C.sol rename to benchmarks/NoImportPath/contracts/C.sol index a514961..56920d5 100644 --- a/resources/regressions/multiple-contracts-2.json/mutants/1/MultipleContracts/C.sol +++ b/benchmarks/NoImportPath/contracts/C.sol @@ -2,14 +2,15 @@ pragma solidity ^0.8.13; +import "contracts/Imported.sol"; + library Utils { function getarray(address[] memory c, address e) internal pure { assert(c[0] == e); } function add(int8 a, int8 b) public pure returns (int8) { - /// BinaryOpMutation(`+` |==> `-`) of: `return a + b;` - return a-b; + return a + b; } } diff --git a/benchmarks/NoImportPath/contracts/Imported.sol b/benchmarks/NoImportPath/contracts/Imported.sol new file mode 100644 index 0000000..cb8b0d7 --- /dev/null +++ b/benchmarks/NoImportPath/contracts/Imported.sol @@ -0,0 +1,9 @@ +// SPDX-License-Identifier: GPL-3.0-only + +pragma solidity ^0.8.13; + +contract Imported { + function foo() public pure returns (uint256) { + return 0; + } +} diff --git a/benchmarks/NoImportPath/gambit.json b/benchmarks/NoImportPath/gambit.json new file mode 100644 index 0000000..8595c0f --- /dev/null +++ b/benchmarks/NoImportPath/gambit.json @@ -0,0 +1,3 @@ +{ + "filename": "contracts/C.sol" +} \ No newline at end of file diff --git a/benchmarks/Ops/AOR/AOR.sol b/benchmarks/Ops/AOR/AOR.sol new file mode 100644 index 0000000..c659050 --- /dev/null +++ b/benchmarks/Ops/AOR/AOR.sol @@ -0,0 +1,60 @@ +// SPDX-License-Identifier: GPL-3.0-only +pragma solidity >0.7.0; +pragma experimental ABIEncoderV2; + +// This contract provides test functions for Arithmetic operator replacement +contract AOR { + // Expect 4 mutants: + // a - b + // a * b + // a / b + // a % b + function plus(int256 a, int256 b) public pure returns (int256) { + return a + b; + } + + // Expect 4 mutants: + // a + b + // a * b + // a / b + // a % b + function minus(int256 a, int256 b) public pure returns (int256) { + return a - b; + } + + // Expect 4 mutants: + // a - b + // a * b + // a / b + // a % b + function times_with_parens( + int256 a, + int256 b + ) public pure returns (int256) { + return ((a)) * b; + } + + // Expect 5 mutants: + // a + b + // a - b + // a / b + // a ** b + // a % b + function unsigned_times_with_parens( + uint256 a, + uint256 b + ) public pure returns (uint256) { + return ((a)) * b; + } + + // Expect 5 mutants: + // a + b + // a - b + // a / b + // a * b + // a % b + + function power(uint256 a, uint256 b) public pure returns (uint256) { + return a ** b; + } +} diff --git a/benchmarks/Ops/BOR/BOR.sol b/benchmarks/Ops/BOR/BOR.sol new file mode 100644 index 0000000..2eb51bf --- /dev/null +++ b/benchmarks/Ops/BOR/BOR.sol @@ -0,0 +1,24 @@ +// SPDX-License-Identifier: GPL-3.0-only +pragma solidity >0.7.0; +pragma experimental ABIEncoderV2; + +// This contract provides test functions for Bitwise Operator Replacement (BOR) +contract BOR { + // Expect 1 mutants: + // a & b; + function bw_or(int256 a, int256 b) public pure returns (int256) { + return a | b; + } + + // Expect 1 mutants: + // a | b; + function bw_and(int256 a, int256 b) public pure returns (int256) { + return a & b; + } + + // Expect 1 mutants: + // a | b; + function bw_xor(int256 a, int256 b) public pure returns (int256) { + return a ^ b; + } +} diff --git a/benchmarks/Ops/EDC/EDC.sol b/benchmarks/Ops/EDC/EDC.sol new file mode 100644 index 0000000..b5290c1 --- /dev/null +++ b/benchmarks/Ops/EDC/EDC.sol @@ -0,0 +1,21 @@ +// SPDX-License-Identifier: GPL-3.0-only +pragma solidity ^0.8.13; + +contract Helper { + function setVars(uint _num) public payable {} +} + +contract EDC { + uint public num; + address public sender; + uint public value; + bool public delegateSuccessful; + bytes public myData; + + function setVars(address _contract) public payable { + (bool success, ) = _contract.delegatecall( + abi.encodeWithSignature("setVars(uint256)", 1) + ); + require(success, "Delegatecall failed"); + } +} diff --git a/benchmarks/Ops/EVR/EVR.sol b/benchmarks/Ops/EVR/EVR.sol new file mode 100644 index 0000000..c3ded1b --- /dev/null +++ b/benchmarks/Ops/EVR/EVR.sol @@ -0,0 +1,24 @@ +// SPDX-License-Identifier: GPL-3.0-only +pragma solidity >0.7.0; +pragma experimental ABIEncoderV2; + +// This contract provides test functions for relational operator replacement (ROR) +contract EVR { + function add(uint256 a, uint256 b) public pure returns (uint256) { + return a + b; + } + + function evr_test_1(uint256 a, uint256 b) public pure returns (uint256) { + uint256 result = add(a, b); + return result; + } + + function evr_test_2(uint256 a, uint256 b) public pure returns (uint256) { + bool c = a < b; + while (c) { + b = b - a; + c = a < b; + } + return a - b; + } +} diff --git a/benchmarks/Ops/LOR/LOR.sol b/benchmarks/Ops/LOR/LOR.sol new file mode 100644 index 0000000..7612c70 --- /dev/null +++ b/benchmarks/Ops/LOR/LOR.sol @@ -0,0 +1,25 @@ +// SPDX-License-Identifier: GPL-3.0-only +pragma solidity >0.7.0; +pragma experimental ABIEncoderV2; + +// This contract provides test functions for relational operator replacement (ROR) +contract LOR { + // Expect three mutants: a, b, false + function and(bool a, bool b) public pure returns (bool) { + return a && b; + } + + // Expect three mutants: a, b, true + function or(bool a, bool b) public pure returns (bool) { + return a || b; + } + + // Expect three mutants, x < y, a != (x >= y), true + function more_or(bool a, int x, int y) public pure returns (bool) { + return (x < y) || (a != (x >= y)); + } + + function not(bool a) public pure returns (bool) { + return !a; + } +} diff --git a/benchmarks/Ops/LVR/LVR.sol b/benchmarks/Ops/LVR/LVR.sol new file mode 100644 index 0000000..a9669e3 --- /dev/null +++ b/benchmarks/Ops/LVR/LVR.sol @@ -0,0 +1,42 @@ +// SPDX-License-Identifier: GPL-3.0-only +pragma solidity >0.7.0; +pragma experimental ABIEncoderV2; + +// This contract provides test functions for relational operator replacement (ROR) +contract LVR { + uint256 one_u = 1; + uint256 zero_u = 0; + int256 n_one_s = -1; + int256 one_s = 1; + int256 zero_s = 0; + + // Expect 1 mutant: 1 + function unsigned_zero() public pure returns (uint256) { + uint256 zero = 0; + return zero; + } + + // Expect 2 mutant: 0, 2 + function unsigned_one() public pure returns (uint256) { + uint256 one = 1; + return one; + } + + // Expect 2 mutants: 0, 1 + function signed_neg_one() public pure returns (int256) { + int256 neg_one = -1; + return neg_one; + } + + // Expect 2 mutants: -1, 0 + function signed_pos_one() public pure returns (int256) { + int256 pos_one = 1; + return pos_one; + } + + // Expect 2 mutants: -1, 1 + function signed_zero() public pure returns (int256) { + int256 zero = 0; + return zero; + } +} diff --git a/benchmarks/Ops/ROR/ROR.sol b/benchmarks/Ops/ROR/ROR.sol new file mode 100644 index 0000000..7b21443 --- /dev/null +++ b/benchmarks/Ops/ROR/ROR.sol @@ -0,0 +1,64 @@ +// SPDX-License-Identifier: GPL-3.0-only +pragma solidity >0.7.0; +pragma experimental ABIEncoderV2; + +// This contract provides test functions for relational operator replacement (ROR) +contract ROR { + // Expect 3 mutants: x <= y, x != y, false + function less(uint256 x, uint256 y) public pure returns (bool) { + return x < y; + } + + // Expect 3 mutants: x < y, x == y, true + function less_equal(uint256 x, uint256 y) public pure returns (bool) { + return x <= y; + } + + // Expect 3 mutants: x >= y, x != y, false + function more(uint256 x, uint256 y) public pure returns (bool) { + return x > y; + } + + // Expect 3 mutants: x > y, x == y, true + function more_equal(uint256 x, uint256 y) public pure returns (bool) { + return x >= y; + } + + // Expect 3 mutants: x >= y, x <= y, false + function equal_ord(uint256 x, uint256 y) public pure returns (bool) { + return x == y; + } + + // Expect 2 mutants: true, false + function equal_not_ord(bool x, bool y) public pure returns (bool) { + return x == y; + } + + // Expect 3 mutants: x > y, x < y, true + function not_equal_ord(uint256 x, uint256 y) public pure returns (bool) { + return x != y; + } + + // Expect 2 mutants: true, false + function not_equal_not_ord(bool x, bool y) public pure returns (bool) { + return x != y; + } + + // Expect 3 mutants: (x + y) > z, (x + y) == z, true + function more_equal_over_aor( + uint256 x, + uint256 y, + uint256 z + ) public pure returns (bool) { + return (x + y) >= z; + } + + // Expect 3 mutants: (x + y) > z, (x + y) < z, true + function not_equal_over_aor( + uint256 x, + uint256 y, + uint256 z + ) public pure returns (bool) { + return (x + y) != z; + } +} diff --git a/benchmarks/Ops/UOR/UOR.sol b/benchmarks/Ops/UOR/UOR.sol new file mode 100644 index 0000000..cbf673b --- /dev/null +++ b/benchmarks/Ops/UOR/UOR.sol @@ -0,0 +1,21 @@ +// SPDX-License-Identifier: GPL-3.0-only +pragma solidity >0.7.0; +pragma experimental ABIEncoderV2; + +// Unary Operator Replacement +contract UOR { + // Expect no mutants: cannot negate an unsigned integer + function unsigned_bw_not(uint256 x) public pure returns (uint256) { + return ~x; + } + + // Expect a single mutant: -x + function signed_bw_not(int256 x) public pure returns (int256) { + return ~x; + } + + // Expect a single mutant: ~x + function signed_neg(int256 x) public pure returns (int256) { + return -x; + } +} diff --git a/benchmarks/RequireMutation/RequireMutation.sol b/benchmarks/RequireMutation/RequireMutation.sol deleted file mode 100644 index 8517cc2..0000000 --- a/benchmarks/RequireMutation/RequireMutation.sol +++ /dev/null @@ -1,12 +0,0 @@ -// SPDX-License-Identifier: GPL-3.0-only -pragma solidity >0.7.0; -pragma experimental ABIEncoderV2; - -contract RequireMutation { - function myRequires(bool cond1, bool cond2, bool cond3) public pure returns (bool) { - require(cond1); - require(cond2); - require(cond3); - return true; - } -} diff --git a/benchmarks/RequireMutation/expected.sol b/benchmarks/RequireMutation/expected.sol deleted file mode 100644 index c0c41e2..0000000 --- a/benchmarks/RequireMutation/expected.sol +++ /dev/null @@ -1,13 +0,0 @@ -// SPDX-License-Identifier: GPL-3.0-only -pragma solidity >0.7.0; -pragma experimental ABIEncoderV2; - -contract RequireMutation { - function myRequires(bool cond1, bool cond2, bool cond3) public pure returns (bool) { - require(cond1); - require(cond2); - /// RequireMutation of: require(cond3); - require(!(cond3)); - return true; - } -} diff --git a/benchmarks/SwapArgumentsFunctionMutation/SwapArgumentsFunctionMutation.sol b/benchmarks/SwapArgumentsFunctionMutation/SwapArgumentsFunctionMutation.sol deleted file mode 100644 index c77fb13..0000000 --- a/benchmarks/SwapArgumentsFunctionMutation/SwapArgumentsFunctionMutation.sol +++ /dev/null @@ -1,14 +0,0 @@ -// SPDX-License-Identifier: GPL-3.0-only -pragma solidity >0.7.0; -pragma experimental ABIEncoderV2; - -contract SwapArgumentsFunctionMutation { - - function foo(uint256 x, uint256 y) public pure returns (uint256) { - return x - y; - } - - function bar(uint256 x, uint256 y) public pure returns (uint256) { - return foo(x, y); - } -} diff --git a/benchmarks/SwapArgumentsFunctionMutation/expected.sol b/benchmarks/SwapArgumentsFunctionMutation/expected.sol deleted file mode 100644 index 965f5a9..0000000 --- a/benchmarks/SwapArgumentsFunctionMutation/expected.sol +++ /dev/null @@ -1,15 +0,0 @@ -// SPDX-License-Identifier: GPL-3.0-only -pragma solidity >0.7.0; -pragma experimental ABIEncoderV2; - -contract SwapArgumentsFunctionMutation { - - function foo(uint256 x, uint256 y) public pure returns (uint256) { - return x - y; - } - - function bar(uint256 x, uint256 y) public pure returns (uint256) { - /// SwapArgumentsFunctionMutation of: return foo(x, y); - return foo(y, x); - } -} diff --git a/benchmarks/SwapArgumentsOperatorMutation/SwapArgumentsOperatorMutation.sol b/benchmarks/SwapArgumentsOperatorMutation/SwapArgumentsOperatorMutation.sol deleted file mode 100644 index 969f296..0000000 --- a/benchmarks/SwapArgumentsOperatorMutation/SwapArgumentsOperatorMutation.sol +++ /dev/null @@ -1,45 +0,0 @@ -// SPDX-License-Identifier: GPL-3.0-only -pragma solidity >0.7.0; -pragma experimental ABIEncoderV2; - -contract SwapArgumentsOperatorMutation { - function mySubtraction(uint256 x, uint256 y) public pure returns (uint256) { - return x - y; - } - - function myDivision(uint256 x, uint256 y) public pure returns (uint256) { - return x / y; - } - - function myModulo(uint256 x, uint256 y) public pure returns (uint256) { - return x % y; - } - - function myExponentiation(uint256 x, uint256 y) public pure returns (uint256) { - return x ** y; - } - - function myGT(uint256 x, uint256 y) public pure returns (bool) { - return x > y; - } - - function myLT(uint256 x, uint256 y) public pure returns (bool) { - return x < y; - } - - function myGE(uint256 x, uint256 y) public pure returns (bool) { - return x >= y; - } - - function myLE(uint256 x, uint256 y) public pure returns (bool) { - return x <= y; - } - - function mySAL(uint256 x, uint256 y) public pure returns (uint256) { - return x << y; - } - - function mySAR(uint256 x, uint256 y) public pure returns (uint256) { - return x >> y; - } -} diff --git a/benchmarks/SwapArgumentsOperatorMutation/expected.sol b/benchmarks/SwapArgumentsOperatorMutation/expected.sol deleted file mode 100644 index 43fa721..0000000 --- a/benchmarks/SwapArgumentsOperatorMutation/expected.sol +++ /dev/null @@ -1,46 +0,0 @@ -// SPDX-License-Identifier: GPL-3.0-only -pragma solidity >0.7.0; -pragma experimental ABIEncoderV2; - -contract SwapArgumentsOperatorMutation { - function mySubtraction(uint256 x, uint256 y) public pure returns (uint256) { - return x - y; - } - - function myDivision(uint256 x, uint256 y) public pure returns (uint256) { - return x / y; - } - - function myModulo(uint256 x, uint256 y) public pure returns (uint256) { - return x % y; - } - - function myExponentiation(uint256 x, uint256 y) public pure returns (uint256) { - return x ** y; - } - - function myGT(uint256 x, uint256 y) public pure returns (bool) { - return x > y; - } - - function myLT(uint256 x, uint256 y) public pure returns (bool) { - return x < y; - } - - function myGE(uint256 x, uint256 y) public pure returns (bool) { - return x >= y; - } - - function myLE(uint256 x, uint256 y) public pure returns (bool) { - return x <= y; - } - - function mySAL(uint256 x, uint256 y) public pure returns (uint256) { - /// SwapArgumentsOperatorMutation of: return x << y; - return y << x; - } - - function mySAR(uint256 x, uint256 y) public pure returns (uint256) { - return x >> y; - } -} diff --git a/benchmarks/SwapLinesMutation/SwapLinesMutation.sol b/benchmarks/SwapLinesMutation/SwapLinesMutation.sol deleted file mode 100644 index 5e24d87..0000000 --- a/benchmarks/SwapLinesMutation/SwapLinesMutation.sol +++ /dev/null @@ -1,12 +0,0 @@ -// SPDX-License-Identifier: GPL-3.0-only -pragma solidity >0.7.0; -pragma experimental ABIEncoderV2; - -contract SwapLinesMutation { - uint public num; - - function incTwice() public { - num += 1; - num += 2; - } -} diff --git a/benchmarks/SwapLinesMutation/expected.sol b/benchmarks/SwapLinesMutation/expected.sol deleted file mode 100644 index 0e48db6..0000000 --- a/benchmarks/SwapLinesMutation/expected.sol +++ /dev/null @@ -1,13 +0,0 @@ -// SPDX-License-Identifier: GPL-3.0-only -pragma solidity >0.7.0; -pragma experimental ABIEncoderV2; - -contract SwapLinesMutation { - uint public num; - - function incTwice() public { - /// SwapLinesMutation of: num += 1; - num += 2; - num += 1; - } -} diff --git a/benchmarks/UnaryOperatorMutation/UnaryOperatorMutation.sol b/benchmarks/UnaryOperatorMutation/UnaryOperatorMutation.sol deleted file mode 100644 index ff8f147..0000000 --- a/benchmarks/UnaryOperatorMutation/UnaryOperatorMutation.sol +++ /dev/null @@ -1,27 +0,0 @@ -// SPDX-License-Identifier: GPL-3.0-only -pragma solidity >0.7.0; -pragma experimental ABIEncoderV2; - -contract UnaryOperatorMutation { - function myBitwiseNeg(uint256 x) public pure returns (uint256) { - return ~ x; - } - - function myPrefixIncr(uint256 x) public pure returns (uint256) { - return ++x; - } - - function myPrefixDecr(uint256 x) public pure returns (uint256) { - return --x; - } - - function mySuffixIncr(uint256 x) public pure returns (uint256) { - x++; - return x; - } - - function mySuffixDecr(uint256 x) public pure returns (uint256) { - x--; - return x; - } -} diff --git a/benchmarks/UnaryOperatorMutation/expected.sol b/benchmarks/UnaryOperatorMutation/expected.sol deleted file mode 100644 index 2580b7c..0000000 --- a/benchmarks/UnaryOperatorMutation/expected.sol +++ /dev/null @@ -1,28 +0,0 @@ -// SPDX-License-Identifier: GPL-3.0-only -pragma solidity >0.7.0; -pragma experimental ABIEncoderV2; - -contract UnaryOperatorMutation { - function myBitwiseNeg(uint256 x) public pure returns (uint256) { - return ~ x; - } - - function myPrefixIncr(uint256 x) public pure returns (uint256) { - return ++x; - } - - function myPrefixDecr(uint256 x) public pure returns (uint256) { - return --x; - } - - function mySuffixIncr(uint256 x) public pure returns (uint256) { - x++; - return x; - } - - function mySuffixDecr(uint256 x) public pure returns (uint256) { - /// UnaryOperatorMutation of: x--; - x++; - return x; - } -} diff --git a/benchmarks/broken-config-jsons/file_not_found.json b/benchmarks/broken-config-jsons/file_not_found.json new file mode 100644 index 0000000..a3b51da --- /dev/null +++ b/benchmarks/broken-config-jsons/file_not_found.json @@ -0,0 +1,11 @@ +[ + { + "filename": "I don't exist.sol", + "import_paths": [ + ".." + ], + "mutations": [ + "aor" + ] + } +] \ No newline at end of file diff --git a/benchmarks/broken-config-jsons/invalid_config_missing_field_filename.json b/benchmarks/broken-config-jsons/invalid_config_missing_field_filename.json new file mode 100644 index 0000000..e7a5ce1 --- /dev/null +++ b/benchmarks/broken-config-jsons/invalid_config_missing_field_filename.json @@ -0,0 +1,10 @@ +[ + { + "import_paths": [ + ".." + ], + "mutations": [ + "aor" + ] + } +] \ No newline at end of file diff --git a/benchmarks/config-jsons/all.json b/benchmarks/config-jsons/all.json deleted file mode 100644 index 71b7d9e..0000000 --- a/benchmarks/config-jsons/all.json +++ /dev/null @@ -1,73 +0,0 @@ -[ - { - "filename": "../BinaryOpMutation/BinaryOpMutation.sol", - "sourceroot": "..", - "mutations": [ - "binary-op-mutation" - ] - }, - { - "filename": "../RequireMutation/RequireMutation.sol", - "sourceroot": "..", - "mutations": [ - "require-mutation" - ] - }, - { - "filename": "../AssignmentMutation/AssignmentMutation.sol", - "sourceroot": "..", - "mutations": [ - "assignment-mutation" - ] - }, - { - "filename": "../DeleteExpressionMutation/DeleteExpressionMutation.sol", - "sourceroot": "..", - "mutations": [ - "delete-expression-mutation" - ] - }, - { - "filename": "../FunctionCallMutation/FunctionCallMutation.sol", - "sourceroot": "..", - "mutations": [ - "function-call-mutation" - ] - }, - { - "filename": "../IfStatementMutation/IfStatementMutation.sol", - "sourceroot": "..", - "mutations": [ - "if-statement-mutation" - ], - "solc_optimize": true - }, - { - "filename": "../SwapArgumentsFunctionMutation/SwapArgumentsFunctionMutation.sol", - "sourceroot": "..", - "mutations": [ - "swap-arguments-function-mutation" - ] - }, - { - "filename": "../SwapArgumentsOperatorMutation/SwapArgumentsOperatorMutation.sol", - "sourceroot": "..", - "mutations": [ - "swap-arguments-operator-mutation" - ] - }, - { - "filename": "../UnaryOperatorMutation/UnaryOperatorMutation.sol", - "sourceroot": "..", - "mutations": [ - "unary-operator-mutation" - ] - }, - { - "filename": "../ElimDelegateMutation/ElimDelegateMutation.sol", - "sourceroot": "..", - "mutations": [ - "elim-delegate-mutation" - ] - } -] diff --git a/benchmarks/config-jsons/all_ops.json b/benchmarks/config-jsons/all_ops.json new file mode 100644 index 0000000..2a0a3ea --- /dev/null +++ b/benchmarks/config-jsons/all_ops.json @@ -0,0 +1,65 @@ +[ + { + "filename": "../Ops/AOR/AOR.sol", + "import_paths": [ + "../Ops" + ], + "mutations": [ + "AOR" + ] + }, + { + "filename": "../Ops/BOR/BOR.sol", + "import_paths": [ + "../Ops" + ], + "mutations": [ + "BOR" + ] + }, + { + "filename": "../Ops/EDC/EDC.sol", + "import_paths": [ + "../Ops" + ], + "mutations": [ + "EDC" + ] + }, + { + "filename": "../Ops/LOR/LOR.sol", + "import_paths": [ + "../Ops" + ], + "mutations": [ + "LOR" + ] + }, + { + "filename": "../Ops/LVR/LVR.sol", + "import_paths": [ + "../Ops" + ], + "mutations": [ + "LVR" + ] + }, + { + "filename": "../Ops/ROR/ROR.sol", + "import_paths": [ + "../Ops" + ], + "mutations": [ + "ROR" + ] + }, + { + "filename": "../Ops/UOR/UOR.sol", + "import_paths": [ + "../Ops" + ], + "mutations": [ + "UOR" + ] + } +] \ No newline at end of file diff --git a/benchmarks/config-jsons/aor.json b/benchmarks/config-jsons/aor.json new file mode 100644 index 0000000..ba4945c --- /dev/null +++ b/benchmarks/config-jsons/aor.json @@ -0,0 +1,11 @@ +[ + { + "filename": "../Ops/AOR/AOR.sol", + "import_paths": [ + ".." + ], + "mutations": [ + "aor" + ] + } +] \ No newline at end of file diff --git a/benchmarks/config-jsons/bor.json b/benchmarks/config-jsons/bor.json new file mode 100644 index 0000000..9e3b7f3 --- /dev/null +++ b/benchmarks/config-jsons/bor.json @@ -0,0 +1,11 @@ +[ + { + "filename": "../Ops/BOR/BOR.sol", + "import_paths": [ + ".." + ], + "mutations": [ + "bor" + ] + } +] \ No newline at end of file diff --git a/benchmarks/config-jsons/edc.json b/benchmarks/config-jsons/edc.json new file mode 100644 index 0000000..2bc430c --- /dev/null +++ b/benchmarks/config-jsons/edc.json @@ -0,0 +1,11 @@ +[ + { + "filename": "../Ops/EDC/EDC.sol", + "import_paths": [ + ".." + ], + "mutations": [ + "edc" + ] + } +] \ No newline at end of file diff --git a/benchmarks/config-jsons/evr.json b/benchmarks/config-jsons/evr.json new file mode 100644 index 0000000..07c3960 --- /dev/null +++ b/benchmarks/config-jsons/evr.json @@ -0,0 +1,12 @@ +[ + { + "filename": "../Ops/EVR/EVR.sol", + "import_paths": [ + ".." + ], + "mutations": [], + "fallback_mutations": [ + "evr" + ] + } +] \ No newline at end of file diff --git a/benchmarks/config-jsons/lor.json b/benchmarks/config-jsons/lor.json new file mode 100644 index 0000000..daccb97 --- /dev/null +++ b/benchmarks/config-jsons/lor.json @@ -0,0 +1,11 @@ +[ + { + "filename": "../Ops/LOR/LOR.sol", + "import_paths": [ + ".." + ], + "mutations": [ + "logical-operator-replacement" + ] + } +] \ No newline at end of file diff --git a/benchmarks/config-jsons/lvr.json b/benchmarks/config-jsons/lvr.json new file mode 100644 index 0000000..1f93f80 --- /dev/null +++ b/benchmarks/config-jsons/lvr.json @@ -0,0 +1,11 @@ +[ + { + "filename": "../Ops/LVR/LVR.sol", + "import_paths": [ + ".." + ], + "mutations": [ + "lvr" + ] + } +] \ No newline at end of file diff --git a/benchmarks/config-jsons/no_import_path.json b/benchmarks/config-jsons/no_import_path.json new file mode 120000 index 0000000..2180991 --- /dev/null +++ b/benchmarks/config-jsons/no_import_path.json @@ -0,0 +1 @@ +../NoImportPath/gambit.json \ No newline at end of file diff --git a/benchmarks/config-jsons/ror.json b/benchmarks/config-jsons/ror.json new file mode 100644 index 0000000..759613f --- /dev/null +++ b/benchmarks/config-jsons/ror.json @@ -0,0 +1,11 @@ +[ + { + "filename": "../Ops/ROR/ROR.sol", + "import_paths": [ + ".." + ], + "mutations": [ + "relational-operator-replacement" + ] + } +] \ No newline at end of file diff --git a/benchmarks/config-jsons/sanity-config.json b/benchmarks/config-jsons/sanity-config.json deleted file mode 100644 index a608aeb..0000000 --- a/benchmarks/config-jsons/sanity-config.json +++ /dev/null @@ -1,11 +0,0 @@ -[ - { - "filename": "../BinaryOpMutation/BinaryOpMutation.sol", - "solc": "solc", - "num_mutants": 1, - "mutations": [ - "binary-op-mutation" - ], - "sourceroot": "../BinaryOpMutation" - } -] diff --git a/benchmarks/config-jsons/test1.json b/benchmarks/config-jsons/test1.json deleted file mode 100644 index 9db78de..0000000 --- a/benchmarks/config-jsons/test1.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "filename": "../10Power/TenPower.sol", - "mutations": [ - "binary-op-mutation", - "swap-arguments-operator-mutation" - ], - "solc_optimize": true, - "sourceroot": ".." -} diff --git a/benchmarks/config-jsons/test2.json b/benchmarks/config-jsons/test2.json deleted file mode 100644 index 4f6aa6e..0000000 --- a/benchmarks/config-jsons/test2.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "filename": "../10Power/TenPower.sol", - "mutations": [ - "binary-op-mutation", - "swap-arguments-operator-mutation" - ], - "sourceroot": "..", - "solc_optimize": true -} diff --git a/benchmarks/config-jsons/test3.json b/benchmarks/config-jsons/test3.json deleted file mode 100644 index 400fbbd..0000000 --- a/benchmarks/config-jsons/test3.json +++ /dev/null @@ -1,18 +0,0 @@ -[ - { - "filename": "../10Power/TenPower.sol", - "sourceroot": "..", - "contract": "TenPower" - }, - { - "filename": "../MultipleContracts/C.sol", - "sourceroot": "..", - "contract": "C", - "functions": [ - "getarray" - ], - "mutations": [ - "function-call-mutation" - ] - } -] \ No newline at end of file diff --git a/benchmarks/config-jsons/test4.json b/benchmarks/config-jsons/test4.json deleted file mode 100644 index dfa19f6..0000000 --- a/benchmarks/config-jsons/test4.json +++ /dev/null @@ -1,17 +0,0 @@ -[ - { - "filename": "../10Power/TenPower.sol", - "sourceroot": "..", - "mutations": [ - "binary-op-mutation", - "swap-arguments-operator-mutation" - ] - }, - { - "filename": "../MultipleContracts/C.sol", - "sourceroot": "..", - "mutations": [ - "function-call-mutation" - ] - } -] \ No newline at end of file diff --git a/benchmarks/config-jsons/test5.json b/benchmarks/config-jsons/test5.json deleted file mode 100644 index bdb8f17..0000000 --- a/benchmarks/config-jsons/test5.json +++ /dev/null @@ -1,12 +0,0 @@ -[ - { - "filename": "../10Power/TenPower.sol", - "sourceroot": "..", - "contract": "TenPower" - }, - { - "filename": "../MultipleContracts/C.sol", - "sourceroot": "..", - "contract": "Utils" - } -] \ No newline at end of file diff --git a/benchmarks/config-jsons/test_fallback_mutations.json b/benchmarks/config-jsons/test_fallback_mutations.json new file mode 100644 index 0000000..8222b18 --- /dev/null +++ b/benchmarks/config-jsons/test_fallback_mutations.json @@ -0,0 +1,13 @@ +[ + { + "filename": "../FallbackMutations/Fallback.sol", + "import_paths": [ + "../FallbackMutations" + ], + "solc": "solc8.13", + "mutations": [], + "fallback_mutations": [ + "evr" + ] + } +] \ No newline at end of file diff --git a/benchmarks/config-jsons/test_import_map.json b/benchmarks/config-jsons/test_import_map.json new file mode 100644 index 0000000..0434d29 --- /dev/null +++ b/benchmarks/config-jsons/test_import_map.json @@ -0,0 +1,14 @@ +[ + { + "filename": "../ImportMaps/contracts/Contract.sol", + "import_paths": [ + "../ImportMaps" + ], + "import_maps": [ + "@lib=node_modules/lib" + ], + "mutations": [ + "aor" + ] + } +] \ No newline at end of file diff --git a/benchmarks/config-jsons/test_log_invalid.json b/benchmarks/config-jsons/test_log_invalid.json new file mode 100644 index 0000000..ef20113 --- /dev/null +++ b/benchmarks/config-jsons/test_log_invalid.json @@ -0,0 +1,72 @@ +[ + { + "filename": "../Ops/AOR/AOR.sol", + "import_paths": [ + "../Ops" + ], + "mutations": [ + "AOR" + ], + "log_invalid": true + }, + { + "filename": "../Ops/BOR/BOR.sol", + "import_paths": [ + "../Ops" + ], + "mutations": [ + "BOR" + ], + "log_invalid": true + }, + { + "filename": "../Ops/EDC/EDC.sol", + "import_paths": [ + "../Ops" + ], + "mutations": [ + "EDC" + ], + "log_invalid": true + }, + { + "filename": "../Ops/LOR/LOR.sol", + "import_paths": [ + "../Ops" + ], + "mutations": [ + "LOR" + ], + "log_invalid": true + }, + { + "filename": "../Ops/LVR/LVR.sol", + "import_paths": [ + "../Ops" + ], + "mutations": [ + "LVR" + ], + "log_invalid": true + }, + { + "filename": "../Ops/ROR/ROR.sol", + "import_paths": [ + "../Ops" + ], + "mutations": [ + "ROR" + ], + "log_invalid": true + }, + { + "filename": "../Ops/UOR/UOR.sol", + "import_paths": [ + "../Ops" + ], + "mutations": [ + "UOR" + ], + "log_invalid": true + } +] \ No newline at end of file diff --git a/benchmarks/config-jsons/multiple-contracts-1.json b/benchmarks/config-jsons/test_multiple_contracts_1.json similarity index 77% rename from benchmarks/config-jsons/multiple-contracts-1.json rename to benchmarks/config-jsons/test_multiple_contracts_1.json index e32dd65..e9c49de 100644 --- a/benchmarks/config-jsons/multiple-contracts-1.json +++ b/benchmarks/config-jsons/test_multiple_contracts_1.json @@ -1,7 +1,9 @@ [ { "filename": "../MultipleContracts/C.sol", - "sourceroot": "..", + "import_paths": [ + ".." + ], "contract": "Utils", "functions": [ "getarray" @@ -10,7 +12,9 @@ }, { "filename": "../MultipleContracts/C.sol", - "sourceroot": "..", + "import_paths": [ + ".." + ], "contract": "C", "functions": [ "getarray", diff --git a/benchmarks/config-jsons/multiple-contracts-2.json b/benchmarks/config-jsons/test_multiple_contracts_2.json similarity index 76% rename from benchmarks/config-jsons/multiple-contracts-2.json rename to benchmarks/config-jsons/test_multiple_contracts_2.json index 3cbca06..356bbba 100644 --- a/benchmarks/config-jsons/multiple-contracts-2.json +++ b/benchmarks/config-jsons/test_multiple_contracts_2.json @@ -1,7 +1,9 @@ [ { "filename": "../MultipleContracts/C.sol", - "sourceroot": "..", + "import_paths": [ + ".." + ], "contract": "Utils", "functions": [ "add" @@ -10,7 +12,9 @@ }, { "filename": "../MultipleContracts/C.sol", - "sourceroot": "..", + "import_paths": [ + ".." + ], "contract": "C", "functions": [ "get10PowerDecimals" diff --git a/benchmarks/config-jsons/multiple-contracts-3.json b/benchmarks/config-jsons/test_multiple_contracts_3.json similarity index 67% rename from benchmarks/config-jsons/multiple-contracts-3.json rename to benchmarks/config-jsons/test_multiple_contracts_3.json index bad7673..cea2729 100644 --- a/benchmarks/config-jsons/multiple-contracts-3.json +++ b/benchmarks/config-jsons/test_multiple_contracts_3.json @@ -1,13 +1,17 @@ [ { "filename": "../MultipleContracts/C.sol", - "sourceroot": "..", + "import_paths": [ + ".." + ], "contract": "Utils", "solc": "solc" }, { "filename": "../MultipleContracts/C.sol", - "sourceroot": "..", + "import_paths": [ + ".." + ], "contract": "C", "solc": "solc" } diff --git a/benchmarks/config-jsons/multiple-contracts-4.json b/benchmarks/config-jsons/test_multiple_contracts_4.json similarity index 68% rename from benchmarks/config-jsons/multiple-contracts-4.json rename to benchmarks/config-jsons/test_multiple_contracts_4.json index 7eb99f6..17c43e1 100644 --- a/benchmarks/config-jsons/multiple-contracts-4.json +++ b/benchmarks/config-jsons/test_multiple_contracts_4.json @@ -1,25 +1,31 @@ [ { "filename": "../MultipleContracts/C.sol", - "sourceroot": "..", + "import_paths": [ + ".." + ], "contract": "Utils", "functions": [ "add" ], "mutations": [ - "binary-op-mutation" + "aor", + "lor" ], "solc": "solc" }, { "filename": "../MultipleContracts/C.sol", - "sourceroot": "..", + "import_paths": [ + ".." + ], "contract": "C", "functions": [ "add" ], "mutations": [ - "binary-op-mutation" + "aor", + "lor" ], "solc": "solc" } diff --git a/benchmarks/config-jsons/test_multiple_files_1.json b/benchmarks/config-jsons/test_multiple_files_1.json new file mode 100644 index 0000000..00830ec --- /dev/null +++ b/benchmarks/config-jsons/test_multiple_files_1.json @@ -0,0 +1,19 @@ +[ + { + "filename": "../Ops/AOR/AOR.sol", + "import_paths": [ + ".." + ], + "contract": "AOR" + }, + { + "filename": "../MultipleContracts/C.sol", + "import_paths": [ + ".." + ], + "contract": "C", + "functions": [ + "getarray" + ] + } +] \ No newline at end of file diff --git a/benchmarks/config-jsons/test_no_export.json b/benchmarks/config-jsons/test_no_export.json new file mode 100644 index 0000000..8ae85a4 --- /dev/null +++ b/benchmarks/config-jsons/test_no_export.json @@ -0,0 +1,17 @@ +[ + { + "filename": "../Ops/AOR/AOR.sol", + "import_paths": [ + "../Ops" + ], + "no_export": true + }, + { + "filename": "../Ops/BOR/BOR.sol", + "import_paths": [ + "../Ops" + ], + "num_mutants": 1, + "no_export": true + } +] \ No newline at end of file diff --git a/benchmarks/config-jsons/test_num_mutants.json b/benchmarks/config-jsons/test_num_mutants.json new file mode 100644 index 0000000..969abd4 --- /dev/null +++ b/benchmarks/config-jsons/test_num_mutants.json @@ -0,0 +1,9 @@ +[ + { + "filename": "../Ops/AOR/AOR.sol", + "import_paths": [ + "../Ops" + ], + "num_mutants": 5 + } +] \ No newline at end of file diff --git a/benchmarks/config-jsons/test_seed.json b/benchmarks/config-jsons/test_seed.json new file mode 100644 index 0000000..717a4cf --- /dev/null +++ b/benchmarks/config-jsons/test_seed.json @@ -0,0 +1,18 @@ +[ + { + "filename": "../Ops/AOR/AOR.sol", + "import_paths": [ + "../Ops" + ], + "num_mutants": 5, + "seed": 1 + }, + { + "filename": "../Ops/AOR/AOR.sol", + "import_paths": [ + "../Ops" + ], + "num_mutants": 5, + "seed": 255 + } +] \ No newline at end of file diff --git a/benchmarks/config-jsons/uor.json b/benchmarks/config-jsons/uor.json new file mode 100644 index 0000000..5df4d65 --- /dev/null +++ b/benchmarks/config-jsons/uor.json @@ -0,0 +1,11 @@ +[ + { + "filename": "../Ops/UOR/UOR.sol", + "import_paths": [ + ".." + ], + "mutations": [ + "uor" + ] + } +] \ No newline at end of file diff --git a/resources/regressions/all.json/gambit_results.json b/resources/regressions/all.json/gambit_results.json deleted file mode 100644 index c67796e..0000000 --- a/resources/regressions/all.json/gambit_results.json +++ /dev/null @@ -1,471 +0,0 @@ -[ - { - "description": "BinaryOpMutation", - "diff": "--- original\n+++ mutant\n@@ -4,7 +4,8 @@\n \n contract BinaryOpMutation {\n function myAddition(uint256 x, uint256 y) public pure returns (uint256) {\n-\treturn x + y;\n+\t/// BinaryOpMutation(`+` |==> `-`) of: `return x + y;`\n+\treturn x-y;\n }\n \n function mySubtraction(uint256 x, uint256 y) public pure returns (uint256) {\n", - "id": "1", - "name": "mutants/1/BinaryOpMutation/BinaryOpMutation.sol", - "original": "BinaryOpMutation/BinaryOpMutation.sol", - }, - { - "description": "BinaryOpMutation", - "diff": "--- original\n+++ mutant\n@@ -4,7 +4,8 @@\n \n contract BinaryOpMutation {\n function myAddition(uint256 x, uint256 y) public pure returns (uint256) {\n-\treturn x + y;\n+\t/// BinaryOpMutation(`+` |==> `*`) of: `return x + y;`\n+\treturn x*y;\n }\n \n function mySubtraction(uint256 x, uint256 y) public pure returns (uint256) {\n", - "id": "2", - "name": "mutants/2/BinaryOpMutation/BinaryOpMutation.sol", - "original": "BinaryOpMutation/BinaryOpMutation.sol", - }, - { - "description": "BinaryOpMutation", - "diff": "--- original\n+++ mutant\n@@ -4,7 +4,8 @@\n \n contract BinaryOpMutation {\n function myAddition(uint256 x, uint256 y) public pure returns (uint256) {\n-\treturn x + y;\n+\t/// BinaryOpMutation(`+` |==> `/`) of: `return x + y;`\n+\treturn x/y;\n }\n \n function mySubtraction(uint256 x, uint256 y) public pure returns (uint256) {\n", - "id": "3", - "name": "mutants/3/BinaryOpMutation/BinaryOpMutation.sol", - "original": "BinaryOpMutation/BinaryOpMutation.sol", - }, - { - "description": "BinaryOpMutation", - "diff": "--- original\n+++ mutant\n@@ -4,7 +4,8 @@\n \n contract BinaryOpMutation {\n function myAddition(uint256 x, uint256 y) public pure returns (uint256) {\n-\treturn x + y;\n+\t/// BinaryOpMutation(`+` |==> `%`) of: `return x + y;`\n+\treturn x%y;\n }\n \n function mySubtraction(uint256 x, uint256 y) public pure returns (uint256) {\n", - "id": "4", - "name": "mutants/4/BinaryOpMutation/BinaryOpMutation.sol", - "original": "BinaryOpMutation/BinaryOpMutation.sol", - }, - { - "description": "BinaryOpMutation", - "diff": "--- original\n+++ mutant\n@@ -4,7 +4,8 @@\n \n contract BinaryOpMutation {\n function myAddition(uint256 x, uint256 y) public pure returns (uint256) {\n-\treturn x + y;\n+\t/// BinaryOpMutation(`+` |==> `**`) of: `return x + y;`\n+\treturn x**y;\n }\n \n function mySubtraction(uint256 x, uint256 y) public pure returns (uint256) {\n", - "id": "5", - "name": "mutants/5/BinaryOpMutation/BinaryOpMutation.sol", - "original": "BinaryOpMutation/BinaryOpMutation.sol", - }, - { - "description": "BinaryOpMutation", - "diff": "--- original\n+++ mutant\n@@ -8,7 +8,8 @@\n }\n \n function mySubtraction(uint256 x, uint256 y) public pure returns (uint256) {\n-\treturn x - y;\n+\t/// BinaryOpMutation(`-` |==> `+`) of: `return x - y;`\n+\treturn x+y;\n }\n \n function myMultiplication(uint256 x, uint256 y) public pure returns (uint256) {\n", - "id": "6", - "name": "mutants/6/BinaryOpMutation/BinaryOpMutation.sol", - "original": "BinaryOpMutation/BinaryOpMutation.sol", - }, - { - "description": "BinaryOpMutation", - "diff": "--- original\n+++ mutant\n@@ -8,7 +8,8 @@\n }\n \n function mySubtraction(uint256 x, uint256 y) public pure returns (uint256) {\n-\treturn x - y;\n+\t/// BinaryOpMutation(`-` |==> `*`) of: `return x - y;`\n+\treturn x*y;\n }\n \n function myMultiplication(uint256 x, uint256 y) public pure returns (uint256) {\n", - "id": "7", - "name": "mutants/7/BinaryOpMutation/BinaryOpMutation.sol", - "original": "BinaryOpMutation/BinaryOpMutation.sol", - }, - { - "description": "BinaryOpMutation", - "diff": "--- original\n+++ mutant\n@@ -8,7 +8,8 @@\n }\n \n function mySubtraction(uint256 x, uint256 y) public pure returns (uint256) {\n-\treturn x - y;\n+\t/// BinaryOpMutation(`-` |==> `/`) of: `return x - y;`\n+\treturn x/y;\n }\n \n function myMultiplication(uint256 x, uint256 y) public pure returns (uint256) {\n", - "id": "8", - "name": "mutants/8/BinaryOpMutation/BinaryOpMutation.sol", - "original": "BinaryOpMutation/BinaryOpMutation.sol", - }, - { - "description": "BinaryOpMutation", - "diff": "--- original\n+++ mutant\n@@ -8,7 +8,8 @@\n }\n \n function mySubtraction(uint256 x, uint256 y) public pure returns (uint256) {\n-\treturn x - y;\n+\t/// BinaryOpMutation(`-` |==> `%`) of: `return x - y;`\n+\treturn x%y;\n }\n \n function myMultiplication(uint256 x, uint256 y) public pure returns (uint256) {\n", - "id": "9", - "name": "mutants/9/BinaryOpMutation/BinaryOpMutation.sol", - "original": "BinaryOpMutation/BinaryOpMutation.sol", - }, - { - "description": "BinaryOpMutation", - "diff": "--- original\n+++ mutant\n@@ -8,7 +8,8 @@\n }\n \n function mySubtraction(uint256 x, uint256 y) public pure returns (uint256) {\n-\treturn x - y;\n+\t/// BinaryOpMutation(`-` |==> `**`) of: `return x - y;`\n+\treturn x**y;\n }\n \n function myMultiplication(uint256 x, uint256 y) public pure returns (uint256) {\n", - "id": "10", - "name": "mutants/10/BinaryOpMutation/BinaryOpMutation.sol", - "original": "BinaryOpMutation/BinaryOpMutation.sol", - }, - { - "description": "BinaryOpMutation", - "diff": "--- original\n+++ mutant\n@@ -12,7 +12,8 @@\n }\n \n function myMultiplication(uint256 x, uint256 y) public pure returns (uint256) {\n-\treturn x * y;\n+\t/// BinaryOpMutation(`*` |==> `+`) of: `return x * y;`\n+\treturn x+y;\n }\n \n function myDivision(uint256 x, uint256 y) public pure returns (uint256) {\n", - "id": "11", - "name": "mutants/11/BinaryOpMutation/BinaryOpMutation.sol", - "original": "BinaryOpMutation/BinaryOpMutation.sol", - }, - { - "description": "BinaryOpMutation", - "diff": "--- original\n+++ mutant\n@@ -12,7 +12,8 @@\n }\n \n function myMultiplication(uint256 x, uint256 y) public pure returns (uint256) {\n-\treturn x * y;\n+\t/// BinaryOpMutation(`*` |==> `-`) of: `return x * y;`\n+\treturn x-y;\n }\n \n function myDivision(uint256 x, uint256 y) public pure returns (uint256) {\n", - "id": "12", - "name": "mutants/12/BinaryOpMutation/BinaryOpMutation.sol", - "original": "BinaryOpMutation/BinaryOpMutation.sol", - }, - { - "description": "BinaryOpMutation", - "diff": "--- original\n+++ mutant\n@@ -12,7 +12,8 @@\n }\n \n function myMultiplication(uint256 x, uint256 y) public pure returns (uint256) {\n-\treturn x * y;\n+\t/// BinaryOpMutation(`*` |==> `/`) of: `return x * y;`\n+\treturn x/y;\n }\n \n function myDivision(uint256 x, uint256 y) public pure returns (uint256) {\n", - "id": "13", - "name": "mutants/13/BinaryOpMutation/BinaryOpMutation.sol", - "original": "BinaryOpMutation/BinaryOpMutation.sol", - }, - { - "description": "BinaryOpMutation", - "diff": "--- original\n+++ mutant\n@@ -12,7 +12,8 @@\n }\n \n function myMultiplication(uint256 x, uint256 y) public pure returns (uint256) {\n-\treturn x * y;\n+\t/// BinaryOpMutation(`*` |==> `%`) of: `return x * y;`\n+\treturn x%y;\n }\n \n function myDivision(uint256 x, uint256 y) public pure returns (uint256) {\n", - "id": "14", - "name": "mutants/14/BinaryOpMutation/BinaryOpMutation.sol", - "original": "BinaryOpMutation/BinaryOpMutation.sol", - }, - { - "description": "BinaryOpMutation", - "diff": "--- original\n+++ mutant\n@@ -12,7 +12,8 @@\n }\n \n function myMultiplication(uint256 x, uint256 y) public pure returns (uint256) {\n-\treturn x * y;\n+\t/// BinaryOpMutation(`*` |==> `**`) of: `return x * y;`\n+\treturn x**y;\n }\n \n function myDivision(uint256 x, uint256 y) public pure returns (uint256) {\n", - "id": "15", - "name": "mutants/15/BinaryOpMutation/BinaryOpMutation.sol", - "original": "BinaryOpMutation/BinaryOpMutation.sol", - }, - { - "description": "BinaryOpMutation", - "diff": "--- original\n+++ mutant\n@@ -16,7 +16,8 @@\n }\n \n function myDivision(uint256 x, uint256 y) public pure returns (uint256) {\n-\treturn x / y;\n+\t/// BinaryOpMutation(`/` |==> `+`) of: `return x / y;`\n+\treturn x+y;\n }\n \n function myModulo(uint256 x, uint256 y) public pure returns (uint256) {\n", - "id": "16", - "name": "mutants/16/BinaryOpMutation/BinaryOpMutation.sol", - "original": "BinaryOpMutation/BinaryOpMutation.sol", - }, - { - "description": "BinaryOpMutation", - "diff": "--- original\n+++ mutant\n@@ -16,7 +16,8 @@\n }\n \n function myDivision(uint256 x, uint256 y) public pure returns (uint256) {\n-\treturn x / y;\n+\t/// BinaryOpMutation(`/` |==> `-`) of: `return x / y;`\n+\treturn x-y;\n }\n \n function myModulo(uint256 x, uint256 y) public pure returns (uint256) {\n", - "id": "17", - "name": "mutants/17/BinaryOpMutation/BinaryOpMutation.sol", - "original": "BinaryOpMutation/BinaryOpMutation.sol", - }, - { - "description": "BinaryOpMutation", - "diff": "--- original\n+++ mutant\n@@ -16,7 +16,8 @@\n }\n \n function myDivision(uint256 x, uint256 y) public pure returns (uint256) {\n-\treturn x / y;\n+\t/// BinaryOpMutation(`/` |==> `*`) of: `return x / y;`\n+\treturn x*y;\n }\n \n function myModulo(uint256 x, uint256 y) public pure returns (uint256) {\n", - "id": "18", - "name": "mutants/18/BinaryOpMutation/BinaryOpMutation.sol", - "original": "BinaryOpMutation/BinaryOpMutation.sol", - }, - { - "description": "BinaryOpMutation", - "diff": "--- original\n+++ mutant\n@@ -16,7 +16,8 @@\n }\n \n function myDivision(uint256 x, uint256 y) public pure returns (uint256) {\n-\treturn x / y;\n+\t/// BinaryOpMutation(`/` |==> `%`) of: `return x / y;`\n+\treturn x%y;\n }\n \n function myModulo(uint256 x, uint256 y) public pure returns (uint256) {\n", - "id": "19", - "name": "mutants/19/BinaryOpMutation/BinaryOpMutation.sol", - "original": "BinaryOpMutation/BinaryOpMutation.sol", - }, - { - "description": "BinaryOpMutation", - "diff": "--- original\n+++ mutant\n@@ -16,7 +16,8 @@\n }\n \n function myDivision(uint256 x, uint256 y) public pure returns (uint256) {\n-\treturn x / y;\n+\t/// BinaryOpMutation(`/` |==> `**`) of: `return x / y;`\n+\treturn x**y;\n }\n \n function myModulo(uint256 x, uint256 y) public pure returns (uint256) {\n", - "id": "20", - "name": "mutants/20/BinaryOpMutation/BinaryOpMutation.sol", - "original": "BinaryOpMutation/BinaryOpMutation.sol", - }, - { - "description": "BinaryOpMutation", - "diff": "--- original\n+++ mutant\n@@ -20,7 +20,8 @@\n }\n \n function myModulo(uint256 x, uint256 y) public pure returns (uint256) {\n-\treturn x % y;\n+\t/// BinaryOpMutation(`%` |==> `+`) of: `return x % y;`\n+\treturn x+y;\n }\n \n function myExponentiation(uint256 x, uint256 y) public pure returns (uint256) {\n", - "id": "21", - "name": "mutants/21/BinaryOpMutation/BinaryOpMutation.sol", - "original": "BinaryOpMutation/BinaryOpMutation.sol", - }, - { - "description": "BinaryOpMutation", - "diff": "--- original\n+++ mutant\n@@ -20,7 +20,8 @@\n }\n \n function myModulo(uint256 x, uint256 y) public pure returns (uint256) {\n-\treturn x % y;\n+\t/// BinaryOpMutation(`%` |==> `-`) of: `return x % y;`\n+\treturn x-y;\n }\n \n function myExponentiation(uint256 x, uint256 y) public pure returns (uint256) {\n", - "id": "22", - "name": "mutants/22/BinaryOpMutation/BinaryOpMutation.sol", - "original": "BinaryOpMutation/BinaryOpMutation.sol", - }, - { - "description": "BinaryOpMutation", - "diff": "--- original\n+++ mutant\n@@ -20,7 +20,8 @@\n }\n \n function myModulo(uint256 x, uint256 y) public pure returns (uint256) {\n-\treturn x % y;\n+\t/// BinaryOpMutation(`%` |==> `*`) of: `return x % y;`\n+\treturn x*y;\n }\n \n function myExponentiation(uint256 x, uint256 y) public pure returns (uint256) {\n", - "id": "23", - "name": "mutants/23/BinaryOpMutation/BinaryOpMutation.sol", - "original": "BinaryOpMutation/BinaryOpMutation.sol", - }, - { - "description": "BinaryOpMutation", - "diff": "--- original\n+++ mutant\n@@ -20,7 +20,8 @@\n }\n \n function myModulo(uint256 x, uint256 y) public pure returns (uint256) {\n-\treturn x % y;\n+\t/// BinaryOpMutation(`%` |==> `/`) of: `return x % y;`\n+\treturn x/y;\n }\n \n function myExponentiation(uint256 x, uint256 y) public pure returns (uint256) {\n", - "id": "24", - "name": "mutants/24/BinaryOpMutation/BinaryOpMutation.sol", - "original": "BinaryOpMutation/BinaryOpMutation.sol", - }, - { - "description": "BinaryOpMutation", - "diff": "--- original\n+++ mutant\n@@ -20,7 +20,8 @@\n }\n \n function myModulo(uint256 x, uint256 y) public pure returns (uint256) {\n-\treturn x % y;\n+\t/// BinaryOpMutation(`%` |==> `**`) of: `return x % y;`\n+\treturn x**y;\n }\n \n function myExponentiation(uint256 x, uint256 y) public pure returns (uint256) {\n", - "id": "25", - "name": "mutants/25/BinaryOpMutation/BinaryOpMutation.sol", - "original": "BinaryOpMutation/BinaryOpMutation.sol", - }, - { - "description": "BinaryOpMutation", - "diff": "--- original\n+++ mutant\n@@ -24,7 +24,8 @@\n }\n \n function myExponentiation(uint256 x, uint256 y) public pure returns (uint256) {\n-\treturn x ** y;\n+\t/// BinaryOpMutation(`**` |==> `+`) of: `return x ** y;`\n+\treturn x+y;\n }\n \n }\n", - "id": "26", - "name": "mutants/26/BinaryOpMutation/BinaryOpMutation.sol", - "original": "BinaryOpMutation/BinaryOpMutation.sol", - }, - { - "description": "BinaryOpMutation", - "diff": "--- original\n+++ mutant\n@@ -24,7 +24,8 @@\n }\n \n function myExponentiation(uint256 x, uint256 y) public pure returns (uint256) {\n-\treturn x ** y;\n+\t/// BinaryOpMutation(`**` |==> `-`) of: `return x ** y;`\n+\treturn x-y;\n }\n \n }\n", - "id": "27", - "name": "mutants/27/BinaryOpMutation/BinaryOpMutation.sol", - "original": "BinaryOpMutation/BinaryOpMutation.sol", - }, - { - "description": "BinaryOpMutation", - "diff": "--- original\n+++ mutant\n@@ -24,7 +24,8 @@\n }\n \n function myExponentiation(uint256 x, uint256 y) public pure returns (uint256) {\n-\treturn x ** y;\n+\t/// BinaryOpMutation(`**` |==> `*`) of: `return x ** y;`\n+\treturn x*y;\n }\n \n }\n", - "id": "28", - "name": "mutants/28/BinaryOpMutation/BinaryOpMutation.sol", - "original": "BinaryOpMutation/BinaryOpMutation.sol", - }, - { - "description": "BinaryOpMutation", - "diff": "--- original\n+++ mutant\n@@ -24,7 +24,8 @@\n }\n \n function myExponentiation(uint256 x, uint256 y) public pure returns (uint256) {\n-\treturn x ** y;\n+\t/// BinaryOpMutation(`**` |==> `/`) of: `return x ** y;`\n+\treturn x/y;\n }\n \n }\n", - "id": "29", - "name": "mutants/29/BinaryOpMutation/BinaryOpMutation.sol", - "original": "BinaryOpMutation/BinaryOpMutation.sol", - }, - { - "description": "BinaryOpMutation", - "diff": "--- original\n+++ mutant\n@@ -24,7 +24,8 @@\n }\n \n function myExponentiation(uint256 x, uint256 y) public pure returns (uint256) {\n-\treturn x ** y;\n+\t/// BinaryOpMutation(`**` |==> `%`) of: `return x ** y;`\n+\treturn x%y;\n }\n \n }\n", - "id": "30", - "name": "mutants/30/BinaryOpMutation/BinaryOpMutation.sol", - "original": "BinaryOpMutation/BinaryOpMutation.sol", - }, - { - "description": "RequireMutation", - "diff": "--- original\n+++ mutant\n@@ -4,7 +4,8 @@\n \n contract RequireMutation {\n function myRequires(bool cond1, bool cond2, bool cond3) public pure returns (bool) {\n-\trequire(cond1);\n+\t/// RequireMutation(`cond1` |==> `true`) of: `require(cond1);`\n+\trequire(true);\n \trequire(cond2);\n \trequire(cond3);\n \treturn true;\n", - "id": "31", - "name": "mutants/31/RequireMutation/RequireMutation.sol", - "original": "RequireMutation/RequireMutation.sol", - }, - { - "description": "RequireMutation", - "diff": "--- original\n+++ mutant\n@@ -4,7 +4,8 @@\n \n contract RequireMutation {\n function myRequires(bool cond1, bool cond2, bool cond3) public pure returns (bool) {\n-\trequire(cond1);\n+\t/// RequireMutation(`cond1` |==> `false`) of: `require(cond1);`\n+\trequire(false);\n \trequire(cond2);\n \trequire(cond3);\n \treturn true;\n", - "id": "32", - "name": "mutants/32/RequireMutation/RequireMutation.sol", - "original": "RequireMutation/RequireMutation.sol", - }, - { - "description": "RequireMutation", - "diff": "--- original\n+++ mutant\n@@ -5,7 +5,8 @@\n contract RequireMutation {\n function myRequires(bool cond1, bool cond2, bool cond3) public pure returns (bool) {\n \trequire(cond1);\n-\trequire(cond2);\n+\t/// RequireMutation(`cond2` |==> `true`) of: `require(cond2);`\n+\trequire(true);\n \trequire(cond3);\n \treturn true;\n }\n", - "id": "33", - "name": "mutants/33/RequireMutation/RequireMutation.sol", - "original": "RequireMutation/RequireMutation.sol", - }, - { - "description": "RequireMutation", - "diff": "--- original\n+++ mutant\n@@ -5,7 +5,8 @@\n contract RequireMutation {\n function myRequires(bool cond1, bool cond2, bool cond3) public pure returns (bool) {\n \trequire(cond1);\n-\trequire(cond2);\n+\t/// RequireMutation(`cond2` |==> `false`) of: `require(cond2);`\n+\trequire(false);\n \trequire(cond3);\n \treturn true;\n }\n", - "id": "34", - "name": "mutants/34/RequireMutation/RequireMutation.sol", - "original": "RequireMutation/RequireMutation.sol", - }, - { - "description": "RequireMutation", - "diff": "--- original\n+++ mutant\n@@ -6,7 +6,8 @@\n function myRequires(bool cond1, bool cond2, bool cond3) public pure returns (bool) {\n \trequire(cond1);\n \trequire(cond2);\n-\trequire(cond3);\n+\t/// RequireMutation(`cond3` |==> `true`) of: `require(cond3);`\n+\trequire(true);\n \treturn true;\n }\n }\n", - "id": "35", - "name": "mutants/35/RequireMutation/RequireMutation.sol", - "original": "RequireMutation/RequireMutation.sol", - }, - { - "description": "RequireMutation", - "diff": "--- original\n+++ mutant\n@@ -6,7 +6,8 @@\n function myRequires(bool cond1, bool cond2, bool cond3) public pure returns (bool) {\n \trequire(cond1);\n \trequire(cond2);\n-\trequire(cond3);\n+\t/// RequireMutation(`cond3` |==> `false`) of: `require(cond3);`\n+\trequire(false);\n \treturn true;\n }\n }\n", - "id": "36", - "name": "mutants/36/RequireMutation/RequireMutation.sol", - "original": "RequireMutation/RequireMutation.sol", - }, - { - "description": "AssignmentMutation", - "diff": "--- original\n+++ mutant\n@@ -10,7 +10,8 @@\n bool public b;\n \n constructor() {\n-\tx = 42; // original: 42\n+\t/// AssignmentMutation(`42` |==> `0`) of: `x = 42; // original: 42`\n+\tx = 0; // original: 42\n \ty = 13; // original: 13\n \tz = 3110; // original: 3110\n \ta = true; // original: true\n", - "id": "37", - "name": "mutants/37/AssignmentMutation/AssignmentMutation.sol", - "original": "AssignmentMutation/AssignmentMutation.sol", - }, - { - "description": "AssignmentMutation", - "diff": "--- original\n+++ mutant\n@@ -10,7 +10,8 @@\n bool public b;\n \n constructor() {\n-\tx = 42; // original: 42\n+\t/// AssignmentMutation(`42` |==> `1`) of: `x = 42; // original: 42`\n+\tx = 1; // original: 42\n \ty = 13; // original: 13\n \tz = 3110; // original: 3110\n \ta = true; // original: true\n", - "id": "38", - "name": "mutants/38/AssignmentMutation/AssignmentMutation.sol", - "original": "AssignmentMutation/AssignmentMutation.sol", - }, - { - "description": "AssignmentMutation", - "diff": "--- original\n+++ mutant\n@@ -11,7 +11,8 @@\n \n constructor() {\n \tx = 42; // original: 42\n-\ty = 13; // original: 13\n+\t/// AssignmentMutation(`13` |==> `0`) of: `y = 13; // original: 13`\n+\ty = 0; // original: 13\n \tz = 3110; // original: 3110\n \ta = true; // original: true\n \tb = false; // original: false\n", - "id": "39", - "name": "mutants/39/AssignmentMutation/AssignmentMutation.sol", - "original": "AssignmentMutation/AssignmentMutation.sol", - }, - { - "description": "AssignmentMutation", - "diff": "--- original\n+++ mutant\n@@ -11,7 +11,8 @@\n \n constructor() {\n \tx = 42; // original: 42\n-\ty = 13; // original: 13\n+\t/// AssignmentMutation(`13` |==> `1`) of: `y = 13; // original: 13`\n+\ty = 1; // original: 13\n \tz = 3110; // original: 3110\n \ta = true; // original: true\n \tb = false; // original: false\n", - "id": "40", - "name": "mutants/40/AssignmentMutation/AssignmentMutation.sol", - "original": "AssignmentMutation/AssignmentMutation.sol", - }, - { - "description": "AssignmentMutation", - "diff": "--- original\n+++ mutant\n@@ -12,7 +12,8 @@\n constructor() {\n \tx = 42; // original: 42\n \ty = 13; // original: 13\n-\tz = 3110; // original: 3110\n+\t/// AssignmentMutation(`3110` |==> `0`) of: `z = 3110; // original: 3110`\n+\tz = 0; // original: 3110\n \ta = true; // original: true\n \tb = false; // original: false\n }\n", - "id": "41", - "name": "mutants/41/AssignmentMutation/AssignmentMutation.sol", - "original": "AssignmentMutation/AssignmentMutation.sol", - }, - { - "description": "AssignmentMutation", - "diff": "--- original\n+++ mutant\n@@ -12,7 +12,8 @@\n constructor() {\n \tx = 42; // original: 42\n \ty = 13; // original: 13\n-\tz = 3110; // original: 3110\n+\t/// AssignmentMutation(`3110` |==> `1`) of: `z = 3110; // original: 3110`\n+\tz = 1; // original: 3110\n \ta = true; // original: true\n \tb = false; // original: false\n }\n", - "id": "42", - "name": "mutants/42/AssignmentMutation/AssignmentMutation.sol", - "original": "AssignmentMutation/AssignmentMutation.sol", - }, - { - "description": "AssignmentMutation", - "diff": "--- original\n+++ mutant\n@@ -13,7 +13,8 @@\n \tx = 42; // original: 42\n \ty = 13; // original: 13\n \tz = 3110; // original: 3110\n-\ta = true; // original: true\n+\t/// AssignmentMutation(`true` |==> `false`) of: `a = true; // original: true`\n+\ta = false; // original: true\n \tb = false; // original: false\n }\n }\n", - "id": "43", - "name": "mutants/43/AssignmentMutation/AssignmentMutation.sol", - "original": "AssignmentMutation/AssignmentMutation.sol", - }, - { - "description": "AssignmentMutation", - "diff": "--- original\n+++ mutant\n@@ -14,6 +14,7 @@\n \ty = 13; // original: 13\n \tz = 3110; // original: 3110\n \ta = true; // original: true\n-\tb = false; // original: false\n+\t/// AssignmentMutation(`false` |==> `true`) of: `b = false; // original: false`\n+\tb = true; // original: false\n }\n }\n", - "id": "44", - "name": "mutants/44/AssignmentMutation/AssignmentMutation.sol", - "original": "AssignmentMutation/AssignmentMutation.sol", - }, - { - "description": "DeleteExpressionMutation", - "diff": "--- original\n+++ mutant\n@@ -7,7 +7,8 @@\n function myIdentity(uint256 x) public pure returns (uint256) {\n \tuint256 result = 0;\n \tfor (uint256 i = 0; i < x; i++) {\n-\t result ++;\n+\t /// DeleteExpressionMutation(`result ++` |==> `assert(true)`) of: `result ++;`\n+\t assert(true);\n \t}\n \treturn result;\n }\n", - "id": "45", - "name": "mutants/45/DeleteExpressionMutation/DeleteExpressionMutation.sol", - "original": "DeleteExpressionMutation/DeleteExpressionMutation.sol", - }, - { - "description": "DeleteExpressionMutation", - "diff": "--- original\n+++ mutant\n@@ -6,7 +6,8 @@\n \n function myIdentity(uint256 x) public pure returns (uint256) {\n \tuint256 result = 0;\n-\tfor (uint256 i = 0; i < x; i++) {\n+\t/// DeleteExpressionMutation(`i++` |==> `assert(true)`) of: `for (uint256 i = 0; i < x; i++) {`\n+\tfor (uint256 i = 0; i < x; assert(true)) {\n \t result ++;\n \t}\n \treturn result;\n", - "id": "46", - "name": "mutants/46/DeleteExpressionMutation/DeleteExpressionMutation.sol", - "original": "DeleteExpressionMutation/DeleteExpressionMutation.sol", - }, - { - "description": "IfStatementMutation", - "diff": "--- original\n+++ mutant\n@@ -4,7 +4,8 @@\n \n contract IfStatementMutation {\n function myBooleanNegation(bool a) public pure returns (bool) {\n-\tif (a) {\n+\t/// IfStatementMutation(`a` |==> `true`) of: `if (a) {`\n+\tif (true) {\n \t return true;\n \t}\n \telse {\n", - "id": "47", - "name": "mutants/47/IfStatementMutation/IfStatementMutation.sol", - "original": "IfStatementMutation/IfStatementMutation.sol", - }, - { - "description": "IfStatementMutation", - "diff": "--- original\n+++ mutant\n@@ -4,7 +4,8 @@\n \n contract IfStatementMutation {\n function myBooleanNegation(bool a) public pure returns (bool) {\n-\tif (a) {\n+\t/// IfStatementMutation(`a` |==> `false`) of: `if (a) {`\n+\tif (false) {\n \t return true;\n \t}\n \telse {\n", - "id": "48", - "name": "mutants/48/IfStatementMutation/IfStatementMutation.sol", - "original": "IfStatementMutation/IfStatementMutation.sol", - }, - { - "description": "SwapArgumentsOperatorMutation", - "diff": "--- original\n+++ mutant\n@@ -4,7 +4,8 @@\n \n contract SwapArgumentsOperatorMutation {\n function mySubtraction(uint256 x, uint256 y) public pure returns (uint256) {\n-\treturn x - y;\n+\t/// SwapArgumentsOperatorMutation(`x - y` |==> `y - x`) of: `return x - y;`\n+\treturn y - x;\n }\n \n function myDivision(uint256 x, uint256 y) public pure returns (uint256) {\n", - "id": "49", - "name": "mutants/49/SwapArgumentsOperatorMutation/SwapArgumentsOperatorMutation.sol", - "original": "SwapArgumentsOperatorMutation/SwapArgumentsOperatorMutation.sol", - }, - { - "description": "SwapArgumentsOperatorMutation", - "diff": "--- original\n+++ mutant\n@@ -8,7 +8,8 @@\n }\n \n function myDivision(uint256 x, uint256 y) public pure returns (uint256) {\n-\treturn x / y;\n+\t/// SwapArgumentsOperatorMutation(`x / y` |==> `y / x`) of: `return x / y;`\n+\treturn y / x;\n }\n \n function myModulo(uint256 x, uint256 y) public pure returns (uint256) {\n", - "id": "50", - "name": "mutants/50/SwapArgumentsOperatorMutation/SwapArgumentsOperatorMutation.sol", - "original": "SwapArgumentsOperatorMutation/SwapArgumentsOperatorMutation.sol", - }, - { - "description": "SwapArgumentsOperatorMutation", - "diff": "--- original\n+++ mutant\n@@ -12,7 +12,8 @@\n }\n \n function myModulo(uint256 x, uint256 y) public pure returns (uint256) {\n-\treturn x % y;\n+\t/// SwapArgumentsOperatorMutation(`x % y` |==> `y % x`) of: `return x % y;`\n+\treturn y % x;\n }\n \n function myExponentiation(uint256 x, uint256 y) public pure returns (uint256) {\n", - "id": "51", - "name": "mutants/51/SwapArgumentsOperatorMutation/SwapArgumentsOperatorMutation.sol", - "original": "SwapArgumentsOperatorMutation/SwapArgumentsOperatorMutation.sol", - }, - { - "description": "SwapArgumentsOperatorMutation", - "diff": "--- original\n+++ mutant\n@@ -16,7 +16,8 @@\n }\n \n function myExponentiation(uint256 x, uint256 y) public pure returns (uint256) {\n-\treturn x ** y;\n+\t/// SwapArgumentsOperatorMutation(`x ** y` |==> `y ** x`) of: `return x ** y;`\n+\treturn y ** x;\n }\n \n function myGT(uint256 x, uint256 y) public pure returns (bool) {\n", - "id": "52", - "name": "mutants/52/SwapArgumentsOperatorMutation/SwapArgumentsOperatorMutation.sol", - "original": "SwapArgumentsOperatorMutation/SwapArgumentsOperatorMutation.sol", - }, - { - "description": "SwapArgumentsOperatorMutation", - "diff": "--- original\n+++ mutant\n@@ -20,7 +20,8 @@\n }\n \n function myGT(uint256 x, uint256 y) public pure returns (bool) {\n-\treturn x > y;\n+\t/// SwapArgumentsOperatorMutation(`x > y` |==> `y > x`) of: `return x > y;`\n+\treturn y > x;\n }\n \n function myLT(uint256 x, uint256 y) public pure returns (bool) {\n", - "id": "53", - "name": "mutants/53/SwapArgumentsOperatorMutation/SwapArgumentsOperatorMutation.sol", - "original": "SwapArgumentsOperatorMutation/SwapArgumentsOperatorMutation.sol", - }, - { - "description": "SwapArgumentsOperatorMutation", - "diff": "--- original\n+++ mutant\n@@ -24,7 +24,8 @@\n }\n \n function myLT(uint256 x, uint256 y) public pure returns (bool) {\n-\treturn x < y;\n+\t/// SwapArgumentsOperatorMutation(`x < y` |==> `y < x`) of: `return x < y;`\n+\treturn y < x;\n }\n \n function myGE(uint256 x, uint256 y) public pure returns (bool) {\n", - "id": "54", - "name": "mutants/54/SwapArgumentsOperatorMutation/SwapArgumentsOperatorMutation.sol", - "original": "SwapArgumentsOperatorMutation/SwapArgumentsOperatorMutation.sol", - }, - { - "description": "SwapArgumentsOperatorMutation", - "diff": "--- original\n+++ mutant\n@@ -28,7 +28,8 @@\n }\n \n function myGE(uint256 x, uint256 y) public pure returns (bool) {\n-\treturn x >= y;\n+\t/// SwapArgumentsOperatorMutation(`x >= y` |==> `y >= x`) of: `return x >= y;`\n+\treturn y >= x;\n }\n \n function myLE(uint256 x, uint256 y) public pure returns (bool) {\n", - "id": "55", - "name": "mutants/55/SwapArgumentsOperatorMutation/SwapArgumentsOperatorMutation.sol", - "original": "SwapArgumentsOperatorMutation/SwapArgumentsOperatorMutation.sol", - }, - { - "description": "SwapArgumentsOperatorMutation", - "diff": "--- original\n+++ mutant\n@@ -32,7 +32,8 @@\n }\n \n function myLE(uint256 x, uint256 y) public pure returns (bool) {\n-\treturn x <= y;\n+\t/// SwapArgumentsOperatorMutation(`x <= y` |==> `y <= x`) of: `return x <= y;`\n+\treturn y <= x;\n }\n \n function mySAL(uint256 x, uint256 y) public pure returns (uint256) {\n", - "id": "56", - "name": "mutants/56/SwapArgumentsOperatorMutation/SwapArgumentsOperatorMutation.sol", - "original": "SwapArgumentsOperatorMutation/SwapArgumentsOperatorMutation.sol", - }, - { - "description": "SwapArgumentsOperatorMutation", - "diff": "--- original\n+++ mutant\n@@ -36,7 +36,8 @@\n }\n \n function mySAL(uint256 x, uint256 y) public pure returns (uint256) {\n-\treturn x << y;\n+\t/// SwapArgumentsOperatorMutation(`x << y` |==> `y << x`) of: `return x << y;`\n+\treturn y << x;\n }\n \n function mySAR(uint256 x, uint256 y) public pure returns (uint256) {\n", - "id": "57", - "name": "mutants/57/SwapArgumentsOperatorMutation/SwapArgumentsOperatorMutation.sol", - "original": "SwapArgumentsOperatorMutation/SwapArgumentsOperatorMutation.sol", - }, - { - "description": "SwapArgumentsOperatorMutation", - "diff": "--- original\n+++ mutant\n@@ -40,6 +40,7 @@\n }\n \n function mySAR(uint256 x, uint256 y) public pure returns (uint256) {\n-\treturn x >> y;\n+\t/// SwapArgumentsOperatorMutation(`x >> y` |==> `y >> x`) of: `return x >> y;`\n+\treturn y >> x;\n }\n }\n", - "id": "58", - "name": "mutants/58/SwapArgumentsOperatorMutation/SwapArgumentsOperatorMutation.sol", - "original": "SwapArgumentsOperatorMutation/SwapArgumentsOperatorMutation.sol", - }, - { - "description": "UnaryOperatorMutation", - "diff": "--- original\n+++ mutant\n@@ -4,7 +4,8 @@\n \n contract UnaryOperatorMutation {\n function myBitwiseNeg(uint256 x) public pure returns (uint256) {\n-\treturn ~ x;\n+\t/// UnaryOperatorMutation(`~` |==> `++`) of: `return ~ x;`\n+\treturn ++ x;\n }\n \n function myPrefixIncr(uint256 x) public pure returns (uint256) {\n", - "id": "59", - "name": "mutants/59/UnaryOperatorMutation/UnaryOperatorMutation.sol", - "original": "UnaryOperatorMutation/UnaryOperatorMutation.sol", - }, - { - "description": "UnaryOperatorMutation", - "diff": "--- original\n+++ mutant\n@@ -4,7 +4,8 @@\n \n contract UnaryOperatorMutation {\n function myBitwiseNeg(uint256 x) public pure returns (uint256) {\n-\treturn ~ x;\n+\t/// UnaryOperatorMutation(`~` |==> `--`) of: `return ~ x;`\n+\treturn -- x;\n }\n \n function myPrefixIncr(uint256 x) public pure returns (uint256) {\n", - "id": "60", - "name": "mutants/60/UnaryOperatorMutation/UnaryOperatorMutation.sol", - "original": "UnaryOperatorMutation/UnaryOperatorMutation.sol", - }, - { - "description": "UnaryOperatorMutation", - "diff": "--- original\n+++ mutant\n@@ -8,7 +8,8 @@\n }\n \n function myPrefixIncr(uint256 x) public pure returns (uint256) {\n-\treturn ++x;\n+\t/// UnaryOperatorMutation(`++` |==> `--`) of: `return ++x;`\n+\treturn --x;\n }\n \n function myPrefixDecr(uint256 x) public pure returns (uint256) {\n", - "id": "61", - "name": "mutants/61/UnaryOperatorMutation/UnaryOperatorMutation.sol", - "original": "UnaryOperatorMutation/UnaryOperatorMutation.sol", - }, - { - "description": "UnaryOperatorMutation", - "diff": "--- original\n+++ mutant\n@@ -8,7 +8,8 @@\n }\n \n function myPrefixIncr(uint256 x) public pure returns (uint256) {\n-\treturn ++x;\n+\t/// UnaryOperatorMutation(`++` |==> `~`) of: `return ++x;`\n+\treturn ~x;\n }\n \n function myPrefixDecr(uint256 x) public pure returns (uint256) {\n", - "id": "62", - "name": "mutants/62/UnaryOperatorMutation/UnaryOperatorMutation.sol", - "original": "UnaryOperatorMutation/UnaryOperatorMutation.sol", - }, - { - "description": "UnaryOperatorMutation", - "diff": "--- original\n+++ mutant\n@@ -12,7 +12,8 @@\n }\n \n function myPrefixDecr(uint256 x) public pure returns (uint256) {\n-\treturn --x;\n+\t/// UnaryOperatorMutation(`--` |==> `++`) of: `return --x;`\n+\treturn ++x;\n }\n \n function mySuffixIncr(uint256 x) public pure returns (uint256) {\n", - "id": "63", - "name": "mutants/63/UnaryOperatorMutation/UnaryOperatorMutation.sol", - "original": "UnaryOperatorMutation/UnaryOperatorMutation.sol", - }, - { - "description": "UnaryOperatorMutation", - "diff": "--- original\n+++ mutant\n@@ -12,7 +12,8 @@\n }\n \n function myPrefixDecr(uint256 x) public pure returns (uint256) {\n-\treturn --x;\n+\t/// UnaryOperatorMutation(`--` |==> `~`) of: `return --x;`\n+\treturn ~x;\n }\n \n function mySuffixIncr(uint256 x) public pure returns (uint256) {\n", - "id": "64", - "name": "mutants/64/UnaryOperatorMutation/UnaryOperatorMutation.sol", - "original": "UnaryOperatorMutation/UnaryOperatorMutation.sol", - }, - { - "description": "UnaryOperatorMutation", - "diff": "--- original\n+++ mutant\n@@ -16,7 +16,8 @@\n }\n \n function mySuffixIncr(uint256 x) public pure returns (uint256) {\n-\tx++;\n+\t/// UnaryOperatorMutation(`++` |==> `--`) of: `x++;`\n+\tx--;\n \treturn x;\n }\n \n", - "id": "65", - "name": "mutants/65/UnaryOperatorMutation/UnaryOperatorMutation.sol", - "original": "UnaryOperatorMutation/UnaryOperatorMutation.sol", - }, - { - "description": "UnaryOperatorMutation", - "diff": "--- original\n+++ mutant\n@@ -21,7 +21,8 @@\n }\n \n function mySuffixDecr(uint256 x) public pure returns (uint256) {\n-\tx--;\n+\t/// UnaryOperatorMutation(`--` |==> `++`) of: `x--;`\n+\tx++;\n \treturn x;\n }\n }\n", - "id": "66", - "name": "mutants/66/UnaryOperatorMutation/UnaryOperatorMutation.sol", - "original": "UnaryOperatorMutation/UnaryOperatorMutation.sol", - }, - { - "description": "ElimDelegateMutation", - "diff": "--- original\n+++ mutant\n@@ -22,7 +22,8 @@\n \n \n function setVars(address _contract, uint _num) public payable {\n- (bool success, bytes memory data) = _contract.delegatecall(\n+ /// ElimDelegateMutation(`delegatecall` |==> `call`) of: `(bool success, bytes memory data) = _contract.delegatecall(`\n+ (bool success, bytes memory data) = _contract.call(\n abi.encodeWithSignature(\"setVars(uint256)\", _num)\n );\n \tdelegateSuccessful = success;\n", - "id": "67", - "name": "mutants/67/ElimDelegateMutation/ElimDelegateMutation.sol", - "original": "ElimDelegateMutation/ElimDelegateMutation.sol", - } -] \ No newline at end of file diff --git a/resources/regressions/all.json/input_json/AssignmentMutation.sol_json.ast b/resources/regressions/all.json/input_json/AssignmentMutation.sol_json.ast deleted file mode 100644 index 26ee0b6..0000000 --- a/resources/regressions/all.json/input_json/AssignmentMutation.sol_json.ast +++ /dev/null @@ -1,518 +0,0 @@ -{ - "absolutePath": "benchmarks/AssignmentMutation/AssignmentMutation.sol", - "exportedSymbols": - { - "AssignmentMutation": - [ - 37 - ] - }, - "id": 38, - "license": "GPL-3.0-only", - "nodeType": "SourceUnit", - "nodes": - [ - { - "id": 1, - "literals": - [ - "solidity", - ">", - "0.7", - ".0" - ], - "nodeType": "PragmaDirective", - "src": "41:23:0" - }, - { - "id": 2, - "literals": - [ - "experimental", - "ABIEncoderV2" - ], - "nodeType": "PragmaDirective", - "src": "65:33:0" - }, - { - "abstract": false, - "baseContracts": [], - "canonicalName": "AssignmentMutation", - "contractDependencies": [], - "contractKind": "contract", - "fullyImplemented": true, - "id": 37, - "linearizedBaseContracts": - [ - 37 - ], - "name": "AssignmentMutation", - "nameLocation": "109:18:0", - "nodeType": "ContractDefinition", - "nodes": - [ - { - "constant": false, - "functionSelector": "0c55699c", - "id": 4, - "mutability": "mutable", - "name": "x", - "nameLocation": "149:1:0", - "nodeType": "VariableDeclaration", - "scope": 37, - "src": "134:16:0", - "stateVariable": true, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": - { - "id": 3, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "134:7:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "public" - }, - { - "constant": false, - "functionSelector": "a56dfe4a", - "id": 6, - "mutability": "mutable", - "name": "y", - "nameLocation": "171:1:0", - "nodeType": "VariableDeclaration", - "scope": 37, - "src": "156:16:0", - "stateVariable": true, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": - { - "id": 5, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "156:7:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "public" - }, - { - "constant": false, - "functionSelector": "c5d7802e", - "id": 8, - "mutability": "mutable", - "name": "z", - "nameLocation": "193:1:0", - "nodeType": "VariableDeclaration", - "scope": 37, - "src": "178:16:0", - "stateVariable": true, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": - { - "id": 7, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "178:7:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "public" - }, - { - "constant": false, - "functionSelector": "0dbe671f", - "id": 10, - "mutability": "mutable", - "name": "a", - "nameLocation": "212:1:0", - "nodeType": "VariableDeclaration", - "scope": 37, - "src": "200:13:0", - "stateVariable": true, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "typeName": - { - "id": 9, - "name": "bool", - "nodeType": "ElementaryTypeName", - "src": "200:4:0", - "typeDescriptions": - { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "visibility": "public" - }, - { - "constant": false, - "functionSelector": "4df7e3d0", - "id": 12, - "mutability": "mutable", - "name": "b", - "nameLocation": "231:1:0", - "nodeType": "VariableDeclaration", - "scope": 37, - "src": "219:13:0", - "stateVariable": true, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "typeName": - { - "id": 11, - "name": "bool", - "nodeType": "ElementaryTypeName", - "src": "219:4:0", - "typeDescriptions": - { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "visibility": "public" - }, - { - "body": - { - "id": 35, - "nodeType": "Block", - "src": "253:146:0", - "statements": - [ - { - "expression": - { - "id": 17, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": - { - "id": 15, - "name": "x", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4, - "src": "256:1:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": - { - "hexValue": "3432", - "id": 16, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "260:2:0", - "typeDescriptions": - { - "typeIdentifier": "t_rational_42_by_1", - "typeString": "int_const 42" - }, - "value": "42" - }, - "src": "256:6:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 18, - "nodeType": "ExpressionStatement", - "src": "256:6:0" - }, - { - "expression": - { - "id": 21, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": - { - "id": 19, - "name": "y", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 6, - "src": "281:1:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": - { - "hexValue": "3133", - "id": 20, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "285:2:0", - "typeDescriptions": - { - "typeIdentifier": "t_rational_13_by_1", - "typeString": "int_const 13" - }, - "value": "13" - }, - "src": "281:6:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 22, - "nodeType": "ExpressionStatement", - "src": "281:6:0" - }, - { - "expression": - { - "id": 25, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": - { - "id": 23, - "name": "z", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 8, - "src": "306:1:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": - { - "hexValue": "33313130", - "id": 24, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "310:4:0", - "typeDescriptions": - { - "typeIdentifier": "t_rational_3110_by_1", - "typeString": "int_const 3110" - }, - "value": "3110" - }, - "src": "306:8:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 26, - "nodeType": "ExpressionStatement", - "src": "306:8:0" - }, - { - "expression": - { - "id": 29, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": - { - "id": 27, - "name": "a", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 10, - "src": "335:1:0", - "typeDescriptions": - { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": - { - "hexValue": "74727565", - "id": 28, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "bool", - "lValueRequested": false, - "nodeType": "Literal", - "src": "339:4:0", - "typeDescriptions": - { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "value": "true" - }, - "src": "335:8:0", - "typeDescriptions": - { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "id": 30, - "nodeType": "ExpressionStatement", - "src": "335:8:0" - }, - { - "expression": - { - "id": 33, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": - { - "id": 31, - "name": "b", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 12, - "src": "364:1:0", - "typeDescriptions": - { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": - { - "hexValue": "66616c7365", - "id": 32, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "bool", - "lValueRequested": false, - "nodeType": "Literal", - "src": "368:5:0", - "typeDescriptions": - { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "value": "false" - }, - "src": "364:9:0", - "typeDescriptions": - { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "id": 34, - "nodeType": "ExpressionStatement", - "src": "364:9:0" - } - ] - }, - "id": 36, - "implemented": true, - "kind": "constructor", - "modifiers": [], - "name": "", - "nameLocation": "-1:-1:-1", - "nodeType": "FunctionDefinition", - "parameters": - { - "id": 13, - "nodeType": "ParameterList", - "parameters": [], - "src": "250:2:0" - }, - "returnParameters": - { - "id": 14, - "nodeType": "ParameterList", - "parameters": [], - "src": "253:0:0" - }, - "scope": 37, - "src": "239:160:0", - "stateMutability": "nonpayable", - "virtual": false, - "visibility": "public" - } - ], - "scope": 38, - "src": "100:301:0", - "usedErrors": [] - } - ], - "src": "41:361:0" -} \ No newline at end of file diff --git a/resources/regressions/all.json/input_json/AssignmentMutation.sol_json.ast.json b/resources/regressions/all.json/input_json/AssignmentMutation.sol_json.ast.json deleted file mode 100644 index 26ee0b6..0000000 --- a/resources/regressions/all.json/input_json/AssignmentMutation.sol_json.ast.json +++ /dev/null @@ -1,518 +0,0 @@ -{ - "absolutePath": "benchmarks/AssignmentMutation/AssignmentMutation.sol", - "exportedSymbols": - { - "AssignmentMutation": - [ - 37 - ] - }, - "id": 38, - "license": "GPL-3.0-only", - "nodeType": "SourceUnit", - "nodes": - [ - { - "id": 1, - "literals": - [ - "solidity", - ">", - "0.7", - ".0" - ], - "nodeType": "PragmaDirective", - "src": "41:23:0" - }, - { - "id": 2, - "literals": - [ - "experimental", - "ABIEncoderV2" - ], - "nodeType": "PragmaDirective", - "src": "65:33:0" - }, - { - "abstract": false, - "baseContracts": [], - "canonicalName": "AssignmentMutation", - "contractDependencies": [], - "contractKind": "contract", - "fullyImplemented": true, - "id": 37, - "linearizedBaseContracts": - [ - 37 - ], - "name": "AssignmentMutation", - "nameLocation": "109:18:0", - "nodeType": "ContractDefinition", - "nodes": - [ - { - "constant": false, - "functionSelector": "0c55699c", - "id": 4, - "mutability": "mutable", - "name": "x", - "nameLocation": "149:1:0", - "nodeType": "VariableDeclaration", - "scope": 37, - "src": "134:16:0", - "stateVariable": true, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": - { - "id": 3, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "134:7:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "public" - }, - { - "constant": false, - "functionSelector": "a56dfe4a", - "id": 6, - "mutability": "mutable", - "name": "y", - "nameLocation": "171:1:0", - "nodeType": "VariableDeclaration", - "scope": 37, - "src": "156:16:0", - "stateVariable": true, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": - { - "id": 5, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "156:7:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "public" - }, - { - "constant": false, - "functionSelector": "c5d7802e", - "id": 8, - "mutability": "mutable", - "name": "z", - "nameLocation": "193:1:0", - "nodeType": "VariableDeclaration", - "scope": 37, - "src": "178:16:0", - "stateVariable": true, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": - { - "id": 7, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "178:7:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "public" - }, - { - "constant": false, - "functionSelector": "0dbe671f", - "id": 10, - "mutability": "mutable", - "name": "a", - "nameLocation": "212:1:0", - "nodeType": "VariableDeclaration", - "scope": 37, - "src": "200:13:0", - "stateVariable": true, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "typeName": - { - "id": 9, - "name": "bool", - "nodeType": "ElementaryTypeName", - "src": "200:4:0", - "typeDescriptions": - { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "visibility": "public" - }, - { - "constant": false, - "functionSelector": "4df7e3d0", - "id": 12, - "mutability": "mutable", - "name": "b", - "nameLocation": "231:1:0", - "nodeType": "VariableDeclaration", - "scope": 37, - "src": "219:13:0", - "stateVariable": true, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "typeName": - { - "id": 11, - "name": "bool", - "nodeType": "ElementaryTypeName", - "src": "219:4:0", - "typeDescriptions": - { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "visibility": "public" - }, - { - "body": - { - "id": 35, - "nodeType": "Block", - "src": "253:146:0", - "statements": - [ - { - "expression": - { - "id": 17, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": - { - "id": 15, - "name": "x", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4, - "src": "256:1:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": - { - "hexValue": "3432", - "id": 16, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "260:2:0", - "typeDescriptions": - { - "typeIdentifier": "t_rational_42_by_1", - "typeString": "int_const 42" - }, - "value": "42" - }, - "src": "256:6:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 18, - "nodeType": "ExpressionStatement", - "src": "256:6:0" - }, - { - "expression": - { - "id": 21, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": - { - "id": 19, - "name": "y", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 6, - "src": "281:1:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": - { - "hexValue": "3133", - "id": 20, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "285:2:0", - "typeDescriptions": - { - "typeIdentifier": "t_rational_13_by_1", - "typeString": "int_const 13" - }, - "value": "13" - }, - "src": "281:6:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 22, - "nodeType": "ExpressionStatement", - "src": "281:6:0" - }, - { - "expression": - { - "id": 25, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": - { - "id": 23, - "name": "z", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 8, - "src": "306:1:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": - { - "hexValue": "33313130", - "id": 24, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "310:4:0", - "typeDescriptions": - { - "typeIdentifier": "t_rational_3110_by_1", - "typeString": "int_const 3110" - }, - "value": "3110" - }, - "src": "306:8:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 26, - "nodeType": "ExpressionStatement", - "src": "306:8:0" - }, - { - "expression": - { - "id": 29, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": - { - "id": 27, - "name": "a", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 10, - "src": "335:1:0", - "typeDescriptions": - { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": - { - "hexValue": "74727565", - "id": 28, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "bool", - "lValueRequested": false, - "nodeType": "Literal", - "src": "339:4:0", - "typeDescriptions": - { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "value": "true" - }, - "src": "335:8:0", - "typeDescriptions": - { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "id": 30, - "nodeType": "ExpressionStatement", - "src": "335:8:0" - }, - { - "expression": - { - "id": 33, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": - { - "id": 31, - "name": "b", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 12, - "src": "364:1:0", - "typeDescriptions": - { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": - { - "hexValue": "66616c7365", - "id": 32, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "bool", - "lValueRequested": false, - "nodeType": "Literal", - "src": "368:5:0", - "typeDescriptions": - { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "value": "false" - }, - "src": "364:9:0", - "typeDescriptions": - { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "id": 34, - "nodeType": "ExpressionStatement", - "src": "364:9:0" - } - ] - }, - "id": 36, - "implemented": true, - "kind": "constructor", - "modifiers": [], - "name": "", - "nameLocation": "-1:-1:-1", - "nodeType": "FunctionDefinition", - "parameters": - { - "id": 13, - "nodeType": "ParameterList", - "parameters": [], - "src": "250:2:0" - }, - "returnParameters": - { - "id": 14, - "nodeType": "ParameterList", - "parameters": [], - "src": "253:0:0" - }, - "scope": 37, - "src": "239:160:0", - "stateMutability": "nonpayable", - "virtual": false, - "visibility": "public" - } - ], - "scope": 38, - "src": "100:301:0", - "usedErrors": [] - } - ], - "src": "41:361:0" -} \ No newline at end of file diff --git a/resources/regressions/all.json/input_json/BinaryOpMutation.sol_json.ast b/resources/regressions/all.json/input_json/BinaryOpMutation.sol_json.ast deleted file mode 100644 index b02050b..0000000 --- a/resources/regressions/all.json/input_json/BinaryOpMutation.sol_json.ast +++ /dev/null @@ -1,1183 +0,0 @@ -{ - "absolutePath": "benchmarks/BinaryOpMutation/BinaryOpMutation.sol", - "exportedSymbols": - { - "BinaryOpMutation": - [ - 87 - ] - }, - "id": 88, - "license": "GPL-3.0-only", - "nodeType": "SourceUnit", - "nodes": - [ - { - "id": 1, - "literals": - [ - "solidity", - ">", - "0.7", - ".0" - ], - "nodeType": "PragmaDirective", - "src": "41:23:0" - }, - { - "id": 2, - "literals": - [ - "experimental", - "ABIEncoderV2" - ], - "nodeType": "PragmaDirective", - "src": "65:33:0" - }, - { - "abstract": false, - "baseContracts": [], - "canonicalName": "BinaryOpMutation", - "contractDependencies": [], - "contractKind": "contract", - "fullyImplemented": true, - "id": 87, - "linearizedBaseContracts": - [ - 87 - ], - "name": "BinaryOpMutation", - "nameLocation": "109:16:0", - "nodeType": "ContractDefinition", - "nodes": - [ - { - "body": - { - "id": 15, - "nodeType": "Block", - "src": "204:22:0", - "statements": - [ - { - "expression": - { - "commonType": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 13, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": - { - "id": 11, - "name": "x", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4, - "src": "214:1:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "+", - "rightExpression": - { - "id": 12, - "name": "y", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 6, - "src": "218:1:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "214:5:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "functionReturnParameters": 10, - "id": 14, - "nodeType": "Return", - "src": "207:12:0" - } - ] - }, - "functionSelector": "04b53fe4", - "id": 16, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "myAddition", - "nameLocation": "141:10:0", - "nodeType": "FunctionDefinition", - "parameters": - { - "id": 7, - "nodeType": "ParameterList", - "parameters": - [ - { - "constant": false, - "id": 4, - "mutability": "mutable", - "name": "x", - "nameLocation": "160:1:0", - "nodeType": "VariableDeclaration", - "scope": 16, - "src": "152:9:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": - { - "id": 3, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "152:7:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 6, - "mutability": "mutable", - "name": "y", - "nameLocation": "171:1:0", - "nodeType": "VariableDeclaration", - "scope": 16, - "src": "163:9:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": - { - "id": 5, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "163:7:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - } - ], - "src": "151:22:0" - }, - "returnParameters": - { - "id": 10, - "nodeType": "ParameterList", - "parameters": - [ - { - "constant": false, - "id": 9, - "mutability": "mutable", - "name": "", - "nameLocation": "-1:-1:-1", - "nodeType": "VariableDeclaration", - "scope": 16, - "src": "195:7:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": - { - "id": 8, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "195:7:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - } - ], - "src": "194:9:0" - }, - "scope": 87, - "src": "132:94:0", - "stateMutability": "pure", - "virtual": false, - "visibility": "public" - }, - { - "body": - { - "id": 29, - "nodeType": "Block", - "src": "307:22:0", - "statements": - [ - { - "expression": - { - "commonType": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 27, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": - { - "id": 25, - "name": "x", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 18, - "src": "317:1:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "-", - "rightExpression": - { - "id": 26, - "name": "y", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 20, - "src": "321:1:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "317:5:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "functionReturnParameters": 24, - "id": 28, - "nodeType": "Return", - "src": "310:12:0" - } - ] - }, - "functionSelector": "b3d09aaa", - "id": 30, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "mySubtraction", - "nameLocation": "241:13:0", - "nodeType": "FunctionDefinition", - "parameters": - { - "id": 21, - "nodeType": "ParameterList", - "parameters": - [ - { - "constant": false, - "id": 18, - "mutability": "mutable", - "name": "x", - "nameLocation": "263:1:0", - "nodeType": "VariableDeclaration", - "scope": 30, - "src": "255:9:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": - { - "id": 17, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "255:7:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 20, - "mutability": "mutable", - "name": "y", - "nameLocation": "274:1:0", - "nodeType": "VariableDeclaration", - "scope": 30, - "src": "266:9:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": - { - "id": 19, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "266:7:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - } - ], - "src": "254:22:0" - }, - "returnParameters": - { - "id": 24, - "nodeType": "ParameterList", - "parameters": - [ - { - "constant": false, - "id": 23, - "mutability": "mutable", - "name": "", - "nameLocation": "-1:-1:-1", - "nodeType": "VariableDeclaration", - "scope": 30, - "src": "298:7:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": - { - "id": 22, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "298:7:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - } - ], - "src": "297:9:0" - }, - "scope": 87, - "src": "232:97:0", - "stateMutability": "pure", - "virtual": false, - "visibility": "public" - }, - { - "body": - { - "id": 43, - "nodeType": "Block", - "src": "413:22:0", - "statements": - [ - { - "expression": - { - "commonType": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 41, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": - { - "id": 39, - "name": "x", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 32, - "src": "423:1:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "*", - "rightExpression": - { - "id": 40, - "name": "y", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 34, - "src": "427:1:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "423:5:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "functionReturnParameters": 38, - "id": 42, - "nodeType": "Return", - "src": "416:12:0" - } - ] - }, - "functionSelector": "6831fd12", - "id": 44, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "myMultiplication", - "nameLocation": "344:16:0", - "nodeType": "FunctionDefinition", - "parameters": - { - "id": 35, - "nodeType": "ParameterList", - "parameters": - [ - { - "constant": false, - "id": 32, - "mutability": "mutable", - "name": "x", - "nameLocation": "369:1:0", - "nodeType": "VariableDeclaration", - "scope": 44, - "src": "361:9:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": - { - "id": 31, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "361:7:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 34, - "mutability": "mutable", - "name": "y", - "nameLocation": "380:1:0", - "nodeType": "VariableDeclaration", - "scope": 44, - "src": "372:9:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": - { - "id": 33, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "372:7:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - } - ], - "src": "360:22:0" - }, - "returnParameters": - { - "id": 38, - "nodeType": "ParameterList", - "parameters": - [ - { - "constant": false, - "id": 37, - "mutability": "mutable", - "name": "", - "nameLocation": "-1:-1:-1", - "nodeType": "VariableDeclaration", - "scope": 44, - "src": "404:7:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": - { - "id": 36, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "404:7:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - } - ], - "src": "403:9:0" - }, - "scope": 87, - "src": "335:100:0", - "stateMutability": "pure", - "virtual": false, - "visibility": "public" - }, - { - "body": - { - "id": 57, - "nodeType": "Block", - "src": "513:22:0", - "statements": - [ - { - "expression": - { - "commonType": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 55, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": - { - "id": 53, - "name": "x", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 46, - "src": "523:1:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "/", - "rightExpression": - { - "id": 54, - "name": "y", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 48, - "src": "527:1:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "523:5:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "functionReturnParameters": 52, - "id": 56, - "nodeType": "Return", - "src": "516:12:0" - } - ] - }, - "functionSelector": "9d4f4e60", - "id": 58, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "myDivision", - "nameLocation": "450:10:0", - "nodeType": "FunctionDefinition", - "parameters": - { - "id": 49, - "nodeType": "ParameterList", - "parameters": - [ - { - "constant": false, - "id": 46, - "mutability": "mutable", - "name": "x", - "nameLocation": "469:1:0", - "nodeType": "VariableDeclaration", - "scope": 58, - "src": "461:9:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": - { - "id": 45, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "461:7:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 48, - "mutability": "mutable", - "name": "y", - "nameLocation": "480:1:0", - "nodeType": "VariableDeclaration", - "scope": 58, - "src": "472:9:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": - { - "id": 47, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "472:7:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - } - ], - "src": "460:22:0" - }, - "returnParameters": - { - "id": 52, - "nodeType": "ParameterList", - "parameters": - [ - { - "constant": false, - "id": 51, - "mutability": "mutable", - "name": "", - "nameLocation": "-1:-1:-1", - "nodeType": "VariableDeclaration", - "scope": 58, - "src": "504:7:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": - { - "id": 50, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "504:7:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - } - ], - "src": "503:9:0" - }, - "scope": 87, - "src": "441:94:0", - "stateMutability": "pure", - "virtual": false, - "visibility": "public" - }, - { - "body": - { - "id": 71, - "nodeType": "Block", - "src": "611:22:0", - "statements": - [ - { - "expression": - { - "commonType": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 69, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": - { - "id": 67, - "name": "x", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 60, - "src": "621:1:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "%", - "rightExpression": - { - "id": 68, - "name": "y", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 62, - "src": "625:1:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "621:5:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "functionReturnParameters": 66, - "id": 70, - "nodeType": "Return", - "src": "614:12:0" - } - ] - }, - "functionSelector": "dc6092a8", - "id": 72, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "myModulo", - "nameLocation": "550:8:0", - "nodeType": "FunctionDefinition", - "parameters": - { - "id": 63, - "nodeType": "ParameterList", - "parameters": - [ - { - "constant": false, - "id": 60, - "mutability": "mutable", - "name": "x", - "nameLocation": "567:1:0", - "nodeType": "VariableDeclaration", - "scope": 72, - "src": "559:9:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": - { - "id": 59, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "559:7:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 62, - "mutability": "mutable", - "name": "y", - "nameLocation": "578:1:0", - "nodeType": "VariableDeclaration", - "scope": 72, - "src": "570:9:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": - { - "id": 61, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "570:7:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - } - ], - "src": "558:22:0" - }, - "returnParameters": - { - "id": 66, - "nodeType": "ParameterList", - "parameters": - [ - { - "constant": false, - "id": 65, - "mutability": "mutable", - "name": "", - "nameLocation": "-1:-1:-1", - "nodeType": "VariableDeclaration", - "scope": 72, - "src": "602:7:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": - { - "id": 64, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "602:7:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - } - ], - "src": "601:9:0" - }, - "scope": 87, - "src": "541:92:0", - "stateMutability": "pure", - "virtual": false, - "visibility": "public" - }, - { - "body": - { - "id": 85, - "nodeType": "Block", - "src": "717:23:0", - "statements": - [ - { - "expression": - { - "commonType": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 83, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": - { - "id": 81, - "name": "x", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 74, - "src": "727:1:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "**", - "rightExpression": - { - "id": 82, - "name": "y", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 76, - "src": "732:1:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "727:6:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "functionReturnParameters": 80, - "id": 84, - "nodeType": "Return", - "src": "720:13:0" - } - ] - }, - "functionSelector": "df159c7b", - "id": 86, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "myExponentiation", - "nameLocation": "648:16:0", - "nodeType": "FunctionDefinition", - "parameters": - { - "id": 77, - "nodeType": "ParameterList", - "parameters": - [ - { - "constant": false, - "id": 74, - "mutability": "mutable", - "name": "x", - "nameLocation": "673:1:0", - "nodeType": "VariableDeclaration", - "scope": 86, - "src": "665:9:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": - { - "id": 73, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "665:7:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 76, - "mutability": "mutable", - "name": "y", - "nameLocation": "684:1:0", - "nodeType": "VariableDeclaration", - "scope": 86, - "src": "676:9:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": - { - "id": 75, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "676:7:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - } - ], - "src": "664:22:0" - }, - "returnParameters": - { - "id": 80, - "nodeType": "ParameterList", - "parameters": - [ - { - "constant": false, - "id": 79, - "mutability": "mutable", - "name": "", - "nameLocation": "-1:-1:-1", - "nodeType": "VariableDeclaration", - "scope": 86, - "src": "708:7:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": - { - "id": 78, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "708:7:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - } - ], - "src": "707:9:0" - }, - "scope": 87, - "src": "639:101:0", - "stateMutability": "pure", - "virtual": false, - "visibility": "public" - } - ], - "scope": 88, - "src": "100:643:0", - "usedErrors": [] - } - ], - "src": "41:703:0" -} \ No newline at end of file diff --git a/resources/regressions/all.json/input_json/BinaryOpMutation.sol_json.ast.json b/resources/regressions/all.json/input_json/BinaryOpMutation.sol_json.ast.json deleted file mode 100644 index b02050b..0000000 --- a/resources/regressions/all.json/input_json/BinaryOpMutation.sol_json.ast.json +++ /dev/null @@ -1,1183 +0,0 @@ -{ - "absolutePath": "benchmarks/BinaryOpMutation/BinaryOpMutation.sol", - "exportedSymbols": - { - "BinaryOpMutation": - [ - 87 - ] - }, - "id": 88, - "license": "GPL-3.0-only", - "nodeType": "SourceUnit", - "nodes": - [ - { - "id": 1, - "literals": - [ - "solidity", - ">", - "0.7", - ".0" - ], - "nodeType": "PragmaDirective", - "src": "41:23:0" - }, - { - "id": 2, - "literals": - [ - "experimental", - "ABIEncoderV2" - ], - "nodeType": "PragmaDirective", - "src": "65:33:0" - }, - { - "abstract": false, - "baseContracts": [], - "canonicalName": "BinaryOpMutation", - "contractDependencies": [], - "contractKind": "contract", - "fullyImplemented": true, - "id": 87, - "linearizedBaseContracts": - [ - 87 - ], - "name": "BinaryOpMutation", - "nameLocation": "109:16:0", - "nodeType": "ContractDefinition", - "nodes": - [ - { - "body": - { - "id": 15, - "nodeType": "Block", - "src": "204:22:0", - "statements": - [ - { - "expression": - { - "commonType": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 13, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": - { - "id": 11, - "name": "x", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4, - "src": "214:1:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "+", - "rightExpression": - { - "id": 12, - "name": "y", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 6, - "src": "218:1:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "214:5:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "functionReturnParameters": 10, - "id": 14, - "nodeType": "Return", - "src": "207:12:0" - } - ] - }, - "functionSelector": "04b53fe4", - "id": 16, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "myAddition", - "nameLocation": "141:10:0", - "nodeType": "FunctionDefinition", - "parameters": - { - "id": 7, - "nodeType": "ParameterList", - "parameters": - [ - { - "constant": false, - "id": 4, - "mutability": "mutable", - "name": "x", - "nameLocation": "160:1:0", - "nodeType": "VariableDeclaration", - "scope": 16, - "src": "152:9:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": - { - "id": 3, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "152:7:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 6, - "mutability": "mutable", - "name": "y", - "nameLocation": "171:1:0", - "nodeType": "VariableDeclaration", - "scope": 16, - "src": "163:9:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": - { - "id": 5, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "163:7:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - } - ], - "src": "151:22:0" - }, - "returnParameters": - { - "id": 10, - "nodeType": "ParameterList", - "parameters": - [ - { - "constant": false, - "id": 9, - "mutability": "mutable", - "name": "", - "nameLocation": "-1:-1:-1", - "nodeType": "VariableDeclaration", - "scope": 16, - "src": "195:7:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": - { - "id": 8, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "195:7:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - } - ], - "src": "194:9:0" - }, - "scope": 87, - "src": "132:94:0", - "stateMutability": "pure", - "virtual": false, - "visibility": "public" - }, - { - "body": - { - "id": 29, - "nodeType": "Block", - "src": "307:22:0", - "statements": - [ - { - "expression": - { - "commonType": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 27, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": - { - "id": 25, - "name": "x", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 18, - "src": "317:1:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "-", - "rightExpression": - { - "id": 26, - "name": "y", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 20, - "src": "321:1:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "317:5:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "functionReturnParameters": 24, - "id": 28, - "nodeType": "Return", - "src": "310:12:0" - } - ] - }, - "functionSelector": "b3d09aaa", - "id": 30, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "mySubtraction", - "nameLocation": "241:13:0", - "nodeType": "FunctionDefinition", - "parameters": - { - "id": 21, - "nodeType": "ParameterList", - "parameters": - [ - { - "constant": false, - "id": 18, - "mutability": "mutable", - "name": "x", - "nameLocation": "263:1:0", - "nodeType": "VariableDeclaration", - "scope": 30, - "src": "255:9:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": - { - "id": 17, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "255:7:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 20, - "mutability": "mutable", - "name": "y", - "nameLocation": "274:1:0", - "nodeType": "VariableDeclaration", - "scope": 30, - "src": "266:9:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": - { - "id": 19, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "266:7:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - } - ], - "src": "254:22:0" - }, - "returnParameters": - { - "id": 24, - "nodeType": "ParameterList", - "parameters": - [ - { - "constant": false, - "id": 23, - "mutability": "mutable", - "name": "", - "nameLocation": "-1:-1:-1", - "nodeType": "VariableDeclaration", - "scope": 30, - "src": "298:7:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": - { - "id": 22, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "298:7:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - } - ], - "src": "297:9:0" - }, - "scope": 87, - "src": "232:97:0", - "stateMutability": "pure", - "virtual": false, - "visibility": "public" - }, - { - "body": - { - "id": 43, - "nodeType": "Block", - "src": "413:22:0", - "statements": - [ - { - "expression": - { - "commonType": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 41, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": - { - "id": 39, - "name": "x", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 32, - "src": "423:1:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "*", - "rightExpression": - { - "id": 40, - "name": "y", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 34, - "src": "427:1:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "423:5:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "functionReturnParameters": 38, - "id": 42, - "nodeType": "Return", - "src": "416:12:0" - } - ] - }, - "functionSelector": "6831fd12", - "id": 44, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "myMultiplication", - "nameLocation": "344:16:0", - "nodeType": "FunctionDefinition", - "parameters": - { - "id": 35, - "nodeType": "ParameterList", - "parameters": - [ - { - "constant": false, - "id": 32, - "mutability": "mutable", - "name": "x", - "nameLocation": "369:1:0", - "nodeType": "VariableDeclaration", - "scope": 44, - "src": "361:9:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": - { - "id": 31, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "361:7:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 34, - "mutability": "mutable", - "name": "y", - "nameLocation": "380:1:0", - "nodeType": "VariableDeclaration", - "scope": 44, - "src": "372:9:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": - { - "id": 33, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "372:7:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - } - ], - "src": "360:22:0" - }, - "returnParameters": - { - "id": 38, - "nodeType": "ParameterList", - "parameters": - [ - { - "constant": false, - "id": 37, - "mutability": "mutable", - "name": "", - "nameLocation": "-1:-1:-1", - "nodeType": "VariableDeclaration", - "scope": 44, - "src": "404:7:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": - { - "id": 36, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "404:7:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - } - ], - "src": "403:9:0" - }, - "scope": 87, - "src": "335:100:0", - "stateMutability": "pure", - "virtual": false, - "visibility": "public" - }, - { - "body": - { - "id": 57, - "nodeType": "Block", - "src": "513:22:0", - "statements": - [ - { - "expression": - { - "commonType": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 55, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": - { - "id": 53, - "name": "x", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 46, - "src": "523:1:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "/", - "rightExpression": - { - "id": 54, - "name": "y", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 48, - "src": "527:1:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "523:5:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "functionReturnParameters": 52, - "id": 56, - "nodeType": "Return", - "src": "516:12:0" - } - ] - }, - "functionSelector": "9d4f4e60", - "id": 58, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "myDivision", - "nameLocation": "450:10:0", - "nodeType": "FunctionDefinition", - "parameters": - { - "id": 49, - "nodeType": "ParameterList", - "parameters": - [ - { - "constant": false, - "id": 46, - "mutability": "mutable", - "name": "x", - "nameLocation": "469:1:0", - "nodeType": "VariableDeclaration", - "scope": 58, - "src": "461:9:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": - { - "id": 45, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "461:7:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 48, - "mutability": "mutable", - "name": "y", - "nameLocation": "480:1:0", - "nodeType": "VariableDeclaration", - "scope": 58, - "src": "472:9:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": - { - "id": 47, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "472:7:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - } - ], - "src": "460:22:0" - }, - "returnParameters": - { - "id": 52, - "nodeType": "ParameterList", - "parameters": - [ - { - "constant": false, - "id": 51, - "mutability": "mutable", - "name": "", - "nameLocation": "-1:-1:-1", - "nodeType": "VariableDeclaration", - "scope": 58, - "src": "504:7:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": - { - "id": 50, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "504:7:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - } - ], - "src": "503:9:0" - }, - "scope": 87, - "src": "441:94:0", - "stateMutability": "pure", - "virtual": false, - "visibility": "public" - }, - { - "body": - { - "id": 71, - "nodeType": "Block", - "src": "611:22:0", - "statements": - [ - { - "expression": - { - "commonType": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 69, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": - { - "id": 67, - "name": "x", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 60, - "src": "621:1:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "%", - "rightExpression": - { - "id": 68, - "name": "y", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 62, - "src": "625:1:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "621:5:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "functionReturnParameters": 66, - "id": 70, - "nodeType": "Return", - "src": "614:12:0" - } - ] - }, - "functionSelector": "dc6092a8", - "id": 72, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "myModulo", - "nameLocation": "550:8:0", - "nodeType": "FunctionDefinition", - "parameters": - { - "id": 63, - "nodeType": "ParameterList", - "parameters": - [ - { - "constant": false, - "id": 60, - "mutability": "mutable", - "name": "x", - "nameLocation": "567:1:0", - "nodeType": "VariableDeclaration", - "scope": 72, - "src": "559:9:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": - { - "id": 59, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "559:7:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 62, - "mutability": "mutable", - "name": "y", - "nameLocation": "578:1:0", - "nodeType": "VariableDeclaration", - "scope": 72, - "src": "570:9:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": - { - "id": 61, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "570:7:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - } - ], - "src": "558:22:0" - }, - "returnParameters": - { - "id": 66, - "nodeType": "ParameterList", - "parameters": - [ - { - "constant": false, - "id": 65, - "mutability": "mutable", - "name": "", - "nameLocation": "-1:-1:-1", - "nodeType": "VariableDeclaration", - "scope": 72, - "src": "602:7:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": - { - "id": 64, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "602:7:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - } - ], - "src": "601:9:0" - }, - "scope": 87, - "src": "541:92:0", - "stateMutability": "pure", - "virtual": false, - "visibility": "public" - }, - { - "body": - { - "id": 85, - "nodeType": "Block", - "src": "717:23:0", - "statements": - [ - { - "expression": - { - "commonType": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 83, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": - { - "id": 81, - "name": "x", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 74, - "src": "727:1:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "**", - "rightExpression": - { - "id": 82, - "name": "y", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 76, - "src": "732:1:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "727:6:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "functionReturnParameters": 80, - "id": 84, - "nodeType": "Return", - "src": "720:13:0" - } - ] - }, - "functionSelector": "df159c7b", - "id": 86, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "myExponentiation", - "nameLocation": "648:16:0", - "nodeType": "FunctionDefinition", - "parameters": - { - "id": 77, - "nodeType": "ParameterList", - "parameters": - [ - { - "constant": false, - "id": 74, - "mutability": "mutable", - "name": "x", - "nameLocation": "673:1:0", - "nodeType": "VariableDeclaration", - "scope": 86, - "src": "665:9:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": - { - "id": 73, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "665:7:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 76, - "mutability": "mutable", - "name": "y", - "nameLocation": "684:1:0", - "nodeType": "VariableDeclaration", - "scope": 86, - "src": "676:9:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": - { - "id": 75, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "676:7:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - } - ], - "src": "664:22:0" - }, - "returnParameters": - { - "id": 80, - "nodeType": "ParameterList", - "parameters": - [ - { - "constant": false, - "id": 79, - "mutability": "mutable", - "name": "", - "nameLocation": "-1:-1:-1", - "nodeType": "VariableDeclaration", - "scope": 86, - "src": "708:7:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": - { - "id": 78, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "708:7:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - } - ], - "src": "707:9:0" - }, - "scope": 87, - "src": "639:101:0", - "stateMutability": "pure", - "virtual": false, - "visibility": "public" - } - ], - "scope": 88, - "src": "100:643:0", - "usedErrors": [] - } - ], - "src": "41:703:0" -} \ No newline at end of file diff --git a/resources/regressions/all.json/input_json/DeleteExpressionMutation.sol_json.ast b/resources/regressions/all.json/input_json/DeleteExpressionMutation.sol_json.ast deleted file mode 100644 index 1230192..0000000 --- a/resources/regressions/all.json/input_json/DeleteExpressionMutation.sol_json.ast +++ /dev/null @@ -1,440 +0,0 @@ -{ - "absolutePath": "benchmarks/DeleteExpressionMutation/DeleteExpressionMutation.sol", - "exportedSymbols": - { - "DeleteExpressionMutation": - [ - 32 - ] - }, - "id": 33, - "license": "GPL-3.0-only", - "nodeType": "SourceUnit", - "nodes": - [ - { - "id": 1, - "literals": - [ - "solidity", - ">", - "0.7", - ".0" - ], - "nodeType": "PragmaDirective", - "src": "41:23:0" - }, - { - "id": 2, - "literals": - [ - "experimental", - "ABIEncoderV2" - ], - "nodeType": "PragmaDirective", - "src": "65:33:0" - }, - { - "abstract": false, - "baseContracts": [], - "canonicalName": "DeleteExpressionMutation", - "contractDependencies": [], - "contractKind": "contract", - "fullyImplemented": true, - "id": 32, - "linearizedBaseContracts": - [ - 32 - ], - "name": "DeleteExpressionMutation", - "nameLocation": "109:24:0", - "nodeType": "ContractDefinition", - "nodes": - [ - { - "body": - { - "id": 30, - "nodeType": "Block", - "src": "202:98:0", - "statements": - [ - { - "assignments": - [ - 10 - ], - "declarations": - [ - { - "constant": false, - "id": 10, - "mutability": "mutable", - "name": "result", - "nameLocation": "213:6:0", - "nodeType": "VariableDeclaration", - "scope": 30, - "src": "205:14:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": - { - "id": 9, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "205:7:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - } - ], - "id": 12, - "initialValue": - { - "hexValue": "30", - "id": 11, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "222:1:0", - "typeDescriptions": - { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - }, - "value": "0" - }, - "nodeType": "VariableDeclarationStatement", - "src": "205:18:0" - }, - { - "body": - { - "id": 26, - "nodeType": "Block", - "src": "258:20:0", - "statements": - [ - { - "expression": - { - "id": 24, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "nodeType": "UnaryOperation", - "operator": "++", - "prefix": false, - "src": "265:9:0", - "subExpression": - { - "id": 23, - "name": "result", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 10, - "src": "265:6:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 25, - "nodeType": "ExpressionStatement", - "src": "265:9:0" - } - ] - }, - "condition": - { - "commonType": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 19, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": - { - "id": 17, - "name": "i", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 14, - "src": "246:1:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "<", - "rightExpression": - { - "id": 18, - "name": "x", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4, - "src": "250:1:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "246:5:0", - "typeDescriptions": - { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "id": 27, - "initializationExpression": - { - "assignments": - [ - 14 - ], - "declarations": - [ - { - "constant": false, - "id": 14, - "mutability": "mutable", - "name": "i", - "nameLocation": "239:1:0", - "nodeType": "VariableDeclaration", - "scope": 27, - "src": "231:9:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": - { - "id": 13, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "231:7:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - } - ], - "id": 16, - "initialValue": - { - "hexValue": "30", - "id": 15, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "243:1:0", - "typeDescriptions": - { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - }, - "value": "0" - }, - "nodeType": "VariableDeclarationStatement", - "src": "231:13:0" - }, - "loopExpression": - { - "expression": - { - "id": 21, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "nodeType": "UnaryOperation", - "operator": "++", - "prefix": false, - "src": "253:3:0", - "subExpression": - { - "id": 20, - "name": "i", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 14, - "src": "253:1:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 22, - "nodeType": "ExpressionStatement", - "src": "253:3:0" - }, - "nodeType": "ForStatement", - "src": "226:52:0" - }, - { - "expression": - { - "id": 28, - "name": "result", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 10, - "src": "287:6:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "functionReturnParameters": 8, - "id": 29, - "nodeType": "Return", - "src": "280:13:0" - } - ] - }, - "functionSelector": "380a9a54", - "id": 31, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "myIdentity", - "nameLocation": "150:10:0", - "nodeType": "FunctionDefinition", - "parameters": - { - "id": 5, - "nodeType": "ParameterList", - "parameters": - [ - { - "constant": false, - "id": 4, - "mutability": "mutable", - "name": "x", - "nameLocation": "169:1:0", - "nodeType": "VariableDeclaration", - "scope": 31, - "src": "161:9:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": - { - "id": 3, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "161:7:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - } - ], - "src": "160:11:0" - }, - "returnParameters": - { - "id": 8, - "nodeType": "ParameterList", - "parameters": - [ - { - "constant": false, - "id": 7, - "mutability": "mutable", - "name": "", - "nameLocation": "-1:-1:-1", - "nodeType": "VariableDeclaration", - "scope": 31, - "src": "193:7:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": - { - "id": 6, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "193:7:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - } - ], - "src": "192:9:0" - }, - "scope": 32, - "src": "141:159:0", - "stateMutability": "pure", - "virtual": false, - "visibility": "public" - } - ], - "scope": 33, - "src": "100:202:0", - "usedErrors": [] - } - ], - "src": "41:262:0" -} \ No newline at end of file diff --git a/resources/regressions/all.json/input_json/DeleteExpressionMutation.sol_json.ast.json b/resources/regressions/all.json/input_json/DeleteExpressionMutation.sol_json.ast.json deleted file mode 100644 index 1230192..0000000 --- a/resources/regressions/all.json/input_json/DeleteExpressionMutation.sol_json.ast.json +++ /dev/null @@ -1,440 +0,0 @@ -{ - "absolutePath": "benchmarks/DeleteExpressionMutation/DeleteExpressionMutation.sol", - "exportedSymbols": - { - "DeleteExpressionMutation": - [ - 32 - ] - }, - "id": 33, - "license": "GPL-3.0-only", - "nodeType": "SourceUnit", - "nodes": - [ - { - "id": 1, - "literals": - [ - "solidity", - ">", - "0.7", - ".0" - ], - "nodeType": "PragmaDirective", - "src": "41:23:0" - }, - { - "id": 2, - "literals": - [ - "experimental", - "ABIEncoderV2" - ], - "nodeType": "PragmaDirective", - "src": "65:33:0" - }, - { - "abstract": false, - "baseContracts": [], - "canonicalName": "DeleteExpressionMutation", - "contractDependencies": [], - "contractKind": "contract", - "fullyImplemented": true, - "id": 32, - "linearizedBaseContracts": - [ - 32 - ], - "name": "DeleteExpressionMutation", - "nameLocation": "109:24:0", - "nodeType": "ContractDefinition", - "nodes": - [ - { - "body": - { - "id": 30, - "nodeType": "Block", - "src": "202:98:0", - "statements": - [ - { - "assignments": - [ - 10 - ], - "declarations": - [ - { - "constant": false, - "id": 10, - "mutability": "mutable", - "name": "result", - "nameLocation": "213:6:0", - "nodeType": "VariableDeclaration", - "scope": 30, - "src": "205:14:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": - { - "id": 9, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "205:7:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - } - ], - "id": 12, - "initialValue": - { - "hexValue": "30", - "id": 11, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "222:1:0", - "typeDescriptions": - { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - }, - "value": "0" - }, - "nodeType": "VariableDeclarationStatement", - "src": "205:18:0" - }, - { - "body": - { - "id": 26, - "nodeType": "Block", - "src": "258:20:0", - "statements": - [ - { - "expression": - { - "id": 24, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "nodeType": "UnaryOperation", - "operator": "++", - "prefix": false, - "src": "265:9:0", - "subExpression": - { - "id": 23, - "name": "result", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 10, - "src": "265:6:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 25, - "nodeType": "ExpressionStatement", - "src": "265:9:0" - } - ] - }, - "condition": - { - "commonType": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 19, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": - { - "id": 17, - "name": "i", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 14, - "src": "246:1:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "<", - "rightExpression": - { - "id": 18, - "name": "x", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4, - "src": "250:1:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "246:5:0", - "typeDescriptions": - { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "id": 27, - "initializationExpression": - { - "assignments": - [ - 14 - ], - "declarations": - [ - { - "constant": false, - "id": 14, - "mutability": "mutable", - "name": "i", - "nameLocation": "239:1:0", - "nodeType": "VariableDeclaration", - "scope": 27, - "src": "231:9:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": - { - "id": 13, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "231:7:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - } - ], - "id": 16, - "initialValue": - { - "hexValue": "30", - "id": 15, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "243:1:0", - "typeDescriptions": - { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - }, - "value": "0" - }, - "nodeType": "VariableDeclarationStatement", - "src": "231:13:0" - }, - "loopExpression": - { - "expression": - { - "id": 21, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "nodeType": "UnaryOperation", - "operator": "++", - "prefix": false, - "src": "253:3:0", - "subExpression": - { - "id": 20, - "name": "i", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 14, - "src": "253:1:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 22, - "nodeType": "ExpressionStatement", - "src": "253:3:0" - }, - "nodeType": "ForStatement", - "src": "226:52:0" - }, - { - "expression": - { - "id": 28, - "name": "result", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 10, - "src": "287:6:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "functionReturnParameters": 8, - "id": 29, - "nodeType": "Return", - "src": "280:13:0" - } - ] - }, - "functionSelector": "380a9a54", - "id": 31, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "myIdentity", - "nameLocation": "150:10:0", - "nodeType": "FunctionDefinition", - "parameters": - { - "id": 5, - "nodeType": "ParameterList", - "parameters": - [ - { - "constant": false, - "id": 4, - "mutability": "mutable", - "name": "x", - "nameLocation": "169:1:0", - "nodeType": "VariableDeclaration", - "scope": 31, - "src": "161:9:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": - { - "id": 3, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "161:7:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - } - ], - "src": "160:11:0" - }, - "returnParameters": - { - "id": 8, - "nodeType": "ParameterList", - "parameters": - [ - { - "constant": false, - "id": 7, - "mutability": "mutable", - "name": "", - "nameLocation": "-1:-1:-1", - "nodeType": "VariableDeclaration", - "scope": 31, - "src": "193:7:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": - { - "id": 6, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "193:7:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - } - ], - "src": "192:9:0" - }, - "scope": 32, - "src": "141:159:0", - "stateMutability": "pure", - "virtual": false, - "visibility": "public" - } - ], - "scope": 33, - "src": "100:202:0", - "usedErrors": [] - } - ], - "src": "41:262:0" -} \ No newline at end of file diff --git a/resources/regressions/all.json/input_json/ElimDelegateMutation.sol_json.ast b/resources/regressions/all.json/input_json/ElimDelegateMutation.sol_json.ast deleted file mode 100644 index c75ab1a..0000000 --- a/resources/regressions/all.json/input_json/ElimDelegateMutation.sol_json.ast +++ /dev/null @@ -1,997 +0,0 @@ -{ - "absolutePath": "benchmarks/ElimDelegateMutation/ElimDelegateMutation.sol", - "exportedSymbols": - { - "A": - [ - 68 - ], - "B": - [ - 28 - ] - }, - "id": 69, - "license": "GPL-3.0-only", - "nodeType": "SourceUnit", - "nodes": - [ - { - "id": 1, - "literals": - [ - "solidity", - "^", - "0.8", - ".13" - ], - "nodeType": "PragmaDirective", - "src": "41:24:0" - }, - { - "abstract": false, - "baseContracts": [], - "canonicalName": "B", - "contractDependencies": [], - "contractKind": "contract", - "fullyImplemented": true, - "id": 28, - "linearizedBaseContracts": - [ - 28 - ], - "name": "B", - "nameLocation": "76:1:0", - "nodeType": "ContractDefinition", - "nodes": - [ - { - "constant": false, - "functionSelector": "4e70b1dc", - "id": 3, - "mutability": "mutable", - "name": "num", - "nameLocation": "96:3:0", - "nodeType": "VariableDeclaration", - "scope": 28, - "src": "84:15:0", - "stateVariable": true, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": - { - "id": 2, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "84:4:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "public" - }, - { - "constant": false, - "functionSelector": "67e404ce", - "id": 5, - "mutability": "mutable", - "name": "sender", - "nameLocation": "120:6:0", - "nodeType": "VariableDeclaration", - "scope": 28, - "src": "105:21:0", - "stateVariable": true, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": - { - "id": 4, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "105:7:0", - "stateMutability": "nonpayable", - "typeDescriptions": - { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "visibility": "public" - }, - { - "constant": false, - "functionSelector": "3fa4f245", - "id": 7, - "mutability": "mutable", - "name": "value", - "nameLocation": "144:5:0", - "nodeType": "VariableDeclaration", - "scope": 28, - "src": "132:17:0", - "stateVariable": true, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": - { - "id": 6, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "132:4:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "public" - }, - { - "body": - { - "id": 26, - "nodeType": "Block", - "src": "199:83:0", - "statements": - [ - { - "expression": - { - "id": 14, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": - { - "id": 12, - "name": "num", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 3, - "src": "209:3:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": - { - "id": 13, - "name": "_num", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 9, - "src": "215:4:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "209:10:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 15, - "nodeType": "ExpressionStatement", - "src": "209:10:0" - }, - { - "expression": - { - "id": 19, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": - { - "id": 16, - "name": "sender", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 5, - "src": "229:6:0", - "typeDescriptions": - { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": - { - "expression": - { - "id": 17, - "name": "msg", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": -15, - "src": "238:3:0", - "typeDescriptions": - { - "typeIdentifier": "t_magic_message", - "typeString": "msg" - } - }, - "id": 18, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "sender", - "nodeType": "MemberAccess", - "src": "238:10:0", - "typeDescriptions": - { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "src": "229:19:0", - "typeDescriptions": - { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "id": 20, - "nodeType": "ExpressionStatement", - "src": "229:19:0" - }, - { - "expression": - { - "id": 24, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": - { - "id": 21, - "name": "value", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 7, - "src": "258:5:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": - { - "expression": - { - "id": 22, - "name": "msg", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": -15, - "src": "266:3:0", - "typeDescriptions": - { - "typeIdentifier": "t_magic_message", - "typeString": "msg" - } - }, - "id": 23, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "value", - "nodeType": "MemberAccess", - "src": "266:9:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "258:17:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 25, - "nodeType": "ExpressionStatement", - "src": "258:17:0" - } - ] - }, - "functionSelector": "6466414b", - "id": 27, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "setVars", - "nameLocation": "165:7:0", - "nodeType": "FunctionDefinition", - "parameters": - { - "id": 10, - "nodeType": "ParameterList", - "parameters": - [ - { - "constant": false, - "id": 9, - "mutability": "mutable", - "name": "_num", - "nameLocation": "178:4:0", - "nodeType": "VariableDeclaration", - "scope": 27, - "src": "173:9:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": - { - "id": 8, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "173:4:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - } - ], - "src": "172:11:0" - }, - "returnParameters": - { - "id": 11, - "nodeType": "ParameterList", - "parameters": [], - "src": "199:0:0" - }, - "scope": 28, - "src": "156:126:0", - "stateMutability": "payable", - "virtual": false, - "visibility": "public" - } - ], - "scope": 69, - "src": "67:217:0", - "usedErrors": [] - }, - { - "abstract": false, - "baseContracts": [], - "canonicalName": "A", - "contractDependencies": [], - "contractKind": "contract", - "fullyImplemented": true, - "id": 68, - "linearizedBaseContracts": - [ - 68 - ], - "name": "A", - "nameLocation": "295:1:0", - "nodeType": "ContractDefinition", - "nodes": - [ - { - "constant": false, - "functionSelector": "4e70b1dc", - "id": 30, - "mutability": "mutable", - "name": "num", - "nameLocation": "315:3:0", - "nodeType": "VariableDeclaration", - "scope": 68, - "src": "303:15:0", - "stateVariable": true, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": - { - "id": 29, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "303:4:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "public" - }, - { - "constant": false, - "functionSelector": "67e404ce", - "id": 32, - "mutability": "mutable", - "name": "sender", - "nameLocation": "339:6:0", - "nodeType": "VariableDeclaration", - "scope": 68, - "src": "324:21:0", - "stateVariable": true, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": - { - "id": 31, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "324:7:0", - "stateMutability": "nonpayable", - "typeDescriptions": - { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "visibility": "public" - }, - { - "constant": false, - "functionSelector": "3fa4f245", - "id": 34, - "mutability": "mutable", - "name": "value", - "nameLocation": "363:5:0", - "nodeType": "VariableDeclaration", - "scope": 68, - "src": "351:17:0", - "stateVariable": true, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": - { - "id": 33, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "351:4:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "public" - }, - { - "constant": false, - "functionSelector": "f95ec93b", - "id": 36, - "mutability": "mutable", - "name": "delegateSuccessful", - "nameLocation": "386:18:0", - "nodeType": "VariableDeclaration", - "scope": 68, - "src": "374:30:0", - "stateVariable": true, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "typeName": - { - "id": 35, - "name": "bool", - "nodeType": "ElementaryTypeName", - "src": "374:4:0", - "typeDescriptions": - { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "visibility": "public" - }, - { - "constant": false, - "functionSelector": "2bb14104", - "id": 38, - "mutability": "mutable", - "name": "myData", - "nameLocation": "423:6:0", - "nodeType": "VariableDeclaration", - "scope": 68, - "src": "410:19:0", - "stateVariable": true, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_bytes_storage", - "typeString": "bytes" - }, - "typeName": - { - "id": 37, - "name": "bytes", - "nodeType": "ElementaryTypeName", - "src": "410:5:0", - "typeDescriptions": - { - "typeIdentifier": "t_bytes_storage_ptr", - "typeString": "bytes" - } - }, - "visibility": "public" - }, - { - "body": - { - "id": 66, - "nodeType": "Block", - "src": "503:195:0", - "statements": - [ - { - "assignments": - [ - 46, - 48 - ], - "declarations": - [ - { - "constant": false, - "id": 46, - "mutability": "mutable", - "name": "success", - "nameLocation": "519:7:0", - "nodeType": "VariableDeclaration", - "scope": 66, - "src": "514:12:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "typeName": - { - "id": 45, - "name": "bool", - "nodeType": "ElementaryTypeName", - "src": "514:4:0", - "typeDescriptions": - { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 48, - "mutability": "mutable", - "name": "data", - "nameLocation": "541:4:0", - "nodeType": "VariableDeclaration", - "scope": 66, - "src": "528:17:0", - "stateVariable": false, - "storageLocation": "memory", - "typeDescriptions": - { - "typeIdentifier": "t_bytes_memory_ptr", - "typeString": "bytes" - }, - "typeName": - { - "id": 47, - "name": "bytes", - "nodeType": "ElementaryTypeName", - "src": "528:5:0", - "typeDescriptions": - { - "typeIdentifier": "t_bytes_storage_ptr", - "typeString": "bytes" - } - }, - "visibility": "internal" - } - ], - "id": 57, - "initialValue": - { - "arguments": - [ - { - "arguments": - [ - { - "hexValue": "736574566172732875696e7432353629", - "id": 53, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "string", - "lValueRequested": false, - "nodeType": "Literal", - "src": "609:18:0", - "typeDescriptions": - { - "typeIdentifier": "t_stringliteral_6466414b2df4a685dcec3eaa0cc18042949f0e7e43c9cb945cbd507ff227de7e", - "typeString": "literal_string \"setVars(uint256)\"" - }, - "value": "setVars(uint256)" - }, - { - "id": 54, - "name": "_num", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 42, - "src": "629:4:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": - { - "argumentTypes": - [ - { - "typeIdentifier": "t_stringliteral_6466414b2df4a685dcec3eaa0cc18042949f0e7e43c9cb945cbd507ff227de7e", - "typeString": "literal_string \"setVars(uint256)\"" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "expression": - { - "id": 51, - "name": "abi", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": -1, - "src": "585:3:0", - "typeDescriptions": - { - "typeIdentifier": "t_magic_abi", - "typeString": "abi" - } - }, - "id": 52, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "memberName": "encodeWithSignature", - "nodeType": "MemberAccess", - "src": "585:23:0", - "typeDescriptions": - { - "typeIdentifier": "t_function_abiencodewithsignature_pure$_t_string_memory_ptr_$returns$_t_bytes_memory_ptr_$", - "typeString": "function (string memory) pure returns (bytes memory)" - } - }, - "id": 55, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "585:49:0", - "tryCall": false, - "typeDescriptions": - { - "typeIdentifier": "t_bytes_memory_ptr", - "typeString": "bytes memory" - } - } - ], - "expression": - { - "argumentTypes": - [ - { - "typeIdentifier": "t_bytes_memory_ptr", - "typeString": "bytes memory" - } - ], - "expression": - { - "id": 49, - "name": "_contract", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 40, - "src": "549:9:0", - "typeDescriptions": - { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "id": 50, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "delegatecall", - "nodeType": "MemberAccess", - "src": "549:22:0", - "typeDescriptions": - { - "typeIdentifier": "t_function_baredelegatecall_nonpayable$_t_bytes_memory_ptr_$returns$_t_bool_$_t_bytes_memory_ptr_$", - "typeString": "function (bytes memory) returns (bool,bytes memory)" - } - }, - "id": 56, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "549:95:0", - "tryCall": false, - "typeDescriptions": - { - "typeIdentifier": "t_tuple$_t_bool_$_t_bytes_memory_ptr_$", - "typeString": "tuple(bool,bytes memory)" - } - }, - "nodeType": "VariableDeclarationStatement", - "src": "513:131:0" - }, - { - "expression": - { - "id": 60, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": - { - "id": 58, - "name": "delegateSuccessful", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 36, - "src": "647:18:0", - "typeDescriptions": - { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": - { - "id": 59, - "name": "success", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 46, - "src": "668:7:0", - "typeDescriptions": - { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "src": "647:28:0", - "typeDescriptions": - { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "id": 61, - "nodeType": "ExpressionStatement", - "src": "647:28:0" - }, - { - "expression": - { - "id": 64, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": - { - "id": 62, - "name": "myData", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 38, - "src": "678:6:0", - "typeDescriptions": - { - "typeIdentifier": "t_bytes_storage", - "typeString": "bytes storage ref" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": - { - "id": 63, - "name": "data", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 48, - "src": "687:4:0", - "typeDescriptions": - { - "typeIdentifier": "t_bytes_memory_ptr", - "typeString": "bytes memory" - } - }, - "src": "678:13:0", - "typeDescriptions": - { - "typeIdentifier": "t_bytes_storage", - "typeString": "bytes storage ref" - } - }, - "id": 65, - "nodeType": "ExpressionStatement", - "src": "678:13:0" - } - ] - }, - "functionSelector": "d1e0f308", - "id": 67, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "setVars", - "nameLocation": "450:7:0", - "nodeType": "FunctionDefinition", - "parameters": - { - "id": 43, - "nodeType": "ParameterList", - "parameters": - [ - { - "constant": false, - "id": 40, - "mutability": "mutable", - "name": "_contract", - "nameLocation": "466:9:0", - "nodeType": "VariableDeclaration", - "scope": 67, - "src": "458:17:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": - { - "id": 39, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "458:7:0", - "stateMutability": "nonpayable", - "typeDescriptions": - { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 42, - "mutability": "mutable", - "name": "_num", - "nameLocation": "482:4:0", - "nodeType": "VariableDeclaration", - "scope": 67, - "src": "477:9:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": - { - "id": 41, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "477:4:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - } - ], - "src": "457:30:0" - }, - "returnParameters": - { - "id": 44, - "nodeType": "ParameterList", - "parameters": [], - "src": "503:0:0" - }, - "scope": 68, - "src": "441:257:0", - "stateMutability": "payable", - "virtual": false, - "visibility": "public" - } - ], - "scope": 69, - "src": "286:414:0", - "usedErrors": [] - } - ], - "src": "41:660:0" -} \ No newline at end of file diff --git a/resources/regressions/all.json/input_json/ElimDelegateMutation.sol_json.ast.json b/resources/regressions/all.json/input_json/ElimDelegateMutation.sol_json.ast.json deleted file mode 100644 index c75ab1a..0000000 --- a/resources/regressions/all.json/input_json/ElimDelegateMutation.sol_json.ast.json +++ /dev/null @@ -1,997 +0,0 @@ -{ - "absolutePath": "benchmarks/ElimDelegateMutation/ElimDelegateMutation.sol", - "exportedSymbols": - { - "A": - [ - 68 - ], - "B": - [ - 28 - ] - }, - "id": 69, - "license": "GPL-3.0-only", - "nodeType": "SourceUnit", - "nodes": - [ - { - "id": 1, - "literals": - [ - "solidity", - "^", - "0.8", - ".13" - ], - "nodeType": "PragmaDirective", - "src": "41:24:0" - }, - { - "abstract": false, - "baseContracts": [], - "canonicalName": "B", - "contractDependencies": [], - "contractKind": "contract", - "fullyImplemented": true, - "id": 28, - "linearizedBaseContracts": - [ - 28 - ], - "name": "B", - "nameLocation": "76:1:0", - "nodeType": "ContractDefinition", - "nodes": - [ - { - "constant": false, - "functionSelector": "4e70b1dc", - "id": 3, - "mutability": "mutable", - "name": "num", - "nameLocation": "96:3:0", - "nodeType": "VariableDeclaration", - "scope": 28, - "src": "84:15:0", - "stateVariable": true, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": - { - "id": 2, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "84:4:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "public" - }, - { - "constant": false, - "functionSelector": "67e404ce", - "id": 5, - "mutability": "mutable", - "name": "sender", - "nameLocation": "120:6:0", - "nodeType": "VariableDeclaration", - "scope": 28, - "src": "105:21:0", - "stateVariable": true, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": - { - "id": 4, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "105:7:0", - "stateMutability": "nonpayable", - "typeDescriptions": - { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "visibility": "public" - }, - { - "constant": false, - "functionSelector": "3fa4f245", - "id": 7, - "mutability": "mutable", - "name": "value", - "nameLocation": "144:5:0", - "nodeType": "VariableDeclaration", - "scope": 28, - "src": "132:17:0", - "stateVariable": true, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": - { - "id": 6, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "132:4:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "public" - }, - { - "body": - { - "id": 26, - "nodeType": "Block", - "src": "199:83:0", - "statements": - [ - { - "expression": - { - "id": 14, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": - { - "id": 12, - "name": "num", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 3, - "src": "209:3:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": - { - "id": 13, - "name": "_num", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 9, - "src": "215:4:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "209:10:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 15, - "nodeType": "ExpressionStatement", - "src": "209:10:0" - }, - { - "expression": - { - "id": 19, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": - { - "id": 16, - "name": "sender", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 5, - "src": "229:6:0", - "typeDescriptions": - { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": - { - "expression": - { - "id": 17, - "name": "msg", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": -15, - "src": "238:3:0", - "typeDescriptions": - { - "typeIdentifier": "t_magic_message", - "typeString": "msg" - } - }, - "id": 18, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "sender", - "nodeType": "MemberAccess", - "src": "238:10:0", - "typeDescriptions": - { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "src": "229:19:0", - "typeDescriptions": - { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "id": 20, - "nodeType": "ExpressionStatement", - "src": "229:19:0" - }, - { - "expression": - { - "id": 24, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": - { - "id": 21, - "name": "value", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 7, - "src": "258:5:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": - { - "expression": - { - "id": 22, - "name": "msg", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": -15, - "src": "266:3:0", - "typeDescriptions": - { - "typeIdentifier": "t_magic_message", - "typeString": "msg" - } - }, - "id": 23, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "value", - "nodeType": "MemberAccess", - "src": "266:9:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "258:17:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 25, - "nodeType": "ExpressionStatement", - "src": "258:17:0" - } - ] - }, - "functionSelector": "6466414b", - "id": 27, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "setVars", - "nameLocation": "165:7:0", - "nodeType": "FunctionDefinition", - "parameters": - { - "id": 10, - "nodeType": "ParameterList", - "parameters": - [ - { - "constant": false, - "id": 9, - "mutability": "mutable", - "name": "_num", - "nameLocation": "178:4:0", - "nodeType": "VariableDeclaration", - "scope": 27, - "src": "173:9:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": - { - "id": 8, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "173:4:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - } - ], - "src": "172:11:0" - }, - "returnParameters": - { - "id": 11, - "nodeType": "ParameterList", - "parameters": [], - "src": "199:0:0" - }, - "scope": 28, - "src": "156:126:0", - "stateMutability": "payable", - "virtual": false, - "visibility": "public" - } - ], - "scope": 69, - "src": "67:217:0", - "usedErrors": [] - }, - { - "abstract": false, - "baseContracts": [], - "canonicalName": "A", - "contractDependencies": [], - "contractKind": "contract", - "fullyImplemented": true, - "id": 68, - "linearizedBaseContracts": - [ - 68 - ], - "name": "A", - "nameLocation": "295:1:0", - "nodeType": "ContractDefinition", - "nodes": - [ - { - "constant": false, - "functionSelector": "4e70b1dc", - "id": 30, - "mutability": "mutable", - "name": "num", - "nameLocation": "315:3:0", - "nodeType": "VariableDeclaration", - "scope": 68, - "src": "303:15:0", - "stateVariable": true, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": - { - "id": 29, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "303:4:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "public" - }, - { - "constant": false, - "functionSelector": "67e404ce", - "id": 32, - "mutability": "mutable", - "name": "sender", - "nameLocation": "339:6:0", - "nodeType": "VariableDeclaration", - "scope": 68, - "src": "324:21:0", - "stateVariable": true, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": - { - "id": 31, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "324:7:0", - "stateMutability": "nonpayable", - "typeDescriptions": - { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "visibility": "public" - }, - { - "constant": false, - "functionSelector": "3fa4f245", - "id": 34, - "mutability": "mutable", - "name": "value", - "nameLocation": "363:5:0", - "nodeType": "VariableDeclaration", - "scope": 68, - "src": "351:17:0", - "stateVariable": true, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": - { - "id": 33, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "351:4:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "public" - }, - { - "constant": false, - "functionSelector": "f95ec93b", - "id": 36, - "mutability": "mutable", - "name": "delegateSuccessful", - "nameLocation": "386:18:0", - "nodeType": "VariableDeclaration", - "scope": 68, - "src": "374:30:0", - "stateVariable": true, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "typeName": - { - "id": 35, - "name": "bool", - "nodeType": "ElementaryTypeName", - "src": "374:4:0", - "typeDescriptions": - { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "visibility": "public" - }, - { - "constant": false, - "functionSelector": "2bb14104", - "id": 38, - "mutability": "mutable", - "name": "myData", - "nameLocation": "423:6:0", - "nodeType": "VariableDeclaration", - "scope": 68, - "src": "410:19:0", - "stateVariable": true, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_bytes_storage", - "typeString": "bytes" - }, - "typeName": - { - "id": 37, - "name": "bytes", - "nodeType": "ElementaryTypeName", - "src": "410:5:0", - "typeDescriptions": - { - "typeIdentifier": "t_bytes_storage_ptr", - "typeString": "bytes" - } - }, - "visibility": "public" - }, - { - "body": - { - "id": 66, - "nodeType": "Block", - "src": "503:195:0", - "statements": - [ - { - "assignments": - [ - 46, - 48 - ], - "declarations": - [ - { - "constant": false, - "id": 46, - "mutability": "mutable", - "name": "success", - "nameLocation": "519:7:0", - "nodeType": "VariableDeclaration", - "scope": 66, - "src": "514:12:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "typeName": - { - "id": 45, - "name": "bool", - "nodeType": "ElementaryTypeName", - "src": "514:4:0", - "typeDescriptions": - { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 48, - "mutability": "mutable", - "name": "data", - "nameLocation": "541:4:0", - "nodeType": "VariableDeclaration", - "scope": 66, - "src": "528:17:0", - "stateVariable": false, - "storageLocation": "memory", - "typeDescriptions": - { - "typeIdentifier": "t_bytes_memory_ptr", - "typeString": "bytes" - }, - "typeName": - { - "id": 47, - "name": "bytes", - "nodeType": "ElementaryTypeName", - "src": "528:5:0", - "typeDescriptions": - { - "typeIdentifier": "t_bytes_storage_ptr", - "typeString": "bytes" - } - }, - "visibility": "internal" - } - ], - "id": 57, - "initialValue": - { - "arguments": - [ - { - "arguments": - [ - { - "hexValue": "736574566172732875696e7432353629", - "id": 53, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "string", - "lValueRequested": false, - "nodeType": "Literal", - "src": "609:18:0", - "typeDescriptions": - { - "typeIdentifier": "t_stringliteral_6466414b2df4a685dcec3eaa0cc18042949f0e7e43c9cb945cbd507ff227de7e", - "typeString": "literal_string \"setVars(uint256)\"" - }, - "value": "setVars(uint256)" - }, - { - "id": 54, - "name": "_num", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 42, - "src": "629:4:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": - { - "argumentTypes": - [ - { - "typeIdentifier": "t_stringliteral_6466414b2df4a685dcec3eaa0cc18042949f0e7e43c9cb945cbd507ff227de7e", - "typeString": "literal_string \"setVars(uint256)\"" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "expression": - { - "id": 51, - "name": "abi", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": -1, - "src": "585:3:0", - "typeDescriptions": - { - "typeIdentifier": "t_magic_abi", - "typeString": "abi" - } - }, - "id": 52, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "memberName": "encodeWithSignature", - "nodeType": "MemberAccess", - "src": "585:23:0", - "typeDescriptions": - { - "typeIdentifier": "t_function_abiencodewithsignature_pure$_t_string_memory_ptr_$returns$_t_bytes_memory_ptr_$", - "typeString": "function (string memory) pure returns (bytes memory)" - } - }, - "id": 55, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "585:49:0", - "tryCall": false, - "typeDescriptions": - { - "typeIdentifier": "t_bytes_memory_ptr", - "typeString": "bytes memory" - } - } - ], - "expression": - { - "argumentTypes": - [ - { - "typeIdentifier": "t_bytes_memory_ptr", - "typeString": "bytes memory" - } - ], - "expression": - { - "id": 49, - "name": "_contract", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 40, - "src": "549:9:0", - "typeDescriptions": - { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "id": 50, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "delegatecall", - "nodeType": "MemberAccess", - "src": "549:22:0", - "typeDescriptions": - { - "typeIdentifier": "t_function_baredelegatecall_nonpayable$_t_bytes_memory_ptr_$returns$_t_bool_$_t_bytes_memory_ptr_$", - "typeString": "function (bytes memory) returns (bool,bytes memory)" - } - }, - "id": 56, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "549:95:0", - "tryCall": false, - "typeDescriptions": - { - "typeIdentifier": "t_tuple$_t_bool_$_t_bytes_memory_ptr_$", - "typeString": "tuple(bool,bytes memory)" - } - }, - "nodeType": "VariableDeclarationStatement", - "src": "513:131:0" - }, - { - "expression": - { - "id": 60, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": - { - "id": 58, - "name": "delegateSuccessful", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 36, - "src": "647:18:0", - "typeDescriptions": - { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": - { - "id": 59, - "name": "success", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 46, - "src": "668:7:0", - "typeDescriptions": - { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "src": "647:28:0", - "typeDescriptions": - { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "id": 61, - "nodeType": "ExpressionStatement", - "src": "647:28:0" - }, - { - "expression": - { - "id": 64, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": - { - "id": 62, - "name": "myData", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 38, - "src": "678:6:0", - "typeDescriptions": - { - "typeIdentifier": "t_bytes_storage", - "typeString": "bytes storage ref" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": - { - "id": 63, - "name": "data", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 48, - "src": "687:4:0", - "typeDescriptions": - { - "typeIdentifier": "t_bytes_memory_ptr", - "typeString": "bytes memory" - } - }, - "src": "678:13:0", - "typeDescriptions": - { - "typeIdentifier": "t_bytes_storage", - "typeString": "bytes storage ref" - } - }, - "id": 65, - "nodeType": "ExpressionStatement", - "src": "678:13:0" - } - ] - }, - "functionSelector": "d1e0f308", - "id": 67, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "setVars", - "nameLocation": "450:7:0", - "nodeType": "FunctionDefinition", - "parameters": - { - "id": 43, - "nodeType": "ParameterList", - "parameters": - [ - { - "constant": false, - "id": 40, - "mutability": "mutable", - "name": "_contract", - "nameLocation": "466:9:0", - "nodeType": "VariableDeclaration", - "scope": 67, - "src": "458:17:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": - { - "id": 39, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "458:7:0", - "stateMutability": "nonpayable", - "typeDescriptions": - { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 42, - "mutability": "mutable", - "name": "_num", - "nameLocation": "482:4:0", - "nodeType": "VariableDeclaration", - "scope": 67, - "src": "477:9:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": - { - "id": 41, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "477:4:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - } - ], - "src": "457:30:0" - }, - "returnParameters": - { - "id": 44, - "nodeType": "ParameterList", - "parameters": [], - "src": "503:0:0" - }, - "scope": 68, - "src": "441:257:0", - "stateMutability": "payable", - "virtual": false, - "visibility": "public" - } - ], - "scope": 69, - "src": "286:414:0", - "usedErrors": [] - } - ], - "src": "41:660:0" -} \ No newline at end of file diff --git a/resources/regressions/all.json/input_json/FunctionCallMutation.sol_json.ast b/resources/regressions/all.json/input_json/FunctionCallMutation.sol_json.ast deleted file mode 100644 index 6a02251..0000000 --- a/resources/regressions/all.json/input_json/FunctionCallMutation.sol_json.ast +++ /dev/null @@ -1,458 +0,0 @@ -{ - "absolutePath": "benchmarks/FunctionCallMutation/FunctionCallMutation.sol", - "exportedSymbols": - { - "FunctionCallMutation": - [ - 32 - ] - }, - "id": 33, - "license": "GPL-3.0-only", - "nodeType": "SourceUnit", - "nodes": - [ - { - "id": 1, - "literals": - [ - "solidity", - ">", - "0.7", - ".0" - ], - "nodeType": "PragmaDirective", - "src": "41:23:0" - }, - { - "id": 2, - "literals": - [ - "experimental", - "ABIEncoderV2" - ], - "nodeType": "PragmaDirective", - "src": "65:33:0" - }, - { - "abstract": false, - "baseContracts": [], - "canonicalName": "FunctionCallMutation", - "contractDependencies": [], - "contractKind": "contract", - "fullyImplemented": true, - "id": 32, - "linearizedBaseContracts": - [ - 32 - ], - "name": "FunctionCallMutation", - "nameLocation": "109:20:0", - "nodeType": "ContractDefinition", - "nodes": - [ - { - "body": - { - "id": 15, - "nodeType": "Block", - "src": "208:22:0", - "statements": - [ - { - "expression": - { - "commonType": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 13, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": - { - "id": 11, - "name": "x", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4, - "src": "218:1:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "+", - "rightExpression": - { - "id": 12, - "name": "y", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 6, - "src": "222:1:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "218:5:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "functionReturnParameters": 10, - "id": 14, - "nodeType": "Return", - "src": "211:12:0" - } - ] - }, - "functionSelector": "04b53fe4", - "id": 16, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "myAddition", - "nameLocation": "145:10:0", - "nodeType": "FunctionDefinition", - "parameters": - { - "id": 7, - "nodeType": "ParameterList", - "parameters": - [ - { - "constant": false, - "id": 4, - "mutability": "mutable", - "name": "x", - "nameLocation": "164:1:0", - "nodeType": "VariableDeclaration", - "scope": 16, - "src": "156:9:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": - { - "id": 3, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "156:7:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 6, - "mutability": "mutable", - "name": "y", - "nameLocation": "175:1:0", - "nodeType": "VariableDeclaration", - "scope": 16, - "src": "167:9:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": - { - "id": 5, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "167:7:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - } - ], - "src": "155:22:0" - }, - "returnParameters": - { - "id": 10, - "nodeType": "ParameterList", - "parameters": - [ - { - "constant": false, - "id": 9, - "mutability": "mutable", - "name": "", - "nameLocation": "-1:-1:-1", - "nodeType": "VariableDeclaration", - "scope": 16, - "src": "199:7:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": - { - "id": 8, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "199:7:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - } - ], - "src": "198:9:0" - }, - "scope": 32, - "src": "136:94:0", - "stateMutability": "pure", - "virtual": false, - "visibility": "public" - }, - { - "body": - { - "id": 30, - "nodeType": "Block", - "src": "313:33:0", - "statements": - [ - { - "expression": - { - "arguments": - [ - { - "id": 26, - "name": "x", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 18, - "src": "334:1:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - { - "id": 27, - "name": "y", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 20, - "src": "337:1:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": - { - "argumentTypes": - [ - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "id": 25, - "name": "myAddition", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 16, - "src": "323:10:0", - "typeDescriptions": - { - "typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$", - "typeString": "function (uint256,uint256) pure returns (uint256)" - } - }, - "id": 28, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "323:16:0", - "tryCall": false, - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "functionReturnParameters": 24, - "id": 29, - "nodeType": "Return", - "src": "316:23:0" - } - ] - }, - "functionSelector": "65cac823", - "id": 31, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "myOtherAddition", - "nameLocation": "245:15:0", - "nodeType": "FunctionDefinition", - "parameters": - { - "id": 21, - "nodeType": "ParameterList", - "parameters": - [ - { - "constant": false, - "id": 18, - "mutability": "mutable", - "name": "x", - "nameLocation": "269:1:0", - "nodeType": "VariableDeclaration", - "scope": 31, - "src": "261:9:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": - { - "id": 17, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "261:7:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 20, - "mutability": "mutable", - "name": "y", - "nameLocation": "280:1:0", - "nodeType": "VariableDeclaration", - "scope": 31, - "src": "272:9:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": - { - "id": 19, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "272:7:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - } - ], - "src": "260:22:0" - }, - "returnParameters": - { - "id": 24, - "nodeType": "ParameterList", - "parameters": - [ - { - "constant": false, - "id": 23, - "mutability": "mutable", - "name": "", - "nameLocation": "-1:-1:-1", - "nodeType": "VariableDeclaration", - "scope": 31, - "src": "304:7:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": - { - "id": 22, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "304:7:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - } - ], - "src": "303:9:0" - }, - "scope": 32, - "src": "236:110:0", - "stateMutability": "pure", - "virtual": false, - "visibility": "public" - } - ], - "scope": 33, - "src": "100:248:0", - "usedErrors": [] - } - ], - "src": "41:308:0" -} \ No newline at end of file diff --git a/resources/regressions/all.json/input_json/FunctionCallMutation.sol_json.ast.json b/resources/regressions/all.json/input_json/FunctionCallMutation.sol_json.ast.json deleted file mode 100644 index 6a02251..0000000 --- a/resources/regressions/all.json/input_json/FunctionCallMutation.sol_json.ast.json +++ /dev/null @@ -1,458 +0,0 @@ -{ - "absolutePath": "benchmarks/FunctionCallMutation/FunctionCallMutation.sol", - "exportedSymbols": - { - "FunctionCallMutation": - [ - 32 - ] - }, - "id": 33, - "license": "GPL-3.0-only", - "nodeType": "SourceUnit", - "nodes": - [ - { - "id": 1, - "literals": - [ - "solidity", - ">", - "0.7", - ".0" - ], - "nodeType": "PragmaDirective", - "src": "41:23:0" - }, - { - "id": 2, - "literals": - [ - "experimental", - "ABIEncoderV2" - ], - "nodeType": "PragmaDirective", - "src": "65:33:0" - }, - { - "abstract": false, - "baseContracts": [], - "canonicalName": "FunctionCallMutation", - "contractDependencies": [], - "contractKind": "contract", - "fullyImplemented": true, - "id": 32, - "linearizedBaseContracts": - [ - 32 - ], - "name": "FunctionCallMutation", - "nameLocation": "109:20:0", - "nodeType": "ContractDefinition", - "nodes": - [ - { - "body": - { - "id": 15, - "nodeType": "Block", - "src": "208:22:0", - "statements": - [ - { - "expression": - { - "commonType": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 13, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": - { - "id": 11, - "name": "x", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4, - "src": "218:1:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "+", - "rightExpression": - { - "id": 12, - "name": "y", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 6, - "src": "222:1:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "218:5:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "functionReturnParameters": 10, - "id": 14, - "nodeType": "Return", - "src": "211:12:0" - } - ] - }, - "functionSelector": "04b53fe4", - "id": 16, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "myAddition", - "nameLocation": "145:10:0", - "nodeType": "FunctionDefinition", - "parameters": - { - "id": 7, - "nodeType": "ParameterList", - "parameters": - [ - { - "constant": false, - "id": 4, - "mutability": "mutable", - "name": "x", - "nameLocation": "164:1:0", - "nodeType": "VariableDeclaration", - "scope": 16, - "src": "156:9:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": - { - "id": 3, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "156:7:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 6, - "mutability": "mutable", - "name": "y", - "nameLocation": "175:1:0", - "nodeType": "VariableDeclaration", - "scope": 16, - "src": "167:9:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": - { - "id": 5, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "167:7:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - } - ], - "src": "155:22:0" - }, - "returnParameters": - { - "id": 10, - "nodeType": "ParameterList", - "parameters": - [ - { - "constant": false, - "id": 9, - "mutability": "mutable", - "name": "", - "nameLocation": "-1:-1:-1", - "nodeType": "VariableDeclaration", - "scope": 16, - "src": "199:7:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": - { - "id": 8, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "199:7:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - } - ], - "src": "198:9:0" - }, - "scope": 32, - "src": "136:94:0", - "stateMutability": "pure", - "virtual": false, - "visibility": "public" - }, - { - "body": - { - "id": 30, - "nodeType": "Block", - "src": "313:33:0", - "statements": - [ - { - "expression": - { - "arguments": - [ - { - "id": 26, - "name": "x", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 18, - "src": "334:1:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - { - "id": 27, - "name": "y", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 20, - "src": "337:1:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": - { - "argumentTypes": - [ - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "id": 25, - "name": "myAddition", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 16, - "src": "323:10:0", - "typeDescriptions": - { - "typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$", - "typeString": "function (uint256,uint256) pure returns (uint256)" - } - }, - "id": 28, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "323:16:0", - "tryCall": false, - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "functionReturnParameters": 24, - "id": 29, - "nodeType": "Return", - "src": "316:23:0" - } - ] - }, - "functionSelector": "65cac823", - "id": 31, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "myOtherAddition", - "nameLocation": "245:15:0", - "nodeType": "FunctionDefinition", - "parameters": - { - "id": 21, - "nodeType": "ParameterList", - "parameters": - [ - { - "constant": false, - "id": 18, - "mutability": "mutable", - "name": "x", - "nameLocation": "269:1:0", - "nodeType": "VariableDeclaration", - "scope": 31, - "src": "261:9:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": - { - "id": 17, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "261:7:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 20, - "mutability": "mutable", - "name": "y", - "nameLocation": "280:1:0", - "nodeType": "VariableDeclaration", - "scope": 31, - "src": "272:9:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": - { - "id": 19, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "272:7:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - } - ], - "src": "260:22:0" - }, - "returnParameters": - { - "id": 24, - "nodeType": "ParameterList", - "parameters": - [ - { - "constant": false, - "id": 23, - "mutability": "mutable", - "name": "", - "nameLocation": "-1:-1:-1", - "nodeType": "VariableDeclaration", - "scope": 31, - "src": "304:7:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": - { - "id": 22, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "304:7:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - } - ], - "src": "303:9:0" - }, - "scope": 32, - "src": "236:110:0", - "stateMutability": "pure", - "virtual": false, - "visibility": "public" - } - ], - "scope": 33, - "src": "100:248:0", - "usedErrors": [] - } - ], - "src": "41:308:0" -} \ No newline at end of file diff --git a/resources/regressions/all.json/input_json/IfStatementMutation.sol_json.ast b/resources/regressions/all.json/input_json/IfStatementMutation.sol_json.ast deleted file mode 100644 index 5f60683..0000000 --- a/resources/regressions/all.json/input_json/IfStatementMutation.sol_json.ast +++ /dev/null @@ -1,248 +0,0 @@ -{ - "absolutePath": "benchmarks/IfStatementMutation/IfStatementMutation.sol", - "exportedSymbols": - { - "IfStatementMutation": - [ - 19 - ] - }, - "id": 20, - "license": "GPL-3.0-only", - "nodeType": "SourceUnit", - "nodes": - [ - { - "id": 1, - "literals": - [ - "solidity", - ">", - "0.7", - ".0" - ], - "nodeType": "PragmaDirective", - "src": "41:23:0" - }, - { - "id": 2, - "literals": - [ - "experimental", - "ABIEncoderV2" - ], - "nodeType": "PragmaDirective", - "src": "65:33:0" - }, - { - "abstract": false, - "baseContracts": [], - "canonicalName": "IfStatementMutation", - "contractDependencies": [], - "contractKind": "contract", - "fullyImplemented": true, - "id": 19, - "linearizedBaseContracts": - [ - 19 - ], - "name": "IfStatementMutation", - "nameLocation": "109:19:0", - "nodeType": "ContractDefinition", - "nodes": - [ - { - "body": - { - "id": 17, - "nodeType": "Block", - "src": "197:68:0", - "statements": - [ - { - "condition": - { - "id": 9, - "name": "a", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4, - "src": "204:1:0", - "typeDescriptions": - { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "falseBody": - { - "id": 15, - "nodeType": "Block", - "src": "236:23:0", - "statements": - [ - { - "expression": - { - "hexValue": "66616c7365", - "id": 13, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "bool", - "lValueRequested": false, - "nodeType": "Literal", - "src": "250:5:0", - "typeDescriptions": - { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "value": "false" - }, - "functionReturnParameters": 8, - "id": 14, - "nodeType": "Return", - "src": "243:12:0" - } - ] - }, - "id": 16, - "nodeType": "IfStatement", - "src": "200:59:0", - "trueBody": - { - "id": 12, - "nodeType": "Block", - "src": "207:22:0", - "statements": - [ - { - "expression": - { - "hexValue": "74727565", - "id": 10, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "bool", - "lValueRequested": false, - "nodeType": "Literal", - "src": "221:4:0", - "typeDescriptions": - { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "value": "true" - }, - "functionReturnParameters": 8, - "id": 11, - "nodeType": "Return", - "src": "214:11:0" - } - ] - } - } - ] - }, - "functionSelector": "ef5a890e", - "id": 18, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "myBooleanNegation", - "nameLocation": "144:17:0", - "nodeType": "FunctionDefinition", - "parameters": - { - "id": 5, - "nodeType": "ParameterList", - "parameters": - [ - { - "constant": false, - "id": 4, - "mutability": "mutable", - "name": "a", - "nameLocation": "167:1:0", - "nodeType": "VariableDeclaration", - "scope": 18, - "src": "162:6:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "typeName": - { - "id": 3, - "name": "bool", - "nodeType": "ElementaryTypeName", - "src": "162:4:0", - "typeDescriptions": - { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "visibility": "internal" - } - ], - "src": "161:8:0" - }, - "returnParameters": - { - "id": 8, - "nodeType": "ParameterList", - "parameters": - [ - { - "constant": false, - "id": 7, - "mutability": "mutable", - "name": "", - "nameLocation": "-1:-1:-1", - "nodeType": "VariableDeclaration", - "scope": 18, - "src": "191:4:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "typeName": - { - "id": 6, - "name": "bool", - "nodeType": "ElementaryTypeName", - "src": "191:4:0", - "typeDescriptions": - { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "visibility": "internal" - } - ], - "src": "190:6:0" - }, - "scope": 19, - "src": "135:130:0", - "stateMutability": "pure", - "virtual": false, - "visibility": "public" - } - ], - "scope": 20, - "src": "100:167:0", - "usedErrors": [] - } - ], - "src": "41:227:0" -} \ No newline at end of file diff --git a/resources/regressions/all.json/input_json/IfStatementMutation.sol_json.ast.json b/resources/regressions/all.json/input_json/IfStatementMutation.sol_json.ast.json deleted file mode 100644 index 5f60683..0000000 --- a/resources/regressions/all.json/input_json/IfStatementMutation.sol_json.ast.json +++ /dev/null @@ -1,248 +0,0 @@ -{ - "absolutePath": "benchmarks/IfStatementMutation/IfStatementMutation.sol", - "exportedSymbols": - { - "IfStatementMutation": - [ - 19 - ] - }, - "id": 20, - "license": "GPL-3.0-only", - "nodeType": "SourceUnit", - "nodes": - [ - { - "id": 1, - "literals": - [ - "solidity", - ">", - "0.7", - ".0" - ], - "nodeType": "PragmaDirective", - "src": "41:23:0" - }, - { - "id": 2, - "literals": - [ - "experimental", - "ABIEncoderV2" - ], - "nodeType": "PragmaDirective", - "src": "65:33:0" - }, - { - "abstract": false, - "baseContracts": [], - "canonicalName": "IfStatementMutation", - "contractDependencies": [], - "contractKind": "contract", - "fullyImplemented": true, - "id": 19, - "linearizedBaseContracts": - [ - 19 - ], - "name": "IfStatementMutation", - "nameLocation": "109:19:0", - "nodeType": "ContractDefinition", - "nodes": - [ - { - "body": - { - "id": 17, - "nodeType": "Block", - "src": "197:68:0", - "statements": - [ - { - "condition": - { - "id": 9, - "name": "a", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4, - "src": "204:1:0", - "typeDescriptions": - { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "falseBody": - { - "id": 15, - "nodeType": "Block", - "src": "236:23:0", - "statements": - [ - { - "expression": - { - "hexValue": "66616c7365", - "id": 13, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "bool", - "lValueRequested": false, - "nodeType": "Literal", - "src": "250:5:0", - "typeDescriptions": - { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "value": "false" - }, - "functionReturnParameters": 8, - "id": 14, - "nodeType": "Return", - "src": "243:12:0" - } - ] - }, - "id": 16, - "nodeType": "IfStatement", - "src": "200:59:0", - "trueBody": - { - "id": 12, - "nodeType": "Block", - "src": "207:22:0", - "statements": - [ - { - "expression": - { - "hexValue": "74727565", - "id": 10, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "bool", - "lValueRequested": false, - "nodeType": "Literal", - "src": "221:4:0", - "typeDescriptions": - { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "value": "true" - }, - "functionReturnParameters": 8, - "id": 11, - "nodeType": "Return", - "src": "214:11:0" - } - ] - } - } - ] - }, - "functionSelector": "ef5a890e", - "id": 18, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "myBooleanNegation", - "nameLocation": "144:17:0", - "nodeType": "FunctionDefinition", - "parameters": - { - "id": 5, - "nodeType": "ParameterList", - "parameters": - [ - { - "constant": false, - "id": 4, - "mutability": "mutable", - "name": "a", - "nameLocation": "167:1:0", - "nodeType": "VariableDeclaration", - "scope": 18, - "src": "162:6:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "typeName": - { - "id": 3, - "name": "bool", - "nodeType": "ElementaryTypeName", - "src": "162:4:0", - "typeDescriptions": - { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "visibility": "internal" - } - ], - "src": "161:8:0" - }, - "returnParameters": - { - "id": 8, - "nodeType": "ParameterList", - "parameters": - [ - { - "constant": false, - "id": 7, - "mutability": "mutable", - "name": "", - "nameLocation": "-1:-1:-1", - "nodeType": "VariableDeclaration", - "scope": 18, - "src": "191:4:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "typeName": - { - "id": 6, - "name": "bool", - "nodeType": "ElementaryTypeName", - "src": "191:4:0", - "typeDescriptions": - { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "visibility": "internal" - } - ], - "src": "190:6:0" - }, - "scope": 19, - "src": "135:130:0", - "stateMutability": "pure", - "virtual": false, - "visibility": "public" - } - ], - "scope": 20, - "src": "100:167:0", - "usedErrors": [] - } - ], - "src": "41:227:0" -} \ No newline at end of file diff --git a/resources/regressions/all.json/input_json/RequireMutation.sol_json.ast b/resources/regressions/all.json/input_json/RequireMutation.sol_json.ast deleted file mode 100644 index 77ac2d6..0000000 --- a/resources/regressions/all.json/input_json/RequireMutation.sol_json.ast +++ /dev/null @@ -1,439 +0,0 @@ -{ - "absolutePath": "benchmarks/RequireMutation/RequireMutation.sol", - "exportedSymbols": - { - "RequireMutation": - [ - 29 - ] - }, - "id": 30, - "license": "GPL-3.0-only", - "nodeType": "SourceUnit", - "nodes": - [ - { - "id": 1, - "literals": - [ - "solidity", - ">", - "0.7", - ".0" - ], - "nodeType": "PragmaDirective", - "src": "41:23:0" - }, - { - "id": 2, - "literals": - [ - "experimental", - "ABIEncoderV2" - ], - "nodeType": "PragmaDirective", - "src": "65:33:0" - }, - { - "abstract": false, - "baseContracts": [], - "canonicalName": "RequireMutation", - "contractDependencies": [], - "contractKind": "contract", - "fullyImplemented": true, - "id": 29, - "linearizedBaseContracts": - [ - 29 - ], - "name": "RequireMutation", - "nameLocation": "109:15:0", - "nodeType": "ContractDefinition", - "nodes": - [ - { - "body": - { - "id": 27, - "nodeType": "Block", - "src": "214:72:0", - "statements": - [ - { - "expression": - { - "arguments": - [ - { - "id": 14, - "name": "cond1", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4, - "src": "225:5:0", - "typeDescriptions": - { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - } - ], - "expression": - { - "argumentTypes": - [ - { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - ], - "id": 13, - "name": "require", - "nodeType": "Identifier", - "overloadedDeclarations": - [ - -18, - -18 - ], - "referencedDeclaration": -18, - "src": "217:7:0", - "typeDescriptions": - { - "typeIdentifier": "t_function_require_pure$_t_bool_$returns$__$", - "typeString": "function (bool) pure" - } - }, - "id": 15, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "217:14:0", - "tryCall": false, - "typeDescriptions": - { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 16, - "nodeType": "ExpressionStatement", - "src": "217:14:0" - }, - { - "expression": - { - "arguments": - [ - { - "id": 18, - "name": "cond2", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 6, - "src": "242:5:0", - "typeDescriptions": - { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - } - ], - "expression": - { - "argumentTypes": - [ - { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - ], - "id": 17, - "name": "require", - "nodeType": "Identifier", - "overloadedDeclarations": - [ - -18, - -18 - ], - "referencedDeclaration": -18, - "src": "234:7:0", - "typeDescriptions": - { - "typeIdentifier": "t_function_require_pure$_t_bool_$returns$__$", - "typeString": "function (bool) pure" - } - }, - "id": 19, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "234:14:0", - "tryCall": false, - "typeDescriptions": - { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 20, - "nodeType": "ExpressionStatement", - "src": "234:14:0" - }, - { - "expression": - { - "arguments": - [ - { - "id": 22, - "name": "cond3", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 8, - "src": "259:5:0", - "typeDescriptions": - { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - } - ], - "expression": - { - "argumentTypes": - [ - { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - ], - "id": 21, - "name": "require", - "nodeType": "Identifier", - "overloadedDeclarations": - [ - -18, - -18 - ], - "referencedDeclaration": -18, - "src": "251:7:0", - "typeDescriptions": - { - "typeIdentifier": "t_function_require_pure$_t_bool_$returns$__$", - "typeString": "function (bool) pure" - } - }, - "id": 23, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "251:14:0", - "tryCall": false, - "typeDescriptions": - { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 24, - "nodeType": "ExpressionStatement", - "src": "251:14:0" - }, - { - "expression": - { - "hexValue": "74727565", - "id": 25, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "bool", - "lValueRequested": false, - "nodeType": "Literal", - "src": "275:4:0", - "typeDescriptions": - { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "value": "true" - }, - "functionReturnParameters": 12, - "id": 26, - "nodeType": "Return", - "src": "268:11:0" - } - ] - }, - "functionSelector": "b638e767", - "id": 28, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "myRequires", - "nameLocation": "140:10:0", - "nodeType": "FunctionDefinition", - "parameters": - { - "id": 9, - "nodeType": "ParameterList", - "parameters": - [ - { - "constant": false, - "id": 4, - "mutability": "mutable", - "name": "cond1", - "nameLocation": "156:5:0", - "nodeType": "VariableDeclaration", - "scope": 28, - "src": "151:10:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "typeName": - { - "id": 3, - "name": "bool", - "nodeType": "ElementaryTypeName", - "src": "151:4:0", - "typeDescriptions": - { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 6, - "mutability": "mutable", - "name": "cond2", - "nameLocation": "168:5:0", - "nodeType": "VariableDeclaration", - "scope": 28, - "src": "163:10:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "typeName": - { - "id": 5, - "name": "bool", - "nodeType": "ElementaryTypeName", - "src": "163:4:0", - "typeDescriptions": - { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 8, - "mutability": "mutable", - "name": "cond3", - "nameLocation": "180:5:0", - "nodeType": "VariableDeclaration", - "scope": 28, - "src": "175:10:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "typeName": - { - "id": 7, - "name": "bool", - "nodeType": "ElementaryTypeName", - "src": "175:4:0", - "typeDescriptions": - { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "visibility": "internal" - } - ], - "src": "150:36:0" - }, - "returnParameters": - { - "id": 12, - "nodeType": "ParameterList", - "parameters": - [ - { - "constant": false, - "id": 11, - "mutability": "mutable", - "name": "", - "nameLocation": "-1:-1:-1", - "nodeType": "VariableDeclaration", - "scope": 28, - "src": "208:4:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "typeName": - { - "id": 10, - "name": "bool", - "nodeType": "ElementaryTypeName", - "src": "208:4:0", - "typeDescriptions": - { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "visibility": "internal" - } - ], - "src": "207:6:0" - }, - "scope": 29, - "src": "131:155:0", - "stateMutability": "pure", - "virtual": false, - "visibility": "public" - } - ], - "scope": 30, - "src": "100:188:0", - "usedErrors": [] - } - ], - "src": "41:248:0" -} \ No newline at end of file diff --git a/resources/regressions/all.json/input_json/RequireMutation.sol_json.ast.json b/resources/regressions/all.json/input_json/RequireMutation.sol_json.ast.json deleted file mode 100644 index 77ac2d6..0000000 --- a/resources/regressions/all.json/input_json/RequireMutation.sol_json.ast.json +++ /dev/null @@ -1,439 +0,0 @@ -{ - "absolutePath": "benchmarks/RequireMutation/RequireMutation.sol", - "exportedSymbols": - { - "RequireMutation": - [ - 29 - ] - }, - "id": 30, - "license": "GPL-3.0-only", - "nodeType": "SourceUnit", - "nodes": - [ - { - "id": 1, - "literals": - [ - "solidity", - ">", - "0.7", - ".0" - ], - "nodeType": "PragmaDirective", - "src": "41:23:0" - }, - { - "id": 2, - "literals": - [ - "experimental", - "ABIEncoderV2" - ], - "nodeType": "PragmaDirective", - "src": "65:33:0" - }, - { - "abstract": false, - "baseContracts": [], - "canonicalName": "RequireMutation", - "contractDependencies": [], - "contractKind": "contract", - "fullyImplemented": true, - "id": 29, - "linearizedBaseContracts": - [ - 29 - ], - "name": "RequireMutation", - "nameLocation": "109:15:0", - "nodeType": "ContractDefinition", - "nodes": - [ - { - "body": - { - "id": 27, - "nodeType": "Block", - "src": "214:72:0", - "statements": - [ - { - "expression": - { - "arguments": - [ - { - "id": 14, - "name": "cond1", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4, - "src": "225:5:0", - "typeDescriptions": - { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - } - ], - "expression": - { - "argumentTypes": - [ - { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - ], - "id": 13, - "name": "require", - "nodeType": "Identifier", - "overloadedDeclarations": - [ - -18, - -18 - ], - "referencedDeclaration": -18, - "src": "217:7:0", - "typeDescriptions": - { - "typeIdentifier": "t_function_require_pure$_t_bool_$returns$__$", - "typeString": "function (bool) pure" - } - }, - "id": 15, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "217:14:0", - "tryCall": false, - "typeDescriptions": - { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 16, - "nodeType": "ExpressionStatement", - "src": "217:14:0" - }, - { - "expression": - { - "arguments": - [ - { - "id": 18, - "name": "cond2", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 6, - "src": "242:5:0", - "typeDescriptions": - { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - } - ], - "expression": - { - "argumentTypes": - [ - { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - ], - "id": 17, - "name": "require", - "nodeType": "Identifier", - "overloadedDeclarations": - [ - -18, - -18 - ], - "referencedDeclaration": -18, - "src": "234:7:0", - "typeDescriptions": - { - "typeIdentifier": "t_function_require_pure$_t_bool_$returns$__$", - "typeString": "function (bool) pure" - } - }, - "id": 19, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "234:14:0", - "tryCall": false, - "typeDescriptions": - { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 20, - "nodeType": "ExpressionStatement", - "src": "234:14:0" - }, - { - "expression": - { - "arguments": - [ - { - "id": 22, - "name": "cond3", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 8, - "src": "259:5:0", - "typeDescriptions": - { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - } - ], - "expression": - { - "argumentTypes": - [ - { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - ], - "id": 21, - "name": "require", - "nodeType": "Identifier", - "overloadedDeclarations": - [ - -18, - -18 - ], - "referencedDeclaration": -18, - "src": "251:7:0", - "typeDescriptions": - { - "typeIdentifier": "t_function_require_pure$_t_bool_$returns$__$", - "typeString": "function (bool) pure" - } - }, - "id": 23, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "251:14:0", - "tryCall": false, - "typeDescriptions": - { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 24, - "nodeType": "ExpressionStatement", - "src": "251:14:0" - }, - { - "expression": - { - "hexValue": "74727565", - "id": 25, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "bool", - "lValueRequested": false, - "nodeType": "Literal", - "src": "275:4:0", - "typeDescriptions": - { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "value": "true" - }, - "functionReturnParameters": 12, - "id": 26, - "nodeType": "Return", - "src": "268:11:0" - } - ] - }, - "functionSelector": "b638e767", - "id": 28, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "myRequires", - "nameLocation": "140:10:0", - "nodeType": "FunctionDefinition", - "parameters": - { - "id": 9, - "nodeType": "ParameterList", - "parameters": - [ - { - "constant": false, - "id": 4, - "mutability": "mutable", - "name": "cond1", - "nameLocation": "156:5:0", - "nodeType": "VariableDeclaration", - "scope": 28, - "src": "151:10:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "typeName": - { - "id": 3, - "name": "bool", - "nodeType": "ElementaryTypeName", - "src": "151:4:0", - "typeDescriptions": - { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 6, - "mutability": "mutable", - "name": "cond2", - "nameLocation": "168:5:0", - "nodeType": "VariableDeclaration", - "scope": 28, - "src": "163:10:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "typeName": - { - "id": 5, - "name": "bool", - "nodeType": "ElementaryTypeName", - "src": "163:4:0", - "typeDescriptions": - { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 8, - "mutability": "mutable", - "name": "cond3", - "nameLocation": "180:5:0", - "nodeType": "VariableDeclaration", - "scope": 28, - "src": "175:10:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "typeName": - { - "id": 7, - "name": "bool", - "nodeType": "ElementaryTypeName", - "src": "175:4:0", - "typeDescriptions": - { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "visibility": "internal" - } - ], - "src": "150:36:0" - }, - "returnParameters": - { - "id": 12, - "nodeType": "ParameterList", - "parameters": - [ - { - "constant": false, - "id": 11, - "mutability": "mutable", - "name": "", - "nameLocation": "-1:-1:-1", - "nodeType": "VariableDeclaration", - "scope": 28, - "src": "208:4:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "typeName": - { - "id": 10, - "name": "bool", - "nodeType": "ElementaryTypeName", - "src": "208:4:0", - "typeDescriptions": - { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "visibility": "internal" - } - ], - "src": "207:6:0" - }, - "scope": 29, - "src": "131:155:0", - "stateMutability": "pure", - "virtual": false, - "visibility": "public" - } - ], - "scope": 30, - "src": "100:188:0", - "usedErrors": [] - } - ], - "src": "41:248:0" -} \ No newline at end of file diff --git a/resources/regressions/all.json/input_json/SwapArgumentsFunctionMutation.sol_json.ast b/resources/regressions/all.json/input_json/SwapArgumentsFunctionMutation.sol_json.ast deleted file mode 100644 index 424e74b..0000000 --- a/resources/regressions/all.json/input_json/SwapArgumentsFunctionMutation.sol_json.ast +++ /dev/null @@ -1,458 +0,0 @@ -{ - "absolutePath": "benchmarks/SwapArgumentsFunctionMutation/SwapArgumentsFunctionMutation.sol", - "exportedSymbols": - { - "SwapArgumentsFunctionMutation": - [ - 32 - ] - }, - "id": 33, - "license": "GPL-3.0-only", - "nodeType": "SourceUnit", - "nodes": - [ - { - "id": 1, - "literals": - [ - "solidity", - ">", - "0.7", - ".0" - ], - "nodeType": "PragmaDirective", - "src": "41:23:0" - }, - { - "id": 2, - "literals": - [ - "experimental", - "ABIEncoderV2" - ], - "nodeType": "PragmaDirective", - "src": "65:33:0" - }, - { - "abstract": false, - "baseContracts": [], - "canonicalName": "SwapArgumentsFunctionMutation", - "contractDependencies": [], - "contractKind": "contract", - "fullyImplemented": true, - "id": 32, - "linearizedBaseContracts": - [ - 32 - ], - "name": "SwapArgumentsFunctionMutation", - "nameLocation": "109:29:0", - "nodeType": "ContractDefinition", - "nodes": - [ - { - "body": - { - "id": 15, - "nodeType": "Block", - "src": "211:22:0", - "statements": - [ - { - "expression": - { - "commonType": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 13, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": - { - "id": 11, - "name": "x", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4, - "src": "221:1:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "-", - "rightExpression": - { - "id": 12, - "name": "y", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 6, - "src": "225:1:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "221:5:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "functionReturnParameters": 10, - "id": 14, - "nodeType": "Return", - "src": "214:12:0" - } - ] - }, - "functionSelector": "04bc52f8", - "id": 16, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "foo", - "nameLocation": "155:3:0", - "nodeType": "FunctionDefinition", - "parameters": - { - "id": 7, - "nodeType": "ParameterList", - "parameters": - [ - { - "constant": false, - "id": 4, - "mutability": "mutable", - "name": "x", - "nameLocation": "167:1:0", - "nodeType": "VariableDeclaration", - "scope": 16, - "src": "159:9:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": - { - "id": 3, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "159:7:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 6, - "mutability": "mutable", - "name": "y", - "nameLocation": "178:1:0", - "nodeType": "VariableDeclaration", - "scope": 16, - "src": "170:9:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": - { - "id": 5, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "170:7:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - } - ], - "src": "158:22:0" - }, - "returnParameters": - { - "id": 10, - "nodeType": "ParameterList", - "parameters": - [ - { - "constant": false, - "id": 9, - "mutability": "mutable", - "name": "", - "nameLocation": "-1:-1:-1", - "nodeType": "VariableDeclaration", - "scope": 16, - "src": "202:7:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": - { - "id": 8, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "202:7:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - } - ], - "src": "201:9:0" - }, - "scope": 32, - "src": "146:87:0", - "stateMutability": "pure", - "virtual": false, - "visibility": "public" - }, - { - "body": - { - "id": 30, - "nodeType": "Block", - "src": "304:26:0", - "statements": - [ - { - "expression": - { - "arguments": - [ - { - "id": 26, - "name": "x", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 18, - "src": "318:1:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - { - "id": 27, - "name": "y", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 20, - "src": "321:1:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": - { - "argumentTypes": - [ - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "id": 25, - "name": "foo", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 16, - "src": "314:3:0", - "typeDescriptions": - { - "typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$", - "typeString": "function (uint256,uint256) pure returns (uint256)" - } - }, - "id": 28, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "314:9:0", - "tryCall": false, - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "functionReturnParameters": 24, - "id": 29, - "nodeType": "Return", - "src": "307:16:0" - } - ] - }, - "functionSelector": "ae42e951", - "id": 31, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "bar", - "nameLocation": "248:3:0", - "nodeType": "FunctionDefinition", - "parameters": - { - "id": 21, - "nodeType": "ParameterList", - "parameters": - [ - { - "constant": false, - "id": 18, - "mutability": "mutable", - "name": "x", - "nameLocation": "260:1:0", - "nodeType": "VariableDeclaration", - "scope": 31, - "src": "252:9:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": - { - "id": 17, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "252:7:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 20, - "mutability": "mutable", - "name": "y", - "nameLocation": "271:1:0", - "nodeType": "VariableDeclaration", - "scope": 31, - "src": "263:9:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": - { - "id": 19, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "263:7:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - } - ], - "src": "251:22:0" - }, - "returnParameters": - { - "id": 24, - "nodeType": "ParameterList", - "parameters": - [ - { - "constant": false, - "id": 23, - "mutability": "mutable", - "name": "", - "nameLocation": "-1:-1:-1", - "nodeType": "VariableDeclaration", - "scope": 31, - "src": "295:7:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": - { - "id": 22, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "295:7:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - } - ], - "src": "294:9:0" - }, - "scope": 32, - "src": "239:91:0", - "stateMutability": "pure", - "virtual": false, - "visibility": "public" - } - ], - "scope": 33, - "src": "100:232:0", - "usedErrors": [] - } - ], - "src": "41:292:0" -} \ No newline at end of file diff --git a/resources/regressions/all.json/input_json/SwapArgumentsFunctionMutation.sol_json.ast.json b/resources/regressions/all.json/input_json/SwapArgumentsFunctionMutation.sol_json.ast.json deleted file mode 100644 index 424e74b..0000000 --- a/resources/regressions/all.json/input_json/SwapArgumentsFunctionMutation.sol_json.ast.json +++ /dev/null @@ -1,458 +0,0 @@ -{ - "absolutePath": "benchmarks/SwapArgumentsFunctionMutation/SwapArgumentsFunctionMutation.sol", - "exportedSymbols": - { - "SwapArgumentsFunctionMutation": - [ - 32 - ] - }, - "id": 33, - "license": "GPL-3.0-only", - "nodeType": "SourceUnit", - "nodes": - [ - { - "id": 1, - "literals": - [ - "solidity", - ">", - "0.7", - ".0" - ], - "nodeType": "PragmaDirective", - "src": "41:23:0" - }, - { - "id": 2, - "literals": - [ - "experimental", - "ABIEncoderV2" - ], - "nodeType": "PragmaDirective", - "src": "65:33:0" - }, - { - "abstract": false, - "baseContracts": [], - "canonicalName": "SwapArgumentsFunctionMutation", - "contractDependencies": [], - "contractKind": "contract", - "fullyImplemented": true, - "id": 32, - "linearizedBaseContracts": - [ - 32 - ], - "name": "SwapArgumentsFunctionMutation", - "nameLocation": "109:29:0", - "nodeType": "ContractDefinition", - "nodes": - [ - { - "body": - { - "id": 15, - "nodeType": "Block", - "src": "211:22:0", - "statements": - [ - { - "expression": - { - "commonType": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 13, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": - { - "id": 11, - "name": "x", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4, - "src": "221:1:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "-", - "rightExpression": - { - "id": 12, - "name": "y", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 6, - "src": "225:1:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "221:5:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "functionReturnParameters": 10, - "id": 14, - "nodeType": "Return", - "src": "214:12:0" - } - ] - }, - "functionSelector": "04bc52f8", - "id": 16, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "foo", - "nameLocation": "155:3:0", - "nodeType": "FunctionDefinition", - "parameters": - { - "id": 7, - "nodeType": "ParameterList", - "parameters": - [ - { - "constant": false, - "id": 4, - "mutability": "mutable", - "name": "x", - "nameLocation": "167:1:0", - "nodeType": "VariableDeclaration", - "scope": 16, - "src": "159:9:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": - { - "id": 3, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "159:7:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 6, - "mutability": "mutable", - "name": "y", - "nameLocation": "178:1:0", - "nodeType": "VariableDeclaration", - "scope": 16, - "src": "170:9:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": - { - "id": 5, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "170:7:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - } - ], - "src": "158:22:0" - }, - "returnParameters": - { - "id": 10, - "nodeType": "ParameterList", - "parameters": - [ - { - "constant": false, - "id": 9, - "mutability": "mutable", - "name": "", - "nameLocation": "-1:-1:-1", - "nodeType": "VariableDeclaration", - "scope": 16, - "src": "202:7:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": - { - "id": 8, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "202:7:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - } - ], - "src": "201:9:0" - }, - "scope": 32, - "src": "146:87:0", - "stateMutability": "pure", - "virtual": false, - "visibility": "public" - }, - { - "body": - { - "id": 30, - "nodeType": "Block", - "src": "304:26:0", - "statements": - [ - { - "expression": - { - "arguments": - [ - { - "id": 26, - "name": "x", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 18, - "src": "318:1:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - { - "id": 27, - "name": "y", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 20, - "src": "321:1:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": - { - "argumentTypes": - [ - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "id": 25, - "name": "foo", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 16, - "src": "314:3:0", - "typeDescriptions": - { - "typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$", - "typeString": "function (uint256,uint256) pure returns (uint256)" - } - }, - "id": 28, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "314:9:0", - "tryCall": false, - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "functionReturnParameters": 24, - "id": 29, - "nodeType": "Return", - "src": "307:16:0" - } - ] - }, - "functionSelector": "ae42e951", - "id": 31, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "bar", - "nameLocation": "248:3:0", - "nodeType": "FunctionDefinition", - "parameters": - { - "id": 21, - "nodeType": "ParameterList", - "parameters": - [ - { - "constant": false, - "id": 18, - "mutability": "mutable", - "name": "x", - "nameLocation": "260:1:0", - "nodeType": "VariableDeclaration", - "scope": 31, - "src": "252:9:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": - { - "id": 17, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "252:7:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 20, - "mutability": "mutable", - "name": "y", - "nameLocation": "271:1:0", - "nodeType": "VariableDeclaration", - "scope": 31, - "src": "263:9:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": - { - "id": 19, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "263:7:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - } - ], - "src": "251:22:0" - }, - "returnParameters": - { - "id": 24, - "nodeType": "ParameterList", - "parameters": - [ - { - "constant": false, - "id": 23, - "mutability": "mutable", - "name": "", - "nameLocation": "-1:-1:-1", - "nodeType": "VariableDeclaration", - "scope": 31, - "src": "295:7:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": - { - "id": 22, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "295:7:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - } - ], - "src": "294:9:0" - }, - "scope": 32, - "src": "239:91:0", - "stateMutability": "pure", - "virtual": false, - "visibility": "public" - } - ], - "scope": 33, - "src": "100:232:0", - "usedErrors": [] - } - ], - "src": "41:292:0" -} \ No newline at end of file diff --git a/resources/regressions/all.json/input_json/SwapArgumentsOperatorMutation.sol_json.ast b/resources/regressions/all.json/input_json/SwapArgumentsOperatorMutation.sol_json.ast deleted file mode 100644 index 3aa1570..0000000 --- a/resources/regressions/all.json/input_json/SwapArgumentsOperatorMutation.sol_json.ast +++ /dev/null @@ -1,1931 +0,0 @@ -{ - "absolutePath": "benchmarks/SwapArgumentsOperatorMutation/SwapArgumentsOperatorMutation.sol", - "exportedSymbols": - { - "SwapArgumentsOperatorMutation": - [ - 143 - ] - }, - "id": 144, - "license": "GPL-3.0-only", - "nodeType": "SourceUnit", - "nodes": - [ - { - "id": 1, - "literals": - [ - "solidity", - ">", - "0.7", - ".0" - ], - "nodeType": "PragmaDirective", - "src": "41:23:0" - }, - { - "id": 2, - "literals": - [ - "experimental", - "ABIEncoderV2" - ], - "nodeType": "PragmaDirective", - "src": "65:33:0" - }, - { - "abstract": false, - "baseContracts": [], - "canonicalName": "SwapArgumentsOperatorMutation", - "contractDependencies": [], - "contractKind": "contract", - "fullyImplemented": true, - "id": 143, - "linearizedBaseContracts": - [ - 143 - ], - "name": "SwapArgumentsOperatorMutation", - "nameLocation": "109:29:0", - "nodeType": "ContractDefinition", - "nodes": - [ - { - "body": - { - "id": 15, - "nodeType": "Block", - "src": "220:22:0", - "statements": - [ - { - "expression": - { - "commonType": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 13, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": - { - "id": 11, - "name": "x", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4, - "src": "230:1:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "-", - "rightExpression": - { - "id": 12, - "name": "y", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 6, - "src": "234:1:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "230:5:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "functionReturnParameters": 10, - "id": 14, - "nodeType": "Return", - "src": "223:12:0" - } - ] - }, - "functionSelector": "b3d09aaa", - "id": 16, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "mySubtraction", - "nameLocation": "154:13:0", - "nodeType": "FunctionDefinition", - "parameters": - { - "id": 7, - "nodeType": "ParameterList", - "parameters": - [ - { - "constant": false, - "id": 4, - "mutability": "mutable", - "name": "x", - "nameLocation": "176:1:0", - "nodeType": "VariableDeclaration", - "scope": 16, - "src": "168:9:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": - { - "id": 3, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "168:7:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 6, - "mutability": "mutable", - "name": "y", - "nameLocation": "187:1:0", - "nodeType": "VariableDeclaration", - "scope": 16, - "src": "179:9:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": - { - "id": 5, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "179:7:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - } - ], - "src": "167:22:0" - }, - "returnParameters": - { - "id": 10, - "nodeType": "ParameterList", - "parameters": - [ - { - "constant": false, - "id": 9, - "mutability": "mutable", - "name": "", - "nameLocation": "-1:-1:-1", - "nodeType": "VariableDeclaration", - "scope": 16, - "src": "211:7:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": - { - "id": 8, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "211:7:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - } - ], - "src": "210:9:0" - }, - "scope": 143, - "src": "145:97:0", - "stateMutability": "pure", - "virtual": false, - "visibility": "public" - }, - { - "body": - { - "id": 29, - "nodeType": "Block", - "src": "324:22:0", - "statements": - [ - { - "expression": - { - "commonType": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 27, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": - { - "id": 25, - "name": "x", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 18, - "src": "334:1:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "/", - "rightExpression": - { - "id": 26, - "name": "y", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 20, - "src": "338:1:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "334:5:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "functionReturnParameters": 24, - "id": 28, - "nodeType": "Return", - "src": "327:12:0" - } - ] - }, - "functionSelector": "9d4f4e60", - "id": 30, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "myDivision", - "nameLocation": "261:10:0", - "nodeType": "FunctionDefinition", - "parameters": - { - "id": 21, - "nodeType": "ParameterList", - "parameters": - [ - { - "constant": false, - "id": 18, - "mutability": "mutable", - "name": "x", - "nameLocation": "280:1:0", - "nodeType": "VariableDeclaration", - "scope": 30, - "src": "272:9:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": - { - "id": 17, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "272:7:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 20, - "mutability": "mutable", - "name": "y", - "nameLocation": "291:1:0", - "nodeType": "VariableDeclaration", - "scope": 30, - "src": "283:9:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": - { - "id": 19, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "283:7:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - } - ], - "src": "271:22:0" - }, - "returnParameters": - { - "id": 24, - "nodeType": "ParameterList", - "parameters": - [ - { - "constant": false, - "id": 23, - "mutability": "mutable", - "name": "", - "nameLocation": "-1:-1:-1", - "nodeType": "VariableDeclaration", - "scope": 30, - "src": "315:7:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": - { - "id": 22, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "315:7:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - } - ], - "src": "314:9:0" - }, - "scope": 143, - "src": "252:94:0", - "stateMutability": "pure", - "virtual": false, - "visibility": "public" - }, - { - "body": - { - "id": 43, - "nodeType": "Block", - "src": "426:22:0", - "statements": - [ - { - "expression": - { - "commonType": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 41, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": - { - "id": 39, - "name": "x", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 32, - "src": "436:1:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "%", - "rightExpression": - { - "id": 40, - "name": "y", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 34, - "src": "440:1:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "436:5:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "functionReturnParameters": 38, - "id": 42, - "nodeType": "Return", - "src": "429:12:0" - } - ] - }, - "functionSelector": "dc6092a8", - "id": 44, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "myModulo", - "nameLocation": "365:8:0", - "nodeType": "FunctionDefinition", - "parameters": - { - "id": 35, - "nodeType": "ParameterList", - "parameters": - [ - { - "constant": false, - "id": 32, - "mutability": "mutable", - "name": "x", - "nameLocation": "382:1:0", - "nodeType": "VariableDeclaration", - "scope": 44, - "src": "374:9:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": - { - "id": 31, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "374:7:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 34, - "mutability": "mutable", - "name": "y", - "nameLocation": "393:1:0", - "nodeType": "VariableDeclaration", - "scope": 44, - "src": "385:9:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": - { - "id": 33, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "385:7:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - } - ], - "src": "373:22:0" - }, - "returnParameters": - { - "id": 38, - "nodeType": "ParameterList", - "parameters": - [ - { - "constant": false, - "id": 37, - "mutability": "mutable", - "name": "", - "nameLocation": "-1:-1:-1", - "nodeType": "VariableDeclaration", - "scope": 44, - "src": "417:7:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": - { - "id": 36, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "417:7:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - } - ], - "src": "416:9:0" - }, - "scope": 143, - "src": "356:92:0", - "stateMutability": "pure", - "virtual": false, - "visibility": "public" - }, - { - "body": - { - "id": 57, - "nodeType": "Block", - "src": "536:23:0", - "statements": - [ - { - "expression": - { - "commonType": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 55, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": - { - "id": 53, - "name": "x", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 46, - "src": "546:1:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "**", - "rightExpression": - { - "id": 54, - "name": "y", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 48, - "src": "551:1:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "546:6:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "functionReturnParameters": 52, - "id": 56, - "nodeType": "Return", - "src": "539:13:0" - } - ] - }, - "functionSelector": "df159c7b", - "id": 58, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "myExponentiation", - "nameLocation": "467:16:0", - "nodeType": "FunctionDefinition", - "parameters": - { - "id": 49, - "nodeType": "ParameterList", - "parameters": - [ - { - "constant": false, - "id": 46, - "mutability": "mutable", - "name": "x", - "nameLocation": "492:1:0", - "nodeType": "VariableDeclaration", - "scope": 58, - "src": "484:9:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": - { - "id": 45, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "484:7:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 48, - "mutability": "mutable", - "name": "y", - "nameLocation": "503:1:0", - "nodeType": "VariableDeclaration", - "scope": 58, - "src": "495:9:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": - { - "id": 47, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "495:7:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - } - ], - "src": "483:22:0" - }, - "returnParameters": - { - "id": 52, - "nodeType": "ParameterList", - "parameters": - [ - { - "constant": false, - "id": 51, - "mutability": "mutable", - "name": "", - "nameLocation": "-1:-1:-1", - "nodeType": "VariableDeclaration", - "scope": 58, - "src": "527:7:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": - { - "id": 50, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "527:7:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - } - ], - "src": "526:9:0" - }, - "scope": 143, - "src": "458:101:0", - "stateMutability": "pure", - "virtual": false, - "visibility": "public" - }, - { - "body": - { - "id": 71, - "nodeType": "Block", - "src": "632:22:0", - "statements": - [ - { - "expression": - { - "commonType": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 69, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": - { - "id": 67, - "name": "x", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 60, - "src": "642:1:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": ">", - "rightExpression": - { - "id": 68, - "name": "y", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 62, - "src": "646:1:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "642:5:0", - "typeDescriptions": - { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "functionReturnParameters": 66, - "id": 70, - "nodeType": "Return", - "src": "635:12:0" - } - ] - }, - "functionSelector": "7ab4f1c3", - "id": 72, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "myGT", - "nameLocation": "578:4:0", - "nodeType": "FunctionDefinition", - "parameters": - { - "id": 63, - "nodeType": "ParameterList", - "parameters": - [ - { - "constant": false, - "id": 60, - "mutability": "mutable", - "name": "x", - "nameLocation": "591:1:0", - "nodeType": "VariableDeclaration", - "scope": 72, - "src": "583:9:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": - { - "id": 59, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "583:7:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 62, - "mutability": "mutable", - "name": "y", - "nameLocation": "602:1:0", - "nodeType": "VariableDeclaration", - "scope": 72, - "src": "594:9:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": - { - "id": 61, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "594:7:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - } - ], - "src": "582:22:0" - }, - "returnParameters": - { - "id": 66, - "nodeType": "ParameterList", - "parameters": - [ - { - "constant": false, - "id": 65, - "mutability": "mutable", - "name": "", - "nameLocation": "-1:-1:-1", - "nodeType": "VariableDeclaration", - "scope": 72, - "src": "626:4:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "typeName": - { - "id": 64, - "name": "bool", - "nodeType": "ElementaryTypeName", - "src": "626:4:0", - "typeDescriptions": - { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "visibility": "internal" - } - ], - "src": "625:6:0" - }, - "scope": 143, - "src": "569:85:0", - "stateMutability": "pure", - "virtual": false, - "visibility": "public" - }, - { - "body": - { - "id": 85, - "nodeType": "Block", - "src": "727:22:0", - "statements": - [ - { - "expression": - { - "commonType": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 83, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": - { - "id": 81, - "name": "x", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 74, - "src": "737:1:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "<", - "rightExpression": - { - "id": 82, - "name": "y", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 76, - "src": "741:1:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "737:5:0", - "typeDescriptions": - { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "functionReturnParameters": 80, - "id": 84, - "nodeType": "Return", - "src": "730:12:0" - } - ] - }, - "functionSelector": "ba16f592", - "id": 86, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "myLT", - "nameLocation": "673:4:0", - "nodeType": "FunctionDefinition", - "parameters": - { - "id": 77, - "nodeType": "ParameterList", - "parameters": - [ - { - "constant": false, - "id": 74, - "mutability": "mutable", - "name": "x", - "nameLocation": "686:1:0", - "nodeType": "VariableDeclaration", - "scope": 86, - "src": "678:9:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": - { - "id": 73, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "678:7:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 76, - "mutability": "mutable", - "name": "y", - "nameLocation": "697:1:0", - "nodeType": "VariableDeclaration", - "scope": 86, - "src": "689:9:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": - { - "id": 75, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "689:7:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - } - ], - "src": "677:22:0" - }, - "returnParameters": - { - "id": 80, - "nodeType": "ParameterList", - "parameters": - [ - { - "constant": false, - "id": 79, - "mutability": "mutable", - "name": "", - "nameLocation": "-1:-1:-1", - "nodeType": "VariableDeclaration", - "scope": 86, - "src": "721:4:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "typeName": - { - "id": 78, - "name": "bool", - "nodeType": "ElementaryTypeName", - "src": "721:4:0", - "typeDescriptions": - { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "visibility": "internal" - } - ], - "src": "720:6:0" - }, - "scope": 143, - "src": "664:85:0", - "stateMutability": "pure", - "virtual": false, - "visibility": "public" - }, - { - "body": - { - "id": 99, - "nodeType": "Block", - "src": "822:23:0", - "statements": - [ - { - "expression": - { - "commonType": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 97, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": - { - "id": 95, - "name": "x", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 88, - "src": "832:1:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": ">=", - "rightExpression": - { - "id": 96, - "name": "y", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 90, - "src": "837:1:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "832:6:0", - "typeDescriptions": - { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "functionReturnParameters": 94, - "id": 98, - "nodeType": "Return", - "src": "825:13:0" - } - ] - }, - "functionSelector": "eaa91dbe", - "id": 100, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "myGE", - "nameLocation": "768:4:0", - "nodeType": "FunctionDefinition", - "parameters": - { - "id": 91, - "nodeType": "ParameterList", - "parameters": - [ - { - "constant": false, - "id": 88, - "mutability": "mutable", - "name": "x", - "nameLocation": "781:1:0", - "nodeType": "VariableDeclaration", - "scope": 100, - "src": "773:9:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": - { - "id": 87, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "773:7:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 90, - "mutability": "mutable", - "name": "y", - "nameLocation": "792:1:0", - "nodeType": "VariableDeclaration", - "scope": 100, - "src": "784:9:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": - { - "id": 89, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "784:7:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - } - ], - "src": "772:22:0" - }, - "returnParameters": - { - "id": 94, - "nodeType": "ParameterList", - "parameters": - [ - { - "constant": false, - "id": 93, - "mutability": "mutable", - "name": "", - "nameLocation": "-1:-1:-1", - "nodeType": "VariableDeclaration", - "scope": 100, - "src": "816:4:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "typeName": - { - "id": 92, - "name": "bool", - "nodeType": "ElementaryTypeName", - "src": "816:4:0", - "typeDescriptions": - { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "visibility": "internal" - } - ], - "src": "815:6:0" - }, - "scope": 143, - "src": "759:86:0", - "stateMutability": "pure", - "virtual": false, - "visibility": "public" - }, - { - "body": - { - "id": 113, - "nodeType": "Block", - "src": "918:23:0", - "statements": - [ - { - "expression": - { - "commonType": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 111, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": - { - "id": 109, - "name": "x", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 102, - "src": "928:1:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "<=", - "rightExpression": - { - "id": 110, - "name": "y", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 104, - "src": "933:1:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "928:6:0", - "typeDescriptions": - { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "functionReturnParameters": 108, - "id": 112, - "nodeType": "Return", - "src": "921:13:0" - } - ] - }, - "functionSelector": "33e88407", - "id": 114, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "myLE", - "nameLocation": "864:4:0", - "nodeType": "FunctionDefinition", - "parameters": - { - "id": 105, - "nodeType": "ParameterList", - "parameters": - [ - { - "constant": false, - "id": 102, - "mutability": "mutable", - "name": "x", - "nameLocation": "877:1:0", - "nodeType": "VariableDeclaration", - "scope": 114, - "src": "869:9:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": - { - "id": 101, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "869:7:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 104, - "mutability": "mutable", - "name": "y", - "nameLocation": "888:1:0", - "nodeType": "VariableDeclaration", - "scope": 114, - "src": "880:9:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": - { - "id": 103, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "880:7:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - } - ], - "src": "868:22:0" - }, - "returnParameters": - { - "id": 108, - "nodeType": "ParameterList", - "parameters": - [ - { - "constant": false, - "id": 107, - "mutability": "mutable", - "name": "", - "nameLocation": "-1:-1:-1", - "nodeType": "VariableDeclaration", - "scope": 114, - "src": "912:4:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "typeName": - { - "id": 106, - "name": "bool", - "nodeType": "ElementaryTypeName", - "src": "912:4:0", - "typeDescriptions": - { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "visibility": "internal" - } - ], - "src": "911:6:0" - }, - "scope": 143, - "src": "855:86:0", - "stateMutability": "pure", - "virtual": false, - "visibility": "public" - }, - { - "body": - { - "id": 127, - "nodeType": "Block", - "src": "1014:23:0", - "statements": - [ - { - "expression": - { - "commonType": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 125, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": - { - "id": 123, - "name": "x", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 116, - "src": "1024:1:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "<<", - "rightExpression": - { - "id": 124, - "name": "y", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 118, - "src": "1029:1:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "1024:6:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "functionReturnParameters": 122, - "id": 126, - "nodeType": "Return", - "src": "1017:13:0" - } - ] - }, - "functionSelector": "5d58009c", - "id": 128, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "mySAL", - "nameLocation": "956:5:0", - "nodeType": "FunctionDefinition", - "parameters": - { - "id": 119, - "nodeType": "ParameterList", - "parameters": - [ - { - "constant": false, - "id": 116, - "mutability": "mutable", - "name": "x", - "nameLocation": "970:1:0", - "nodeType": "VariableDeclaration", - "scope": 128, - "src": "962:9:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": - { - "id": 115, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "962:7:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 118, - "mutability": "mutable", - "name": "y", - "nameLocation": "981:1:0", - "nodeType": "VariableDeclaration", - "scope": 128, - "src": "973:9:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": - { - "id": 117, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "973:7:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - } - ], - "src": "961:22:0" - }, - "returnParameters": - { - "id": 122, - "nodeType": "ParameterList", - "parameters": - [ - { - "constant": false, - "id": 121, - "mutability": "mutable", - "name": "", - "nameLocation": "-1:-1:-1", - "nodeType": "VariableDeclaration", - "scope": 128, - "src": "1005:7:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": - { - "id": 120, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "1005:7:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - } - ], - "src": "1004:9:0" - }, - "scope": 143, - "src": "947:90:0", - "stateMutability": "pure", - "virtual": false, - "visibility": "public" - }, - { - "body": - { - "id": 141, - "nodeType": "Block", - "src": "1110:23:0", - "statements": - [ - { - "expression": - { - "commonType": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 139, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": - { - "id": 137, - "name": "x", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 130, - "src": "1120:1:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": ">>", - "rightExpression": - { - "id": 138, - "name": "y", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 132, - "src": "1125:1:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "1120:6:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "functionReturnParameters": 136, - "id": 140, - "nodeType": "Return", - "src": "1113:13:0" - } - ] - }, - "functionSelector": "ad6b48dc", - "id": 142, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "mySAR", - "nameLocation": "1052:5:0", - "nodeType": "FunctionDefinition", - "parameters": - { - "id": 133, - "nodeType": "ParameterList", - "parameters": - [ - { - "constant": false, - "id": 130, - "mutability": "mutable", - "name": "x", - "nameLocation": "1066:1:0", - "nodeType": "VariableDeclaration", - "scope": 142, - "src": "1058:9:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": - { - "id": 129, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "1058:7:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 132, - "mutability": "mutable", - "name": "y", - "nameLocation": "1077:1:0", - "nodeType": "VariableDeclaration", - "scope": 142, - "src": "1069:9:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": - { - "id": 131, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "1069:7:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - } - ], - "src": "1057:22:0" - }, - "returnParameters": - { - "id": 136, - "nodeType": "ParameterList", - "parameters": - [ - { - "constant": false, - "id": 135, - "mutability": "mutable", - "name": "", - "nameLocation": "-1:-1:-1", - "nodeType": "VariableDeclaration", - "scope": 142, - "src": "1101:7:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": - { - "id": 134, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "1101:7:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - } - ], - "src": "1100:9:0" - }, - "scope": 143, - "src": "1043:90:0", - "stateMutability": "pure", - "virtual": false, - "visibility": "public" - } - ], - "scope": 144, - "src": "100:1035:0", - "usedErrors": [] - } - ], - "src": "41:1095:0" -} \ No newline at end of file diff --git a/resources/regressions/all.json/input_json/SwapArgumentsOperatorMutation.sol_json.ast.json b/resources/regressions/all.json/input_json/SwapArgumentsOperatorMutation.sol_json.ast.json deleted file mode 100644 index 3aa1570..0000000 --- a/resources/regressions/all.json/input_json/SwapArgumentsOperatorMutation.sol_json.ast.json +++ /dev/null @@ -1,1931 +0,0 @@ -{ - "absolutePath": "benchmarks/SwapArgumentsOperatorMutation/SwapArgumentsOperatorMutation.sol", - "exportedSymbols": - { - "SwapArgumentsOperatorMutation": - [ - 143 - ] - }, - "id": 144, - "license": "GPL-3.0-only", - "nodeType": "SourceUnit", - "nodes": - [ - { - "id": 1, - "literals": - [ - "solidity", - ">", - "0.7", - ".0" - ], - "nodeType": "PragmaDirective", - "src": "41:23:0" - }, - { - "id": 2, - "literals": - [ - "experimental", - "ABIEncoderV2" - ], - "nodeType": "PragmaDirective", - "src": "65:33:0" - }, - { - "abstract": false, - "baseContracts": [], - "canonicalName": "SwapArgumentsOperatorMutation", - "contractDependencies": [], - "contractKind": "contract", - "fullyImplemented": true, - "id": 143, - "linearizedBaseContracts": - [ - 143 - ], - "name": "SwapArgumentsOperatorMutation", - "nameLocation": "109:29:0", - "nodeType": "ContractDefinition", - "nodes": - [ - { - "body": - { - "id": 15, - "nodeType": "Block", - "src": "220:22:0", - "statements": - [ - { - "expression": - { - "commonType": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 13, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": - { - "id": 11, - "name": "x", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4, - "src": "230:1:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "-", - "rightExpression": - { - "id": 12, - "name": "y", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 6, - "src": "234:1:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "230:5:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "functionReturnParameters": 10, - "id": 14, - "nodeType": "Return", - "src": "223:12:0" - } - ] - }, - "functionSelector": "b3d09aaa", - "id": 16, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "mySubtraction", - "nameLocation": "154:13:0", - "nodeType": "FunctionDefinition", - "parameters": - { - "id": 7, - "nodeType": "ParameterList", - "parameters": - [ - { - "constant": false, - "id": 4, - "mutability": "mutable", - "name": "x", - "nameLocation": "176:1:0", - "nodeType": "VariableDeclaration", - "scope": 16, - "src": "168:9:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": - { - "id": 3, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "168:7:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 6, - "mutability": "mutable", - "name": "y", - "nameLocation": "187:1:0", - "nodeType": "VariableDeclaration", - "scope": 16, - "src": "179:9:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": - { - "id": 5, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "179:7:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - } - ], - "src": "167:22:0" - }, - "returnParameters": - { - "id": 10, - "nodeType": "ParameterList", - "parameters": - [ - { - "constant": false, - "id": 9, - "mutability": "mutable", - "name": "", - "nameLocation": "-1:-1:-1", - "nodeType": "VariableDeclaration", - "scope": 16, - "src": "211:7:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": - { - "id": 8, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "211:7:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - } - ], - "src": "210:9:0" - }, - "scope": 143, - "src": "145:97:0", - "stateMutability": "pure", - "virtual": false, - "visibility": "public" - }, - { - "body": - { - "id": 29, - "nodeType": "Block", - "src": "324:22:0", - "statements": - [ - { - "expression": - { - "commonType": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 27, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": - { - "id": 25, - "name": "x", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 18, - "src": "334:1:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "/", - "rightExpression": - { - "id": 26, - "name": "y", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 20, - "src": "338:1:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "334:5:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "functionReturnParameters": 24, - "id": 28, - "nodeType": "Return", - "src": "327:12:0" - } - ] - }, - "functionSelector": "9d4f4e60", - "id": 30, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "myDivision", - "nameLocation": "261:10:0", - "nodeType": "FunctionDefinition", - "parameters": - { - "id": 21, - "nodeType": "ParameterList", - "parameters": - [ - { - "constant": false, - "id": 18, - "mutability": "mutable", - "name": "x", - "nameLocation": "280:1:0", - "nodeType": "VariableDeclaration", - "scope": 30, - "src": "272:9:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": - { - "id": 17, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "272:7:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 20, - "mutability": "mutable", - "name": "y", - "nameLocation": "291:1:0", - "nodeType": "VariableDeclaration", - "scope": 30, - "src": "283:9:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": - { - "id": 19, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "283:7:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - } - ], - "src": "271:22:0" - }, - "returnParameters": - { - "id": 24, - "nodeType": "ParameterList", - "parameters": - [ - { - "constant": false, - "id": 23, - "mutability": "mutable", - "name": "", - "nameLocation": "-1:-1:-1", - "nodeType": "VariableDeclaration", - "scope": 30, - "src": "315:7:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": - { - "id": 22, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "315:7:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - } - ], - "src": "314:9:0" - }, - "scope": 143, - "src": "252:94:0", - "stateMutability": "pure", - "virtual": false, - "visibility": "public" - }, - { - "body": - { - "id": 43, - "nodeType": "Block", - "src": "426:22:0", - "statements": - [ - { - "expression": - { - "commonType": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 41, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": - { - "id": 39, - "name": "x", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 32, - "src": "436:1:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "%", - "rightExpression": - { - "id": 40, - "name": "y", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 34, - "src": "440:1:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "436:5:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "functionReturnParameters": 38, - "id": 42, - "nodeType": "Return", - "src": "429:12:0" - } - ] - }, - "functionSelector": "dc6092a8", - "id": 44, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "myModulo", - "nameLocation": "365:8:0", - "nodeType": "FunctionDefinition", - "parameters": - { - "id": 35, - "nodeType": "ParameterList", - "parameters": - [ - { - "constant": false, - "id": 32, - "mutability": "mutable", - "name": "x", - "nameLocation": "382:1:0", - "nodeType": "VariableDeclaration", - "scope": 44, - "src": "374:9:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": - { - "id": 31, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "374:7:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 34, - "mutability": "mutable", - "name": "y", - "nameLocation": "393:1:0", - "nodeType": "VariableDeclaration", - "scope": 44, - "src": "385:9:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": - { - "id": 33, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "385:7:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - } - ], - "src": "373:22:0" - }, - "returnParameters": - { - "id": 38, - "nodeType": "ParameterList", - "parameters": - [ - { - "constant": false, - "id": 37, - "mutability": "mutable", - "name": "", - "nameLocation": "-1:-1:-1", - "nodeType": "VariableDeclaration", - "scope": 44, - "src": "417:7:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": - { - "id": 36, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "417:7:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - } - ], - "src": "416:9:0" - }, - "scope": 143, - "src": "356:92:0", - "stateMutability": "pure", - "virtual": false, - "visibility": "public" - }, - { - "body": - { - "id": 57, - "nodeType": "Block", - "src": "536:23:0", - "statements": - [ - { - "expression": - { - "commonType": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 55, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": - { - "id": 53, - "name": "x", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 46, - "src": "546:1:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "**", - "rightExpression": - { - "id": 54, - "name": "y", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 48, - "src": "551:1:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "546:6:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "functionReturnParameters": 52, - "id": 56, - "nodeType": "Return", - "src": "539:13:0" - } - ] - }, - "functionSelector": "df159c7b", - "id": 58, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "myExponentiation", - "nameLocation": "467:16:0", - "nodeType": "FunctionDefinition", - "parameters": - { - "id": 49, - "nodeType": "ParameterList", - "parameters": - [ - { - "constant": false, - "id": 46, - "mutability": "mutable", - "name": "x", - "nameLocation": "492:1:0", - "nodeType": "VariableDeclaration", - "scope": 58, - "src": "484:9:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": - { - "id": 45, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "484:7:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 48, - "mutability": "mutable", - "name": "y", - "nameLocation": "503:1:0", - "nodeType": "VariableDeclaration", - "scope": 58, - "src": "495:9:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": - { - "id": 47, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "495:7:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - } - ], - "src": "483:22:0" - }, - "returnParameters": - { - "id": 52, - "nodeType": "ParameterList", - "parameters": - [ - { - "constant": false, - "id": 51, - "mutability": "mutable", - "name": "", - "nameLocation": "-1:-1:-1", - "nodeType": "VariableDeclaration", - "scope": 58, - "src": "527:7:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": - { - "id": 50, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "527:7:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - } - ], - "src": "526:9:0" - }, - "scope": 143, - "src": "458:101:0", - "stateMutability": "pure", - "virtual": false, - "visibility": "public" - }, - { - "body": - { - "id": 71, - "nodeType": "Block", - "src": "632:22:0", - "statements": - [ - { - "expression": - { - "commonType": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 69, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": - { - "id": 67, - "name": "x", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 60, - "src": "642:1:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": ">", - "rightExpression": - { - "id": 68, - "name": "y", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 62, - "src": "646:1:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "642:5:0", - "typeDescriptions": - { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "functionReturnParameters": 66, - "id": 70, - "nodeType": "Return", - "src": "635:12:0" - } - ] - }, - "functionSelector": "7ab4f1c3", - "id": 72, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "myGT", - "nameLocation": "578:4:0", - "nodeType": "FunctionDefinition", - "parameters": - { - "id": 63, - "nodeType": "ParameterList", - "parameters": - [ - { - "constant": false, - "id": 60, - "mutability": "mutable", - "name": "x", - "nameLocation": "591:1:0", - "nodeType": "VariableDeclaration", - "scope": 72, - "src": "583:9:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": - { - "id": 59, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "583:7:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 62, - "mutability": "mutable", - "name": "y", - "nameLocation": "602:1:0", - "nodeType": "VariableDeclaration", - "scope": 72, - "src": "594:9:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": - { - "id": 61, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "594:7:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - } - ], - "src": "582:22:0" - }, - "returnParameters": - { - "id": 66, - "nodeType": "ParameterList", - "parameters": - [ - { - "constant": false, - "id": 65, - "mutability": "mutable", - "name": "", - "nameLocation": "-1:-1:-1", - "nodeType": "VariableDeclaration", - "scope": 72, - "src": "626:4:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "typeName": - { - "id": 64, - "name": "bool", - "nodeType": "ElementaryTypeName", - "src": "626:4:0", - "typeDescriptions": - { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "visibility": "internal" - } - ], - "src": "625:6:0" - }, - "scope": 143, - "src": "569:85:0", - "stateMutability": "pure", - "virtual": false, - "visibility": "public" - }, - { - "body": - { - "id": 85, - "nodeType": "Block", - "src": "727:22:0", - "statements": - [ - { - "expression": - { - "commonType": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 83, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": - { - "id": 81, - "name": "x", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 74, - "src": "737:1:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "<", - "rightExpression": - { - "id": 82, - "name": "y", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 76, - "src": "741:1:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "737:5:0", - "typeDescriptions": - { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "functionReturnParameters": 80, - "id": 84, - "nodeType": "Return", - "src": "730:12:0" - } - ] - }, - "functionSelector": "ba16f592", - "id": 86, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "myLT", - "nameLocation": "673:4:0", - "nodeType": "FunctionDefinition", - "parameters": - { - "id": 77, - "nodeType": "ParameterList", - "parameters": - [ - { - "constant": false, - "id": 74, - "mutability": "mutable", - "name": "x", - "nameLocation": "686:1:0", - "nodeType": "VariableDeclaration", - "scope": 86, - "src": "678:9:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": - { - "id": 73, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "678:7:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 76, - "mutability": "mutable", - "name": "y", - "nameLocation": "697:1:0", - "nodeType": "VariableDeclaration", - "scope": 86, - "src": "689:9:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": - { - "id": 75, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "689:7:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - } - ], - "src": "677:22:0" - }, - "returnParameters": - { - "id": 80, - "nodeType": "ParameterList", - "parameters": - [ - { - "constant": false, - "id": 79, - "mutability": "mutable", - "name": "", - "nameLocation": "-1:-1:-1", - "nodeType": "VariableDeclaration", - "scope": 86, - "src": "721:4:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "typeName": - { - "id": 78, - "name": "bool", - "nodeType": "ElementaryTypeName", - "src": "721:4:0", - "typeDescriptions": - { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "visibility": "internal" - } - ], - "src": "720:6:0" - }, - "scope": 143, - "src": "664:85:0", - "stateMutability": "pure", - "virtual": false, - "visibility": "public" - }, - { - "body": - { - "id": 99, - "nodeType": "Block", - "src": "822:23:0", - "statements": - [ - { - "expression": - { - "commonType": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 97, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": - { - "id": 95, - "name": "x", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 88, - "src": "832:1:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": ">=", - "rightExpression": - { - "id": 96, - "name": "y", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 90, - "src": "837:1:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "832:6:0", - "typeDescriptions": - { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "functionReturnParameters": 94, - "id": 98, - "nodeType": "Return", - "src": "825:13:0" - } - ] - }, - "functionSelector": "eaa91dbe", - "id": 100, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "myGE", - "nameLocation": "768:4:0", - "nodeType": "FunctionDefinition", - "parameters": - { - "id": 91, - "nodeType": "ParameterList", - "parameters": - [ - { - "constant": false, - "id": 88, - "mutability": "mutable", - "name": "x", - "nameLocation": "781:1:0", - "nodeType": "VariableDeclaration", - "scope": 100, - "src": "773:9:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": - { - "id": 87, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "773:7:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 90, - "mutability": "mutable", - "name": "y", - "nameLocation": "792:1:0", - "nodeType": "VariableDeclaration", - "scope": 100, - "src": "784:9:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": - { - "id": 89, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "784:7:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - } - ], - "src": "772:22:0" - }, - "returnParameters": - { - "id": 94, - "nodeType": "ParameterList", - "parameters": - [ - { - "constant": false, - "id": 93, - "mutability": "mutable", - "name": "", - "nameLocation": "-1:-1:-1", - "nodeType": "VariableDeclaration", - "scope": 100, - "src": "816:4:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "typeName": - { - "id": 92, - "name": "bool", - "nodeType": "ElementaryTypeName", - "src": "816:4:0", - "typeDescriptions": - { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "visibility": "internal" - } - ], - "src": "815:6:0" - }, - "scope": 143, - "src": "759:86:0", - "stateMutability": "pure", - "virtual": false, - "visibility": "public" - }, - { - "body": - { - "id": 113, - "nodeType": "Block", - "src": "918:23:0", - "statements": - [ - { - "expression": - { - "commonType": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 111, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": - { - "id": 109, - "name": "x", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 102, - "src": "928:1:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "<=", - "rightExpression": - { - "id": 110, - "name": "y", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 104, - "src": "933:1:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "928:6:0", - "typeDescriptions": - { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "functionReturnParameters": 108, - "id": 112, - "nodeType": "Return", - "src": "921:13:0" - } - ] - }, - "functionSelector": "33e88407", - "id": 114, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "myLE", - "nameLocation": "864:4:0", - "nodeType": "FunctionDefinition", - "parameters": - { - "id": 105, - "nodeType": "ParameterList", - "parameters": - [ - { - "constant": false, - "id": 102, - "mutability": "mutable", - "name": "x", - "nameLocation": "877:1:0", - "nodeType": "VariableDeclaration", - "scope": 114, - "src": "869:9:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": - { - "id": 101, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "869:7:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 104, - "mutability": "mutable", - "name": "y", - "nameLocation": "888:1:0", - "nodeType": "VariableDeclaration", - "scope": 114, - "src": "880:9:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": - { - "id": 103, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "880:7:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - } - ], - "src": "868:22:0" - }, - "returnParameters": - { - "id": 108, - "nodeType": "ParameterList", - "parameters": - [ - { - "constant": false, - "id": 107, - "mutability": "mutable", - "name": "", - "nameLocation": "-1:-1:-1", - "nodeType": "VariableDeclaration", - "scope": 114, - "src": "912:4:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "typeName": - { - "id": 106, - "name": "bool", - "nodeType": "ElementaryTypeName", - "src": "912:4:0", - "typeDescriptions": - { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "visibility": "internal" - } - ], - "src": "911:6:0" - }, - "scope": 143, - "src": "855:86:0", - "stateMutability": "pure", - "virtual": false, - "visibility": "public" - }, - { - "body": - { - "id": 127, - "nodeType": "Block", - "src": "1014:23:0", - "statements": - [ - { - "expression": - { - "commonType": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 125, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": - { - "id": 123, - "name": "x", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 116, - "src": "1024:1:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "<<", - "rightExpression": - { - "id": 124, - "name": "y", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 118, - "src": "1029:1:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "1024:6:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "functionReturnParameters": 122, - "id": 126, - "nodeType": "Return", - "src": "1017:13:0" - } - ] - }, - "functionSelector": "5d58009c", - "id": 128, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "mySAL", - "nameLocation": "956:5:0", - "nodeType": "FunctionDefinition", - "parameters": - { - "id": 119, - "nodeType": "ParameterList", - "parameters": - [ - { - "constant": false, - "id": 116, - "mutability": "mutable", - "name": "x", - "nameLocation": "970:1:0", - "nodeType": "VariableDeclaration", - "scope": 128, - "src": "962:9:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": - { - "id": 115, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "962:7:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 118, - "mutability": "mutable", - "name": "y", - "nameLocation": "981:1:0", - "nodeType": "VariableDeclaration", - "scope": 128, - "src": "973:9:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": - { - "id": 117, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "973:7:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - } - ], - "src": "961:22:0" - }, - "returnParameters": - { - "id": 122, - "nodeType": "ParameterList", - "parameters": - [ - { - "constant": false, - "id": 121, - "mutability": "mutable", - "name": "", - "nameLocation": "-1:-1:-1", - "nodeType": "VariableDeclaration", - "scope": 128, - "src": "1005:7:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": - { - "id": 120, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "1005:7:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - } - ], - "src": "1004:9:0" - }, - "scope": 143, - "src": "947:90:0", - "stateMutability": "pure", - "virtual": false, - "visibility": "public" - }, - { - "body": - { - "id": 141, - "nodeType": "Block", - "src": "1110:23:0", - "statements": - [ - { - "expression": - { - "commonType": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 139, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": - { - "id": 137, - "name": "x", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 130, - "src": "1120:1:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": ">>", - "rightExpression": - { - "id": 138, - "name": "y", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 132, - "src": "1125:1:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "1120:6:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "functionReturnParameters": 136, - "id": 140, - "nodeType": "Return", - "src": "1113:13:0" - } - ] - }, - "functionSelector": "ad6b48dc", - "id": 142, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "mySAR", - "nameLocation": "1052:5:0", - "nodeType": "FunctionDefinition", - "parameters": - { - "id": 133, - "nodeType": "ParameterList", - "parameters": - [ - { - "constant": false, - "id": 130, - "mutability": "mutable", - "name": "x", - "nameLocation": "1066:1:0", - "nodeType": "VariableDeclaration", - "scope": 142, - "src": "1058:9:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": - { - "id": 129, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "1058:7:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 132, - "mutability": "mutable", - "name": "y", - "nameLocation": "1077:1:0", - "nodeType": "VariableDeclaration", - "scope": 142, - "src": "1069:9:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": - { - "id": 131, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "1069:7:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - } - ], - "src": "1057:22:0" - }, - "returnParameters": - { - "id": 136, - "nodeType": "ParameterList", - "parameters": - [ - { - "constant": false, - "id": 135, - "mutability": "mutable", - "name": "", - "nameLocation": "-1:-1:-1", - "nodeType": "VariableDeclaration", - "scope": 142, - "src": "1101:7:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": - { - "id": 134, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "1101:7:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - } - ], - "src": "1100:9:0" - }, - "scope": 143, - "src": "1043:90:0", - "stateMutability": "pure", - "virtual": false, - "visibility": "public" - } - ], - "scope": 144, - "src": "100:1035:0", - "usedErrors": [] - } - ], - "src": "41:1095:0" -} \ No newline at end of file diff --git a/resources/regressions/all.json/input_json/UnaryOperatorMutation.sol_json.ast b/resources/regressions/all.json/input_json/UnaryOperatorMutation.sol_json.ast deleted file mode 100644 index 3bea73e..0000000 --- a/resources/regressions/all.json/input_json/UnaryOperatorMutation.sol_json.ast +++ /dev/null @@ -1,794 +0,0 @@ -{ - "absolutePath": "benchmarks/UnaryOperatorMutation/UnaryOperatorMutation.sol", - "exportedSymbols": - { - "UnaryOperatorMutation": - [ - 62 - ] - }, - "id": 63, - "license": "GPL-3.0-only", - "nodeType": "SourceUnit", - "nodes": - [ - { - "id": 1, - "literals": - [ - "solidity", - ">", - "0.7", - ".0" - ], - "nodeType": "PragmaDirective", - "src": "41:23:0" - }, - { - "id": 2, - "literals": - [ - "experimental", - "ABIEncoderV2" - ], - "nodeType": "PragmaDirective", - "src": "65:33:0" - }, - { - "abstract": false, - "baseContracts": [], - "canonicalName": "UnaryOperatorMutation", - "contractDependencies": [], - "contractKind": "contract", - "fullyImplemented": true, - "id": 62, - "linearizedBaseContracts": - [ - 62 - ], - "name": "UnaryOperatorMutation", - "nameLocation": "109:21:0", - "nodeType": "ContractDefinition", - "nodes": - [ - { - "body": - { - "id": 12, - "nodeType": "Block", - "src": "200:20:0", - "statements": - [ - { - "expression": - { - "id": 10, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "nodeType": "UnaryOperation", - "operator": "~", - "prefix": true, - "src": "210:3:0", - "subExpression": - { - "id": 9, - "name": "x", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4, - "src": "212:1:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "functionReturnParameters": 8, - "id": 11, - "nodeType": "Return", - "src": "203:10:0" - } - ] - }, - "functionSelector": "e35bee10", - "id": 13, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "myBitwiseNeg", - "nameLocation": "146:12:0", - "nodeType": "FunctionDefinition", - "parameters": - { - "id": 5, - "nodeType": "ParameterList", - "parameters": - [ - { - "constant": false, - "id": 4, - "mutability": "mutable", - "name": "x", - "nameLocation": "167:1:0", - "nodeType": "VariableDeclaration", - "scope": 13, - "src": "159:9:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": - { - "id": 3, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "159:7:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - } - ], - "src": "158:11:0" - }, - "returnParameters": - { - "id": 8, - "nodeType": "ParameterList", - "parameters": - [ - { - "constant": false, - "id": 7, - "mutability": "mutable", - "name": "", - "nameLocation": "-1:-1:-1", - "nodeType": "VariableDeclaration", - "scope": 13, - "src": "191:7:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": - { - "id": 6, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "191:7:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - } - ], - "src": "190:9:0" - }, - "scope": 62, - "src": "137:83:0", - "stateMutability": "pure", - "virtual": false, - "visibility": "public" - }, - { - "body": - { - "id": 23, - "nodeType": "Block", - "src": "289:20:0", - "statements": - [ - { - "expression": - { - "id": 21, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "nodeType": "UnaryOperation", - "operator": "++", - "prefix": true, - "src": "299:3:0", - "subExpression": - { - "id": 20, - "name": "x", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 15, - "src": "301:1:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "functionReturnParameters": 19, - "id": 22, - "nodeType": "Return", - "src": "292:10:0" - } - ] - }, - "functionSelector": "e7e69a10", - "id": 24, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "myPrefixIncr", - "nameLocation": "235:12:0", - "nodeType": "FunctionDefinition", - "parameters": - { - "id": 16, - "nodeType": "ParameterList", - "parameters": - [ - { - "constant": false, - "id": 15, - "mutability": "mutable", - "name": "x", - "nameLocation": "256:1:0", - "nodeType": "VariableDeclaration", - "scope": 24, - "src": "248:9:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": - { - "id": 14, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "248:7:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - } - ], - "src": "247:11:0" - }, - "returnParameters": - { - "id": 19, - "nodeType": "ParameterList", - "parameters": - [ - { - "constant": false, - "id": 18, - "mutability": "mutable", - "name": "", - "nameLocation": "-1:-1:-1", - "nodeType": "VariableDeclaration", - "scope": 24, - "src": "280:7:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": - { - "id": 17, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "280:7:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - } - ], - "src": "279:9:0" - }, - "scope": 62, - "src": "226:83:0", - "stateMutability": "pure", - "virtual": false, - "visibility": "public" - }, - { - "body": - { - "id": 34, - "nodeType": "Block", - "src": "378:20:0", - "statements": - [ - { - "expression": - { - "id": 32, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "nodeType": "UnaryOperation", - "operator": "--", - "prefix": true, - "src": "388:3:0", - "subExpression": - { - "id": 31, - "name": "x", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 26, - "src": "390:1:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "functionReturnParameters": 30, - "id": 33, - "nodeType": "Return", - "src": "381:10:0" - } - ] - }, - "functionSelector": "46df6da2", - "id": 35, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "myPrefixDecr", - "nameLocation": "324:12:0", - "nodeType": "FunctionDefinition", - "parameters": - { - "id": 27, - "nodeType": "ParameterList", - "parameters": - [ - { - "constant": false, - "id": 26, - "mutability": "mutable", - "name": "x", - "nameLocation": "345:1:0", - "nodeType": "VariableDeclaration", - "scope": 35, - "src": "337:9:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": - { - "id": 25, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "337:7:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - } - ], - "src": "336:11:0" - }, - "returnParameters": - { - "id": 30, - "nodeType": "ParameterList", - "parameters": - [ - { - "constant": false, - "id": 29, - "mutability": "mutable", - "name": "", - "nameLocation": "-1:-1:-1", - "nodeType": "VariableDeclaration", - "scope": 35, - "src": "369:7:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": - { - "id": 28, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "369:7:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - } - ], - "src": "368:9:0" - }, - "scope": 62, - "src": "315:83:0", - "stateMutability": "pure", - "virtual": false, - "visibility": "public" - }, - { - "body": - { - "id": 47, - "nodeType": "Block", - "src": "467:24:0", - "statements": - [ - { - "expression": - { - "id": 43, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "nodeType": "UnaryOperation", - "operator": "++", - "prefix": false, - "src": "470:3:0", - "subExpression": - { - "id": 42, - "name": "x", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 37, - "src": "470:1:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 44, - "nodeType": "ExpressionStatement", - "src": "470:3:0" - }, - { - "expression": - { - "id": 45, - "name": "x", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 37, - "src": "483:1:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "functionReturnParameters": 41, - "id": 46, - "nodeType": "Return", - "src": "476:8:0" - } - ] - }, - "functionSelector": "4b46ab44", - "id": 48, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "mySuffixIncr", - "nameLocation": "413:12:0", - "nodeType": "FunctionDefinition", - "parameters": - { - "id": 38, - "nodeType": "ParameterList", - "parameters": - [ - { - "constant": false, - "id": 37, - "mutability": "mutable", - "name": "x", - "nameLocation": "434:1:0", - "nodeType": "VariableDeclaration", - "scope": 48, - "src": "426:9:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": - { - "id": 36, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "426:7:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - } - ], - "src": "425:11:0" - }, - "returnParameters": - { - "id": 41, - "nodeType": "ParameterList", - "parameters": - [ - { - "constant": false, - "id": 40, - "mutability": "mutable", - "name": "", - "nameLocation": "-1:-1:-1", - "nodeType": "VariableDeclaration", - "scope": 48, - "src": "458:7:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": - { - "id": 39, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "458:7:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - } - ], - "src": "457:9:0" - }, - "scope": 62, - "src": "404:87:0", - "stateMutability": "pure", - "virtual": false, - "visibility": "public" - }, - { - "body": - { - "id": 60, - "nodeType": "Block", - "src": "560:24:0", - "statements": - [ - { - "expression": - { - "id": 56, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "nodeType": "UnaryOperation", - "operator": "--", - "prefix": false, - "src": "563:3:0", - "subExpression": - { - "id": 55, - "name": "x", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 50, - "src": "563:1:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 57, - "nodeType": "ExpressionStatement", - "src": "563:3:0" - }, - { - "expression": - { - "id": 58, - "name": "x", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 50, - "src": "576:1:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "functionReturnParameters": 54, - "id": 59, - "nodeType": "Return", - "src": "569:8:0" - } - ] - }, - "functionSelector": "cb3edb42", - "id": 61, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "mySuffixDecr", - "nameLocation": "506:12:0", - "nodeType": "FunctionDefinition", - "parameters": - { - "id": 51, - "nodeType": "ParameterList", - "parameters": - [ - { - "constant": false, - "id": 50, - "mutability": "mutable", - "name": "x", - "nameLocation": "527:1:0", - "nodeType": "VariableDeclaration", - "scope": 61, - "src": "519:9:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": - { - "id": 49, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "519:7:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - } - ], - "src": "518:11:0" - }, - "returnParameters": - { - "id": 54, - "nodeType": "ParameterList", - "parameters": - [ - { - "constant": false, - "id": 53, - "mutability": "mutable", - "name": "", - "nameLocation": "-1:-1:-1", - "nodeType": "VariableDeclaration", - "scope": 61, - "src": "551:7:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": - { - "id": 52, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "551:7:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - } - ], - "src": "550:9:0" - }, - "scope": 62, - "src": "497:87:0", - "stateMutability": "pure", - "virtual": false, - "visibility": "public" - } - ], - "scope": 63, - "src": "100:486:0", - "usedErrors": [] - } - ], - "src": "41:546:0" -} \ No newline at end of file diff --git a/resources/regressions/all.json/input_json/UnaryOperatorMutation.sol_json.ast.json b/resources/regressions/all.json/input_json/UnaryOperatorMutation.sol_json.ast.json deleted file mode 100644 index 3bea73e..0000000 --- a/resources/regressions/all.json/input_json/UnaryOperatorMutation.sol_json.ast.json +++ /dev/null @@ -1,794 +0,0 @@ -{ - "absolutePath": "benchmarks/UnaryOperatorMutation/UnaryOperatorMutation.sol", - "exportedSymbols": - { - "UnaryOperatorMutation": - [ - 62 - ] - }, - "id": 63, - "license": "GPL-3.0-only", - "nodeType": "SourceUnit", - "nodes": - [ - { - "id": 1, - "literals": - [ - "solidity", - ">", - "0.7", - ".0" - ], - "nodeType": "PragmaDirective", - "src": "41:23:0" - }, - { - "id": 2, - "literals": - [ - "experimental", - "ABIEncoderV2" - ], - "nodeType": "PragmaDirective", - "src": "65:33:0" - }, - { - "abstract": false, - "baseContracts": [], - "canonicalName": "UnaryOperatorMutation", - "contractDependencies": [], - "contractKind": "contract", - "fullyImplemented": true, - "id": 62, - "linearizedBaseContracts": - [ - 62 - ], - "name": "UnaryOperatorMutation", - "nameLocation": "109:21:0", - "nodeType": "ContractDefinition", - "nodes": - [ - { - "body": - { - "id": 12, - "nodeType": "Block", - "src": "200:20:0", - "statements": - [ - { - "expression": - { - "id": 10, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "nodeType": "UnaryOperation", - "operator": "~", - "prefix": true, - "src": "210:3:0", - "subExpression": - { - "id": 9, - "name": "x", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4, - "src": "212:1:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "functionReturnParameters": 8, - "id": 11, - "nodeType": "Return", - "src": "203:10:0" - } - ] - }, - "functionSelector": "e35bee10", - "id": 13, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "myBitwiseNeg", - "nameLocation": "146:12:0", - "nodeType": "FunctionDefinition", - "parameters": - { - "id": 5, - "nodeType": "ParameterList", - "parameters": - [ - { - "constant": false, - "id": 4, - "mutability": "mutable", - "name": "x", - "nameLocation": "167:1:0", - "nodeType": "VariableDeclaration", - "scope": 13, - "src": "159:9:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": - { - "id": 3, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "159:7:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - } - ], - "src": "158:11:0" - }, - "returnParameters": - { - "id": 8, - "nodeType": "ParameterList", - "parameters": - [ - { - "constant": false, - "id": 7, - "mutability": "mutable", - "name": "", - "nameLocation": "-1:-1:-1", - "nodeType": "VariableDeclaration", - "scope": 13, - "src": "191:7:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": - { - "id": 6, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "191:7:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - } - ], - "src": "190:9:0" - }, - "scope": 62, - "src": "137:83:0", - "stateMutability": "pure", - "virtual": false, - "visibility": "public" - }, - { - "body": - { - "id": 23, - "nodeType": "Block", - "src": "289:20:0", - "statements": - [ - { - "expression": - { - "id": 21, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "nodeType": "UnaryOperation", - "operator": "++", - "prefix": true, - "src": "299:3:0", - "subExpression": - { - "id": 20, - "name": "x", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 15, - "src": "301:1:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "functionReturnParameters": 19, - "id": 22, - "nodeType": "Return", - "src": "292:10:0" - } - ] - }, - "functionSelector": "e7e69a10", - "id": 24, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "myPrefixIncr", - "nameLocation": "235:12:0", - "nodeType": "FunctionDefinition", - "parameters": - { - "id": 16, - "nodeType": "ParameterList", - "parameters": - [ - { - "constant": false, - "id": 15, - "mutability": "mutable", - "name": "x", - "nameLocation": "256:1:0", - "nodeType": "VariableDeclaration", - "scope": 24, - "src": "248:9:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": - { - "id": 14, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "248:7:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - } - ], - "src": "247:11:0" - }, - "returnParameters": - { - "id": 19, - "nodeType": "ParameterList", - "parameters": - [ - { - "constant": false, - "id": 18, - "mutability": "mutable", - "name": "", - "nameLocation": "-1:-1:-1", - "nodeType": "VariableDeclaration", - "scope": 24, - "src": "280:7:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": - { - "id": 17, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "280:7:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - } - ], - "src": "279:9:0" - }, - "scope": 62, - "src": "226:83:0", - "stateMutability": "pure", - "virtual": false, - "visibility": "public" - }, - { - "body": - { - "id": 34, - "nodeType": "Block", - "src": "378:20:0", - "statements": - [ - { - "expression": - { - "id": 32, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "nodeType": "UnaryOperation", - "operator": "--", - "prefix": true, - "src": "388:3:0", - "subExpression": - { - "id": 31, - "name": "x", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 26, - "src": "390:1:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "functionReturnParameters": 30, - "id": 33, - "nodeType": "Return", - "src": "381:10:0" - } - ] - }, - "functionSelector": "46df6da2", - "id": 35, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "myPrefixDecr", - "nameLocation": "324:12:0", - "nodeType": "FunctionDefinition", - "parameters": - { - "id": 27, - "nodeType": "ParameterList", - "parameters": - [ - { - "constant": false, - "id": 26, - "mutability": "mutable", - "name": "x", - "nameLocation": "345:1:0", - "nodeType": "VariableDeclaration", - "scope": 35, - "src": "337:9:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": - { - "id": 25, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "337:7:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - } - ], - "src": "336:11:0" - }, - "returnParameters": - { - "id": 30, - "nodeType": "ParameterList", - "parameters": - [ - { - "constant": false, - "id": 29, - "mutability": "mutable", - "name": "", - "nameLocation": "-1:-1:-1", - "nodeType": "VariableDeclaration", - "scope": 35, - "src": "369:7:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": - { - "id": 28, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "369:7:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - } - ], - "src": "368:9:0" - }, - "scope": 62, - "src": "315:83:0", - "stateMutability": "pure", - "virtual": false, - "visibility": "public" - }, - { - "body": - { - "id": 47, - "nodeType": "Block", - "src": "467:24:0", - "statements": - [ - { - "expression": - { - "id": 43, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "nodeType": "UnaryOperation", - "operator": "++", - "prefix": false, - "src": "470:3:0", - "subExpression": - { - "id": 42, - "name": "x", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 37, - "src": "470:1:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 44, - "nodeType": "ExpressionStatement", - "src": "470:3:0" - }, - { - "expression": - { - "id": 45, - "name": "x", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 37, - "src": "483:1:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "functionReturnParameters": 41, - "id": 46, - "nodeType": "Return", - "src": "476:8:0" - } - ] - }, - "functionSelector": "4b46ab44", - "id": 48, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "mySuffixIncr", - "nameLocation": "413:12:0", - "nodeType": "FunctionDefinition", - "parameters": - { - "id": 38, - "nodeType": "ParameterList", - "parameters": - [ - { - "constant": false, - "id": 37, - "mutability": "mutable", - "name": "x", - "nameLocation": "434:1:0", - "nodeType": "VariableDeclaration", - "scope": 48, - "src": "426:9:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": - { - "id": 36, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "426:7:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - } - ], - "src": "425:11:0" - }, - "returnParameters": - { - "id": 41, - "nodeType": "ParameterList", - "parameters": - [ - { - "constant": false, - "id": 40, - "mutability": "mutable", - "name": "", - "nameLocation": "-1:-1:-1", - "nodeType": "VariableDeclaration", - "scope": 48, - "src": "458:7:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": - { - "id": 39, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "458:7:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - } - ], - "src": "457:9:0" - }, - "scope": 62, - "src": "404:87:0", - "stateMutability": "pure", - "virtual": false, - "visibility": "public" - }, - { - "body": - { - "id": 60, - "nodeType": "Block", - "src": "560:24:0", - "statements": - [ - { - "expression": - { - "id": 56, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "nodeType": "UnaryOperation", - "operator": "--", - "prefix": false, - "src": "563:3:0", - "subExpression": - { - "id": 55, - "name": "x", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 50, - "src": "563:1:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 57, - "nodeType": "ExpressionStatement", - "src": "563:3:0" - }, - { - "expression": - { - "id": 58, - "name": "x", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 50, - "src": "576:1:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "functionReturnParameters": 54, - "id": 59, - "nodeType": "Return", - "src": "569:8:0" - } - ] - }, - "functionSelector": "cb3edb42", - "id": 61, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "mySuffixDecr", - "nameLocation": "506:12:0", - "nodeType": "FunctionDefinition", - "parameters": - { - "id": 51, - "nodeType": "ParameterList", - "parameters": - [ - { - "constant": false, - "id": 50, - "mutability": "mutable", - "name": "x", - "nameLocation": "527:1:0", - "nodeType": "VariableDeclaration", - "scope": 61, - "src": "519:9:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": - { - "id": 49, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "519:7:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - } - ], - "src": "518:11:0" - }, - "returnParameters": - { - "id": 54, - "nodeType": "ParameterList", - "parameters": - [ - { - "constant": false, - "id": 53, - "mutability": "mutable", - "name": "", - "nameLocation": "-1:-1:-1", - "nodeType": "VariableDeclaration", - "scope": 61, - "src": "551:7:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": - { - "id": 52, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "551:7:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - } - ], - "src": "550:9:0" - }, - "scope": 62, - "src": "497:87:0", - "stateMutability": "pure", - "virtual": false, - "visibility": "public" - } - ], - "scope": 63, - "src": "100:486:0", - "usedErrors": [] - } - ], - "src": "41:546:0" -} \ No newline at end of file diff --git a/resources/regressions/all.json/mutants.log b/resources/regressions/all.json/mutants.log deleted file mode 100644 index 1fca8ad..0000000 --- a/resources/regressions/all.json/mutants.log +++ /dev/null @@ -1,67 +0,0 @@ -1,BinaryOpMutation,BinaryOpMutation/BinaryOpMutation.sol,7:10, + ,- -2,BinaryOpMutation,BinaryOpMutation/BinaryOpMutation.sol,7:10, + ,* -3,BinaryOpMutation,BinaryOpMutation/BinaryOpMutation.sol,7:10, + ,/ -4,BinaryOpMutation,BinaryOpMutation/BinaryOpMutation.sol,7:10, + ,% -5,BinaryOpMutation,BinaryOpMutation/BinaryOpMutation.sol,7:10, + ,** -6,BinaryOpMutation,BinaryOpMutation/BinaryOpMutation.sol,11:10, - ,+ -7,BinaryOpMutation,BinaryOpMutation/BinaryOpMutation.sol,11:10, - ,* -8,BinaryOpMutation,BinaryOpMutation/BinaryOpMutation.sol,11:10, - ,/ -9,BinaryOpMutation,BinaryOpMutation/BinaryOpMutation.sol,11:10, - ,% -10,BinaryOpMutation,BinaryOpMutation/BinaryOpMutation.sol,11:10, - ,** -11,BinaryOpMutation,BinaryOpMutation/BinaryOpMutation.sol,15:10, * ,+ -12,BinaryOpMutation,BinaryOpMutation/BinaryOpMutation.sol,15:10, * ,- -13,BinaryOpMutation,BinaryOpMutation/BinaryOpMutation.sol,15:10, * ,/ -14,BinaryOpMutation,BinaryOpMutation/BinaryOpMutation.sol,15:10, * ,% -15,BinaryOpMutation,BinaryOpMutation/BinaryOpMutation.sol,15:10, * ,** -16,BinaryOpMutation,BinaryOpMutation/BinaryOpMutation.sol,19:10, / ,+ -17,BinaryOpMutation,BinaryOpMutation/BinaryOpMutation.sol,19:10, / ,- -18,BinaryOpMutation,BinaryOpMutation/BinaryOpMutation.sol,19:10, / ,* -19,BinaryOpMutation,BinaryOpMutation/BinaryOpMutation.sol,19:10, / ,% -20,BinaryOpMutation,BinaryOpMutation/BinaryOpMutation.sol,19:10, / ,** -21,BinaryOpMutation,BinaryOpMutation/BinaryOpMutation.sol,23:10, % ,+ -22,BinaryOpMutation,BinaryOpMutation/BinaryOpMutation.sol,23:10, % ,- -23,BinaryOpMutation,BinaryOpMutation/BinaryOpMutation.sol,23:10, % ,* -24,BinaryOpMutation,BinaryOpMutation/BinaryOpMutation.sol,23:10, % ,/ -25,BinaryOpMutation,BinaryOpMutation/BinaryOpMutation.sol,23:10, % ,** -26,BinaryOpMutation,BinaryOpMutation/BinaryOpMutation.sol,27:10, ** ,+ -27,BinaryOpMutation,BinaryOpMutation/BinaryOpMutation.sol,27:10, ** ,- -28,BinaryOpMutation,BinaryOpMutation/BinaryOpMutation.sol,27:10, ** ,* -29,BinaryOpMutation,BinaryOpMutation/BinaryOpMutation.sol,27:10, ** ,/ -30,BinaryOpMutation,BinaryOpMutation/BinaryOpMutation.sol,27:10, ** ,% -31,RequireMutation,RequireMutation/RequireMutation.sol,7:10,cond1,true -32,RequireMutation,RequireMutation/RequireMutation.sol,7:10,cond1,false -33,RequireMutation,RequireMutation/RequireMutation.sol,8:10,cond2,true -34,RequireMutation,RequireMutation/RequireMutation.sol,8:10,cond2,false -35,RequireMutation,RequireMutation/RequireMutation.sol,9:10,cond3,true -36,RequireMutation,RequireMutation/RequireMutation.sol,9:10,cond3,false -37,AssignmentMutation,AssignmentMutation/AssignmentMutation.sol,13:6,42,0 -38,AssignmentMutation,AssignmentMutation/AssignmentMutation.sol,13:6,42,1 -39,AssignmentMutation,AssignmentMutation/AssignmentMutation.sol,14:6,13,0 -40,AssignmentMutation,AssignmentMutation/AssignmentMutation.sol,14:6,13,1 -41,AssignmentMutation,AssignmentMutation/AssignmentMutation.sol,15:6,3110,0 -42,AssignmentMutation,AssignmentMutation/AssignmentMutation.sol,15:6,3110,1 -43,AssignmentMutation,AssignmentMutation/AssignmentMutation.sol,16:6,true,false -44,AssignmentMutation,AssignmentMutation/AssignmentMutation.sol,17:6,false,true -45,DeleteExpressionMutation,DeleteExpressionMutation/DeleteExpressionMutation.sol,10:6,result ++,assert(true) -46,DeleteExpressionMutation,DeleteExpressionMutation/DeleteExpressionMutation.sol,9:29,i++,assert(true) -47,IfStatementMutation,IfStatementMutation/IfStatementMutation.sol,7:6,a,true -48,IfStatementMutation,IfStatementMutation/IfStatementMutation.sol,7:6,a,false -49,SwapArgumentsOperatorMutation,SwapArgumentsOperatorMutation/SwapArgumentsOperatorMutation.sol,7:9,x - y,y - x -50,SwapArgumentsOperatorMutation,SwapArgumentsOperatorMutation/SwapArgumentsOperatorMutation.sol,11:9,x / y,y / x -51,SwapArgumentsOperatorMutation,SwapArgumentsOperatorMutation/SwapArgumentsOperatorMutation.sol,15:9,x % y,y % x -52,SwapArgumentsOperatorMutation,SwapArgumentsOperatorMutation/SwapArgumentsOperatorMutation.sol,19:9,x ** y,y ** x -53,SwapArgumentsOperatorMutation,SwapArgumentsOperatorMutation/SwapArgumentsOperatorMutation.sol,23:9,x > y,y > x -54,SwapArgumentsOperatorMutation,SwapArgumentsOperatorMutation/SwapArgumentsOperatorMutation.sol,27:9,x < y,y < x -55,SwapArgumentsOperatorMutation,SwapArgumentsOperatorMutation/SwapArgumentsOperatorMutation.sol,31:9,x >= y,y >= x -56,SwapArgumentsOperatorMutation,SwapArgumentsOperatorMutation/SwapArgumentsOperatorMutation.sol,35:9,x <= y,y <= x -57,SwapArgumentsOperatorMutation,SwapArgumentsOperatorMutation/SwapArgumentsOperatorMutation.sol,39:9,x << y,y << x -58,SwapArgumentsOperatorMutation,SwapArgumentsOperatorMutation/SwapArgumentsOperatorMutation.sol,43:9,x >> y,y >> x -59,UnaryOperatorMutation,UnaryOperatorMutation/UnaryOperatorMutation.sol,7:9,~,++ -60,UnaryOperatorMutation,UnaryOperatorMutation/UnaryOperatorMutation.sol,7:9,~,-- -61,UnaryOperatorMutation,UnaryOperatorMutation/UnaryOperatorMutation.sol,11:9,++,-- -62,UnaryOperatorMutation,UnaryOperatorMutation/UnaryOperatorMutation.sol,11:9,++,~ -63,UnaryOperatorMutation,UnaryOperatorMutation/UnaryOperatorMutation.sol,15:9,--,++ -64,UnaryOperatorMutation,UnaryOperatorMutation/UnaryOperatorMutation.sol,15:9,--,~ -65,UnaryOperatorMutation,UnaryOperatorMutation/UnaryOperatorMutation.sol,19:3,++,-- -66,UnaryOperatorMutation,UnaryOperatorMutation/UnaryOperatorMutation.sol,24:3,--,++ -67,ElimDelegateMutation,ElimDelegateMutation/ElimDelegateMutation.sol,25:55,delegatecall,call diff --git a/resources/regressions/all.json/mutants/1/BinaryOpMutation/BinaryOpMutation.sol b/resources/regressions/all.json/mutants/1/BinaryOpMutation/BinaryOpMutation.sol deleted file mode 100644 index 00b5be3..0000000 --- a/resources/regressions/all.json/mutants/1/BinaryOpMutation/BinaryOpMutation.sol +++ /dev/null @@ -1,31 +0,0 @@ -// SPDX-License-Identifier: GPL-3.0-only -pragma solidity >0.7.0; -pragma experimental ABIEncoderV2; - -contract BinaryOpMutation { - function myAddition(uint256 x, uint256 y) public pure returns (uint256) { - /// BinaryOpMutation(`+` |==> `-`) of: `return x + y;` - return x-y; - } - - function mySubtraction(uint256 x, uint256 y) public pure returns (uint256) { - return x - y; - } - - function myMultiplication(uint256 x, uint256 y) public pure returns (uint256) { - return x * y; - } - - function myDivision(uint256 x, uint256 y) public pure returns (uint256) { - return x / y; - } - - function myModulo(uint256 x, uint256 y) public pure returns (uint256) { - return x % y; - } - - function myExponentiation(uint256 x, uint256 y) public pure returns (uint256) { - return x ** y; - } - -} diff --git a/resources/regressions/all.json/mutants/10/BinaryOpMutation/BinaryOpMutation.sol b/resources/regressions/all.json/mutants/10/BinaryOpMutation/BinaryOpMutation.sol deleted file mode 100644 index 93f9697..0000000 --- a/resources/regressions/all.json/mutants/10/BinaryOpMutation/BinaryOpMutation.sol +++ /dev/null @@ -1,31 +0,0 @@ -// SPDX-License-Identifier: GPL-3.0-only -pragma solidity >0.7.0; -pragma experimental ABIEncoderV2; - -contract BinaryOpMutation { - function myAddition(uint256 x, uint256 y) public pure returns (uint256) { - return x + y; - } - - function mySubtraction(uint256 x, uint256 y) public pure returns (uint256) { - /// BinaryOpMutation(`-` |==> `**`) of: `return x - y;` - return x**y; - } - - function myMultiplication(uint256 x, uint256 y) public pure returns (uint256) { - return x * y; - } - - function myDivision(uint256 x, uint256 y) public pure returns (uint256) { - return x / y; - } - - function myModulo(uint256 x, uint256 y) public pure returns (uint256) { - return x % y; - } - - function myExponentiation(uint256 x, uint256 y) public pure returns (uint256) { - return x ** y; - } - -} diff --git a/resources/regressions/all.json/mutants/11/BinaryOpMutation/BinaryOpMutation.sol b/resources/regressions/all.json/mutants/11/BinaryOpMutation/BinaryOpMutation.sol deleted file mode 100644 index 6a44886..0000000 --- a/resources/regressions/all.json/mutants/11/BinaryOpMutation/BinaryOpMutation.sol +++ /dev/null @@ -1,31 +0,0 @@ -// SPDX-License-Identifier: GPL-3.0-only -pragma solidity >0.7.0; -pragma experimental ABIEncoderV2; - -contract BinaryOpMutation { - function myAddition(uint256 x, uint256 y) public pure returns (uint256) { - return x + y; - } - - function mySubtraction(uint256 x, uint256 y) public pure returns (uint256) { - return x - y; - } - - function myMultiplication(uint256 x, uint256 y) public pure returns (uint256) { - /// BinaryOpMutation(`*` |==> `+`) of: `return x * y;` - return x+y; - } - - function myDivision(uint256 x, uint256 y) public pure returns (uint256) { - return x / y; - } - - function myModulo(uint256 x, uint256 y) public pure returns (uint256) { - return x % y; - } - - function myExponentiation(uint256 x, uint256 y) public pure returns (uint256) { - return x ** y; - } - -} diff --git a/resources/regressions/all.json/mutants/12/BinaryOpMutation/BinaryOpMutation.sol b/resources/regressions/all.json/mutants/12/BinaryOpMutation/BinaryOpMutation.sol deleted file mode 100644 index e140e69..0000000 --- a/resources/regressions/all.json/mutants/12/BinaryOpMutation/BinaryOpMutation.sol +++ /dev/null @@ -1,31 +0,0 @@ -// SPDX-License-Identifier: GPL-3.0-only -pragma solidity >0.7.0; -pragma experimental ABIEncoderV2; - -contract BinaryOpMutation { - function myAddition(uint256 x, uint256 y) public pure returns (uint256) { - return x + y; - } - - function mySubtraction(uint256 x, uint256 y) public pure returns (uint256) { - return x - y; - } - - function myMultiplication(uint256 x, uint256 y) public pure returns (uint256) { - /// BinaryOpMutation(`*` |==> `-`) of: `return x * y;` - return x-y; - } - - function myDivision(uint256 x, uint256 y) public pure returns (uint256) { - return x / y; - } - - function myModulo(uint256 x, uint256 y) public pure returns (uint256) { - return x % y; - } - - function myExponentiation(uint256 x, uint256 y) public pure returns (uint256) { - return x ** y; - } - -} diff --git a/resources/regressions/all.json/mutants/13/BinaryOpMutation/BinaryOpMutation.sol b/resources/regressions/all.json/mutants/13/BinaryOpMutation/BinaryOpMutation.sol deleted file mode 100644 index 9311892..0000000 --- a/resources/regressions/all.json/mutants/13/BinaryOpMutation/BinaryOpMutation.sol +++ /dev/null @@ -1,31 +0,0 @@ -// SPDX-License-Identifier: GPL-3.0-only -pragma solidity >0.7.0; -pragma experimental ABIEncoderV2; - -contract BinaryOpMutation { - function myAddition(uint256 x, uint256 y) public pure returns (uint256) { - return x + y; - } - - function mySubtraction(uint256 x, uint256 y) public pure returns (uint256) { - return x - y; - } - - function myMultiplication(uint256 x, uint256 y) public pure returns (uint256) { - /// BinaryOpMutation(`*` |==> `/`) of: `return x * y;` - return x/y; - } - - function myDivision(uint256 x, uint256 y) public pure returns (uint256) { - return x / y; - } - - function myModulo(uint256 x, uint256 y) public pure returns (uint256) { - return x % y; - } - - function myExponentiation(uint256 x, uint256 y) public pure returns (uint256) { - return x ** y; - } - -} diff --git a/resources/regressions/all.json/mutants/14/BinaryOpMutation/BinaryOpMutation.sol b/resources/regressions/all.json/mutants/14/BinaryOpMutation/BinaryOpMutation.sol deleted file mode 100644 index 271f95f..0000000 --- a/resources/regressions/all.json/mutants/14/BinaryOpMutation/BinaryOpMutation.sol +++ /dev/null @@ -1,31 +0,0 @@ -// SPDX-License-Identifier: GPL-3.0-only -pragma solidity >0.7.0; -pragma experimental ABIEncoderV2; - -contract BinaryOpMutation { - function myAddition(uint256 x, uint256 y) public pure returns (uint256) { - return x + y; - } - - function mySubtraction(uint256 x, uint256 y) public pure returns (uint256) { - return x - y; - } - - function myMultiplication(uint256 x, uint256 y) public pure returns (uint256) { - /// BinaryOpMutation(`*` |==> `%`) of: `return x * y;` - return x%y; - } - - function myDivision(uint256 x, uint256 y) public pure returns (uint256) { - return x / y; - } - - function myModulo(uint256 x, uint256 y) public pure returns (uint256) { - return x % y; - } - - function myExponentiation(uint256 x, uint256 y) public pure returns (uint256) { - return x ** y; - } - -} diff --git a/resources/regressions/all.json/mutants/15/BinaryOpMutation/BinaryOpMutation.sol b/resources/regressions/all.json/mutants/15/BinaryOpMutation/BinaryOpMutation.sol deleted file mode 100644 index 3f76e84..0000000 --- a/resources/regressions/all.json/mutants/15/BinaryOpMutation/BinaryOpMutation.sol +++ /dev/null @@ -1,31 +0,0 @@ -// SPDX-License-Identifier: GPL-3.0-only -pragma solidity >0.7.0; -pragma experimental ABIEncoderV2; - -contract BinaryOpMutation { - function myAddition(uint256 x, uint256 y) public pure returns (uint256) { - return x + y; - } - - function mySubtraction(uint256 x, uint256 y) public pure returns (uint256) { - return x - y; - } - - function myMultiplication(uint256 x, uint256 y) public pure returns (uint256) { - /// BinaryOpMutation(`*` |==> `**`) of: `return x * y;` - return x**y; - } - - function myDivision(uint256 x, uint256 y) public pure returns (uint256) { - return x / y; - } - - function myModulo(uint256 x, uint256 y) public pure returns (uint256) { - return x % y; - } - - function myExponentiation(uint256 x, uint256 y) public pure returns (uint256) { - return x ** y; - } - -} diff --git a/resources/regressions/all.json/mutants/16/BinaryOpMutation/BinaryOpMutation.sol b/resources/regressions/all.json/mutants/16/BinaryOpMutation/BinaryOpMutation.sol deleted file mode 100644 index eca2d8c..0000000 --- a/resources/regressions/all.json/mutants/16/BinaryOpMutation/BinaryOpMutation.sol +++ /dev/null @@ -1,31 +0,0 @@ -// SPDX-License-Identifier: GPL-3.0-only -pragma solidity >0.7.0; -pragma experimental ABIEncoderV2; - -contract BinaryOpMutation { - function myAddition(uint256 x, uint256 y) public pure returns (uint256) { - return x + y; - } - - function mySubtraction(uint256 x, uint256 y) public pure returns (uint256) { - return x - y; - } - - function myMultiplication(uint256 x, uint256 y) public pure returns (uint256) { - return x * y; - } - - function myDivision(uint256 x, uint256 y) public pure returns (uint256) { - /// BinaryOpMutation(`/` |==> `+`) of: `return x / y;` - return x+y; - } - - function myModulo(uint256 x, uint256 y) public pure returns (uint256) { - return x % y; - } - - function myExponentiation(uint256 x, uint256 y) public pure returns (uint256) { - return x ** y; - } - -} diff --git a/resources/regressions/all.json/mutants/17/BinaryOpMutation/BinaryOpMutation.sol b/resources/regressions/all.json/mutants/17/BinaryOpMutation/BinaryOpMutation.sol deleted file mode 100644 index b3ae49a..0000000 --- a/resources/regressions/all.json/mutants/17/BinaryOpMutation/BinaryOpMutation.sol +++ /dev/null @@ -1,31 +0,0 @@ -// SPDX-License-Identifier: GPL-3.0-only -pragma solidity >0.7.0; -pragma experimental ABIEncoderV2; - -contract BinaryOpMutation { - function myAddition(uint256 x, uint256 y) public pure returns (uint256) { - return x + y; - } - - function mySubtraction(uint256 x, uint256 y) public pure returns (uint256) { - return x - y; - } - - function myMultiplication(uint256 x, uint256 y) public pure returns (uint256) { - return x * y; - } - - function myDivision(uint256 x, uint256 y) public pure returns (uint256) { - /// BinaryOpMutation(`/` |==> `-`) of: `return x / y;` - return x-y; - } - - function myModulo(uint256 x, uint256 y) public pure returns (uint256) { - return x % y; - } - - function myExponentiation(uint256 x, uint256 y) public pure returns (uint256) { - return x ** y; - } - -} diff --git a/resources/regressions/all.json/mutants/18/BinaryOpMutation/BinaryOpMutation.sol b/resources/regressions/all.json/mutants/18/BinaryOpMutation/BinaryOpMutation.sol deleted file mode 100644 index b674b19..0000000 --- a/resources/regressions/all.json/mutants/18/BinaryOpMutation/BinaryOpMutation.sol +++ /dev/null @@ -1,31 +0,0 @@ -// SPDX-License-Identifier: GPL-3.0-only -pragma solidity >0.7.0; -pragma experimental ABIEncoderV2; - -contract BinaryOpMutation { - function myAddition(uint256 x, uint256 y) public pure returns (uint256) { - return x + y; - } - - function mySubtraction(uint256 x, uint256 y) public pure returns (uint256) { - return x - y; - } - - function myMultiplication(uint256 x, uint256 y) public pure returns (uint256) { - return x * y; - } - - function myDivision(uint256 x, uint256 y) public pure returns (uint256) { - /// BinaryOpMutation(`/` |==> `*`) of: `return x / y;` - return x*y; - } - - function myModulo(uint256 x, uint256 y) public pure returns (uint256) { - return x % y; - } - - function myExponentiation(uint256 x, uint256 y) public pure returns (uint256) { - return x ** y; - } - -} diff --git a/resources/regressions/all.json/mutants/19/BinaryOpMutation/BinaryOpMutation.sol b/resources/regressions/all.json/mutants/19/BinaryOpMutation/BinaryOpMutation.sol deleted file mode 100644 index 12f0ac7..0000000 --- a/resources/regressions/all.json/mutants/19/BinaryOpMutation/BinaryOpMutation.sol +++ /dev/null @@ -1,31 +0,0 @@ -// SPDX-License-Identifier: GPL-3.0-only -pragma solidity >0.7.0; -pragma experimental ABIEncoderV2; - -contract BinaryOpMutation { - function myAddition(uint256 x, uint256 y) public pure returns (uint256) { - return x + y; - } - - function mySubtraction(uint256 x, uint256 y) public pure returns (uint256) { - return x - y; - } - - function myMultiplication(uint256 x, uint256 y) public pure returns (uint256) { - return x * y; - } - - function myDivision(uint256 x, uint256 y) public pure returns (uint256) { - /// BinaryOpMutation(`/` |==> `%`) of: `return x / y;` - return x%y; - } - - function myModulo(uint256 x, uint256 y) public pure returns (uint256) { - return x % y; - } - - function myExponentiation(uint256 x, uint256 y) public pure returns (uint256) { - return x ** y; - } - -} diff --git a/resources/regressions/all.json/mutants/2/BinaryOpMutation/BinaryOpMutation.sol b/resources/regressions/all.json/mutants/2/BinaryOpMutation/BinaryOpMutation.sol deleted file mode 100644 index e4a1f2d..0000000 --- a/resources/regressions/all.json/mutants/2/BinaryOpMutation/BinaryOpMutation.sol +++ /dev/null @@ -1,31 +0,0 @@ -// SPDX-License-Identifier: GPL-3.0-only -pragma solidity >0.7.0; -pragma experimental ABIEncoderV2; - -contract BinaryOpMutation { - function myAddition(uint256 x, uint256 y) public pure returns (uint256) { - /// BinaryOpMutation(`+` |==> `*`) of: `return x + y;` - return x*y; - } - - function mySubtraction(uint256 x, uint256 y) public pure returns (uint256) { - return x - y; - } - - function myMultiplication(uint256 x, uint256 y) public pure returns (uint256) { - return x * y; - } - - function myDivision(uint256 x, uint256 y) public pure returns (uint256) { - return x / y; - } - - function myModulo(uint256 x, uint256 y) public pure returns (uint256) { - return x % y; - } - - function myExponentiation(uint256 x, uint256 y) public pure returns (uint256) { - return x ** y; - } - -} diff --git a/resources/regressions/all.json/mutants/20/BinaryOpMutation/BinaryOpMutation.sol b/resources/regressions/all.json/mutants/20/BinaryOpMutation/BinaryOpMutation.sol deleted file mode 100644 index 87ca38a..0000000 --- a/resources/regressions/all.json/mutants/20/BinaryOpMutation/BinaryOpMutation.sol +++ /dev/null @@ -1,31 +0,0 @@ -// SPDX-License-Identifier: GPL-3.0-only -pragma solidity >0.7.0; -pragma experimental ABIEncoderV2; - -contract BinaryOpMutation { - function myAddition(uint256 x, uint256 y) public pure returns (uint256) { - return x + y; - } - - function mySubtraction(uint256 x, uint256 y) public pure returns (uint256) { - return x - y; - } - - function myMultiplication(uint256 x, uint256 y) public pure returns (uint256) { - return x * y; - } - - function myDivision(uint256 x, uint256 y) public pure returns (uint256) { - /// BinaryOpMutation(`/` |==> `**`) of: `return x / y;` - return x**y; - } - - function myModulo(uint256 x, uint256 y) public pure returns (uint256) { - return x % y; - } - - function myExponentiation(uint256 x, uint256 y) public pure returns (uint256) { - return x ** y; - } - -} diff --git a/resources/regressions/all.json/mutants/21/BinaryOpMutation/BinaryOpMutation.sol b/resources/regressions/all.json/mutants/21/BinaryOpMutation/BinaryOpMutation.sol deleted file mode 100644 index ad60708..0000000 --- a/resources/regressions/all.json/mutants/21/BinaryOpMutation/BinaryOpMutation.sol +++ /dev/null @@ -1,31 +0,0 @@ -// SPDX-License-Identifier: GPL-3.0-only -pragma solidity >0.7.0; -pragma experimental ABIEncoderV2; - -contract BinaryOpMutation { - function myAddition(uint256 x, uint256 y) public pure returns (uint256) { - return x + y; - } - - function mySubtraction(uint256 x, uint256 y) public pure returns (uint256) { - return x - y; - } - - function myMultiplication(uint256 x, uint256 y) public pure returns (uint256) { - return x * y; - } - - function myDivision(uint256 x, uint256 y) public pure returns (uint256) { - return x / y; - } - - function myModulo(uint256 x, uint256 y) public pure returns (uint256) { - /// BinaryOpMutation(`%` |==> `+`) of: `return x % y;` - return x+y; - } - - function myExponentiation(uint256 x, uint256 y) public pure returns (uint256) { - return x ** y; - } - -} diff --git a/resources/regressions/all.json/mutants/22/BinaryOpMutation/BinaryOpMutation.sol b/resources/regressions/all.json/mutants/22/BinaryOpMutation/BinaryOpMutation.sol deleted file mode 100644 index 1e8be32..0000000 --- a/resources/regressions/all.json/mutants/22/BinaryOpMutation/BinaryOpMutation.sol +++ /dev/null @@ -1,31 +0,0 @@ -// SPDX-License-Identifier: GPL-3.0-only -pragma solidity >0.7.0; -pragma experimental ABIEncoderV2; - -contract BinaryOpMutation { - function myAddition(uint256 x, uint256 y) public pure returns (uint256) { - return x + y; - } - - function mySubtraction(uint256 x, uint256 y) public pure returns (uint256) { - return x - y; - } - - function myMultiplication(uint256 x, uint256 y) public pure returns (uint256) { - return x * y; - } - - function myDivision(uint256 x, uint256 y) public pure returns (uint256) { - return x / y; - } - - function myModulo(uint256 x, uint256 y) public pure returns (uint256) { - /// BinaryOpMutation(`%` |==> `-`) of: `return x % y;` - return x-y; - } - - function myExponentiation(uint256 x, uint256 y) public pure returns (uint256) { - return x ** y; - } - -} diff --git a/resources/regressions/all.json/mutants/23/BinaryOpMutation/BinaryOpMutation.sol b/resources/regressions/all.json/mutants/23/BinaryOpMutation/BinaryOpMutation.sol deleted file mode 100644 index 147ceef..0000000 --- a/resources/regressions/all.json/mutants/23/BinaryOpMutation/BinaryOpMutation.sol +++ /dev/null @@ -1,31 +0,0 @@ -// SPDX-License-Identifier: GPL-3.0-only -pragma solidity >0.7.0; -pragma experimental ABIEncoderV2; - -contract BinaryOpMutation { - function myAddition(uint256 x, uint256 y) public pure returns (uint256) { - return x + y; - } - - function mySubtraction(uint256 x, uint256 y) public pure returns (uint256) { - return x - y; - } - - function myMultiplication(uint256 x, uint256 y) public pure returns (uint256) { - return x * y; - } - - function myDivision(uint256 x, uint256 y) public pure returns (uint256) { - return x / y; - } - - function myModulo(uint256 x, uint256 y) public pure returns (uint256) { - /// BinaryOpMutation(`%` |==> `*`) of: `return x % y;` - return x*y; - } - - function myExponentiation(uint256 x, uint256 y) public pure returns (uint256) { - return x ** y; - } - -} diff --git a/resources/regressions/all.json/mutants/24/BinaryOpMutation/BinaryOpMutation.sol b/resources/regressions/all.json/mutants/24/BinaryOpMutation/BinaryOpMutation.sol deleted file mode 100644 index 630af85..0000000 --- a/resources/regressions/all.json/mutants/24/BinaryOpMutation/BinaryOpMutation.sol +++ /dev/null @@ -1,31 +0,0 @@ -// SPDX-License-Identifier: GPL-3.0-only -pragma solidity >0.7.0; -pragma experimental ABIEncoderV2; - -contract BinaryOpMutation { - function myAddition(uint256 x, uint256 y) public pure returns (uint256) { - return x + y; - } - - function mySubtraction(uint256 x, uint256 y) public pure returns (uint256) { - return x - y; - } - - function myMultiplication(uint256 x, uint256 y) public pure returns (uint256) { - return x * y; - } - - function myDivision(uint256 x, uint256 y) public pure returns (uint256) { - return x / y; - } - - function myModulo(uint256 x, uint256 y) public pure returns (uint256) { - /// BinaryOpMutation(`%` |==> `/`) of: `return x % y;` - return x/y; - } - - function myExponentiation(uint256 x, uint256 y) public pure returns (uint256) { - return x ** y; - } - -} diff --git a/resources/regressions/all.json/mutants/25/BinaryOpMutation/BinaryOpMutation.sol b/resources/regressions/all.json/mutants/25/BinaryOpMutation/BinaryOpMutation.sol deleted file mode 100644 index 00b3bbb..0000000 --- a/resources/regressions/all.json/mutants/25/BinaryOpMutation/BinaryOpMutation.sol +++ /dev/null @@ -1,31 +0,0 @@ -// SPDX-License-Identifier: GPL-3.0-only -pragma solidity >0.7.0; -pragma experimental ABIEncoderV2; - -contract BinaryOpMutation { - function myAddition(uint256 x, uint256 y) public pure returns (uint256) { - return x + y; - } - - function mySubtraction(uint256 x, uint256 y) public pure returns (uint256) { - return x - y; - } - - function myMultiplication(uint256 x, uint256 y) public pure returns (uint256) { - return x * y; - } - - function myDivision(uint256 x, uint256 y) public pure returns (uint256) { - return x / y; - } - - function myModulo(uint256 x, uint256 y) public pure returns (uint256) { - /// BinaryOpMutation(`%` |==> `**`) of: `return x % y;` - return x**y; - } - - function myExponentiation(uint256 x, uint256 y) public pure returns (uint256) { - return x ** y; - } - -} diff --git a/resources/regressions/all.json/mutants/26/BinaryOpMutation/BinaryOpMutation.sol b/resources/regressions/all.json/mutants/26/BinaryOpMutation/BinaryOpMutation.sol deleted file mode 100644 index e41cda7..0000000 --- a/resources/regressions/all.json/mutants/26/BinaryOpMutation/BinaryOpMutation.sol +++ /dev/null @@ -1,31 +0,0 @@ -// SPDX-License-Identifier: GPL-3.0-only -pragma solidity >0.7.0; -pragma experimental ABIEncoderV2; - -contract BinaryOpMutation { - function myAddition(uint256 x, uint256 y) public pure returns (uint256) { - return x + y; - } - - function mySubtraction(uint256 x, uint256 y) public pure returns (uint256) { - return x - y; - } - - function myMultiplication(uint256 x, uint256 y) public pure returns (uint256) { - return x * y; - } - - function myDivision(uint256 x, uint256 y) public pure returns (uint256) { - return x / y; - } - - function myModulo(uint256 x, uint256 y) public pure returns (uint256) { - return x % y; - } - - function myExponentiation(uint256 x, uint256 y) public pure returns (uint256) { - /// BinaryOpMutation(`**` |==> `+`) of: `return x ** y;` - return x+y; - } - -} diff --git a/resources/regressions/all.json/mutants/27/BinaryOpMutation/BinaryOpMutation.sol b/resources/regressions/all.json/mutants/27/BinaryOpMutation/BinaryOpMutation.sol deleted file mode 100644 index 2027d61..0000000 --- a/resources/regressions/all.json/mutants/27/BinaryOpMutation/BinaryOpMutation.sol +++ /dev/null @@ -1,31 +0,0 @@ -// SPDX-License-Identifier: GPL-3.0-only -pragma solidity >0.7.0; -pragma experimental ABIEncoderV2; - -contract BinaryOpMutation { - function myAddition(uint256 x, uint256 y) public pure returns (uint256) { - return x + y; - } - - function mySubtraction(uint256 x, uint256 y) public pure returns (uint256) { - return x - y; - } - - function myMultiplication(uint256 x, uint256 y) public pure returns (uint256) { - return x * y; - } - - function myDivision(uint256 x, uint256 y) public pure returns (uint256) { - return x / y; - } - - function myModulo(uint256 x, uint256 y) public pure returns (uint256) { - return x % y; - } - - function myExponentiation(uint256 x, uint256 y) public pure returns (uint256) { - /// BinaryOpMutation(`**` |==> `-`) of: `return x ** y;` - return x-y; - } - -} diff --git a/resources/regressions/all.json/mutants/28/BinaryOpMutation/BinaryOpMutation.sol b/resources/regressions/all.json/mutants/28/BinaryOpMutation/BinaryOpMutation.sol deleted file mode 100644 index 66377db..0000000 --- a/resources/regressions/all.json/mutants/28/BinaryOpMutation/BinaryOpMutation.sol +++ /dev/null @@ -1,31 +0,0 @@ -// SPDX-License-Identifier: GPL-3.0-only -pragma solidity >0.7.0; -pragma experimental ABIEncoderV2; - -contract BinaryOpMutation { - function myAddition(uint256 x, uint256 y) public pure returns (uint256) { - return x + y; - } - - function mySubtraction(uint256 x, uint256 y) public pure returns (uint256) { - return x - y; - } - - function myMultiplication(uint256 x, uint256 y) public pure returns (uint256) { - return x * y; - } - - function myDivision(uint256 x, uint256 y) public pure returns (uint256) { - return x / y; - } - - function myModulo(uint256 x, uint256 y) public pure returns (uint256) { - return x % y; - } - - function myExponentiation(uint256 x, uint256 y) public pure returns (uint256) { - /// BinaryOpMutation(`**` |==> `*`) of: `return x ** y;` - return x*y; - } - -} diff --git a/resources/regressions/all.json/mutants/29/BinaryOpMutation/BinaryOpMutation.sol b/resources/regressions/all.json/mutants/29/BinaryOpMutation/BinaryOpMutation.sol deleted file mode 100644 index d771626..0000000 --- a/resources/regressions/all.json/mutants/29/BinaryOpMutation/BinaryOpMutation.sol +++ /dev/null @@ -1,31 +0,0 @@ -// SPDX-License-Identifier: GPL-3.0-only -pragma solidity >0.7.0; -pragma experimental ABIEncoderV2; - -contract BinaryOpMutation { - function myAddition(uint256 x, uint256 y) public pure returns (uint256) { - return x + y; - } - - function mySubtraction(uint256 x, uint256 y) public pure returns (uint256) { - return x - y; - } - - function myMultiplication(uint256 x, uint256 y) public pure returns (uint256) { - return x * y; - } - - function myDivision(uint256 x, uint256 y) public pure returns (uint256) { - return x / y; - } - - function myModulo(uint256 x, uint256 y) public pure returns (uint256) { - return x % y; - } - - function myExponentiation(uint256 x, uint256 y) public pure returns (uint256) { - /// BinaryOpMutation(`**` |==> `/`) of: `return x ** y;` - return x/y; - } - -} diff --git a/resources/regressions/all.json/mutants/3/BinaryOpMutation/BinaryOpMutation.sol b/resources/regressions/all.json/mutants/3/BinaryOpMutation/BinaryOpMutation.sol deleted file mode 100644 index e137257..0000000 --- a/resources/regressions/all.json/mutants/3/BinaryOpMutation/BinaryOpMutation.sol +++ /dev/null @@ -1,31 +0,0 @@ -// SPDX-License-Identifier: GPL-3.0-only -pragma solidity >0.7.0; -pragma experimental ABIEncoderV2; - -contract BinaryOpMutation { - function myAddition(uint256 x, uint256 y) public pure returns (uint256) { - /// BinaryOpMutation(`+` |==> `/`) of: `return x + y;` - return x/y; - } - - function mySubtraction(uint256 x, uint256 y) public pure returns (uint256) { - return x - y; - } - - function myMultiplication(uint256 x, uint256 y) public pure returns (uint256) { - return x * y; - } - - function myDivision(uint256 x, uint256 y) public pure returns (uint256) { - return x / y; - } - - function myModulo(uint256 x, uint256 y) public pure returns (uint256) { - return x % y; - } - - function myExponentiation(uint256 x, uint256 y) public pure returns (uint256) { - return x ** y; - } - -} diff --git a/resources/regressions/all.json/mutants/30/BinaryOpMutation/BinaryOpMutation.sol b/resources/regressions/all.json/mutants/30/BinaryOpMutation/BinaryOpMutation.sol deleted file mode 100644 index 082da37..0000000 --- a/resources/regressions/all.json/mutants/30/BinaryOpMutation/BinaryOpMutation.sol +++ /dev/null @@ -1,31 +0,0 @@ -// SPDX-License-Identifier: GPL-3.0-only -pragma solidity >0.7.0; -pragma experimental ABIEncoderV2; - -contract BinaryOpMutation { - function myAddition(uint256 x, uint256 y) public pure returns (uint256) { - return x + y; - } - - function mySubtraction(uint256 x, uint256 y) public pure returns (uint256) { - return x - y; - } - - function myMultiplication(uint256 x, uint256 y) public pure returns (uint256) { - return x * y; - } - - function myDivision(uint256 x, uint256 y) public pure returns (uint256) { - return x / y; - } - - function myModulo(uint256 x, uint256 y) public pure returns (uint256) { - return x % y; - } - - function myExponentiation(uint256 x, uint256 y) public pure returns (uint256) { - /// BinaryOpMutation(`**` |==> `%`) of: `return x ** y;` - return x%y; - } - -} diff --git a/resources/regressions/all.json/mutants/31/RequireMutation/RequireMutation.sol b/resources/regressions/all.json/mutants/31/RequireMutation/RequireMutation.sol deleted file mode 100644 index 0355a5c..0000000 --- a/resources/regressions/all.json/mutants/31/RequireMutation/RequireMutation.sol +++ /dev/null @@ -1,13 +0,0 @@ -// SPDX-License-Identifier: GPL-3.0-only -pragma solidity >0.7.0; -pragma experimental ABIEncoderV2; - -contract RequireMutation { - function myRequires(bool cond1, bool cond2, bool cond3) public pure returns (bool) { - /// RequireMutation(`cond1` |==> `true`) of: `require(cond1);` - require(true); - require(cond2); - require(cond3); - return true; - } -} diff --git a/resources/regressions/all.json/mutants/32/RequireMutation/RequireMutation.sol b/resources/regressions/all.json/mutants/32/RequireMutation/RequireMutation.sol deleted file mode 100644 index 838a0e4..0000000 --- a/resources/regressions/all.json/mutants/32/RequireMutation/RequireMutation.sol +++ /dev/null @@ -1,13 +0,0 @@ -// SPDX-License-Identifier: GPL-3.0-only -pragma solidity >0.7.0; -pragma experimental ABIEncoderV2; - -contract RequireMutation { - function myRequires(bool cond1, bool cond2, bool cond3) public pure returns (bool) { - /// RequireMutation(`cond1` |==> `false`) of: `require(cond1);` - require(false); - require(cond2); - require(cond3); - return true; - } -} diff --git a/resources/regressions/all.json/mutants/33/RequireMutation/RequireMutation.sol b/resources/regressions/all.json/mutants/33/RequireMutation/RequireMutation.sol deleted file mode 100644 index cf24ffc..0000000 --- a/resources/regressions/all.json/mutants/33/RequireMutation/RequireMutation.sol +++ /dev/null @@ -1,13 +0,0 @@ -// SPDX-License-Identifier: GPL-3.0-only -pragma solidity >0.7.0; -pragma experimental ABIEncoderV2; - -contract RequireMutation { - function myRequires(bool cond1, bool cond2, bool cond3) public pure returns (bool) { - require(cond1); - /// RequireMutation(`cond2` |==> `true`) of: `require(cond2);` - require(true); - require(cond3); - return true; - } -} diff --git a/resources/regressions/all.json/mutants/34/RequireMutation/RequireMutation.sol b/resources/regressions/all.json/mutants/34/RequireMutation/RequireMutation.sol deleted file mode 100644 index 0aa067e..0000000 --- a/resources/regressions/all.json/mutants/34/RequireMutation/RequireMutation.sol +++ /dev/null @@ -1,13 +0,0 @@ -// SPDX-License-Identifier: GPL-3.0-only -pragma solidity >0.7.0; -pragma experimental ABIEncoderV2; - -contract RequireMutation { - function myRequires(bool cond1, bool cond2, bool cond3) public pure returns (bool) { - require(cond1); - /// RequireMutation(`cond2` |==> `false`) of: `require(cond2);` - require(false); - require(cond3); - return true; - } -} diff --git a/resources/regressions/all.json/mutants/35/RequireMutation/RequireMutation.sol b/resources/regressions/all.json/mutants/35/RequireMutation/RequireMutation.sol deleted file mode 100644 index d6c8513..0000000 --- a/resources/regressions/all.json/mutants/35/RequireMutation/RequireMutation.sol +++ /dev/null @@ -1,13 +0,0 @@ -// SPDX-License-Identifier: GPL-3.0-only -pragma solidity >0.7.0; -pragma experimental ABIEncoderV2; - -contract RequireMutation { - function myRequires(bool cond1, bool cond2, bool cond3) public pure returns (bool) { - require(cond1); - require(cond2); - /// RequireMutation(`cond3` |==> `true`) of: `require(cond3);` - require(true); - return true; - } -} diff --git a/resources/regressions/all.json/mutants/36/RequireMutation/RequireMutation.sol b/resources/regressions/all.json/mutants/36/RequireMutation/RequireMutation.sol deleted file mode 100644 index a45e446..0000000 --- a/resources/regressions/all.json/mutants/36/RequireMutation/RequireMutation.sol +++ /dev/null @@ -1,13 +0,0 @@ -// SPDX-License-Identifier: GPL-3.0-only -pragma solidity >0.7.0; -pragma experimental ABIEncoderV2; - -contract RequireMutation { - function myRequires(bool cond1, bool cond2, bool cond3) public pure returns (bool) { - require(cond1); - require(cond2); - /// RequireMutation(`cond3` |==> `false`) of: `require(cond3);` - require(false); - return true; - } -} diff --git a/resources/regressions/all.json/mutants/37/AssignmentMutation/AssignmentMutation.sol b/resources/regressions/all.json/mutants/37/AssignmentMutation/AssignmentMutation.sol deleted file mode 100644 index 57a31c6..0000000 --- a/resources/regressions/all.json/mutants/37/AssignmentMutation/AssignmentMutation.sol +++ /dev/null @@ -1,20 +0,0 @@ -// SPDX-License-Identifier: GPL-3.0-only -pragma solidity >0.7.0; -pragma experimental ABIEncoderV2; - -contract AssignmentMutation { - uint256 public x; - uint256 public y; - uint256 public z; - bool public a; - bool public b; - - constructor() { - /// AssignmentMutation(`42` |==> `0`) of: `x = 42; // original: 42` - x = 0; // original: 42 - y = 13; // original: 13 - z = 3110; // original: 3110 - a = true; // original: true - b = false; // original: false - } -} diff --git a/resources/regressions/all.json/mutants/38/AssignmentMutation/AssignmentMutation.sol b/resources/regressions/all.json/mutants/38/AssignmentMutation/AssignmentMutation.sol deleted file mode 100644 index 7156738..0000000 --- a/resources/regressions/all.json/mutants/38/AssignmentMutation/AssignmentMutation.sol +++ /dev/null @@ -1,20 +0,0 @@ -// SPDX-License-Identifier: GPL-3.0-only -pragma solidity >0.7.0; -pragma experimental ABIEncoderV2; - -contract AssignmentMutation { - uint256 public x; - uint256 public y; - uint256 public z; - bool public a; - bool public b; - - constructor() { - /// AssignmentMutation(`42` |==> `1`) of: `x = 42; // original: 42` - x = 1; // original: 42 - y = 13; // original: 13 - z = 3110; // original: 3110 - a = true; // original: true - b = false; // original: false - } -} diff --git a/resources/regressions/all.json/mutants/39/AssignmentMutation/AssignmentMutation.sol b/resources/regressions/all.json/mutants/39/AssignmentMutation/AssignmentMutation.sol deleted file mode 100644 index 4974c0e..0000000 --- a/resources/regressions/all.json/mutants/39/AssignmentMutation/AssignmentMutation.sol +++ /dev/null @@ -1,20 +0,0 @@ -// SPDX-License-Identifier: GPL-3.0-only -pragma solidity >0.7.0; -pragma experimental ABIEncoderV2; - -contract AssignmentMutation { - uint256 public x; - uint256 public y; - uint256 public z; - bool public a; - bool public b; - - constructor() { - x = 42; // original: 42 - /// AssignmentMutation(`13` |==> `0`) of: `y = 13; // original: 13` - y = 0; // original: 13 - z = 3110; // original: 3110 - a = true; // original: true - b = false; // original: false - } -} diff --git a/resources/regressions/all.json/mutants/4/BinaryOpMutation/BinaryOpMutation.sol b/resources/regressions/all.json/mutants/4/BinaryOpMutation/BinaryOpMutation.sol deleted file mode 100644 index 8b77d90..0000000 --- a/resources/regressions/all.json/mutants/4/BinaryOpMutation/BinaryOpMutation.sol +++ /dev/null @@ -1,31 +0,0 @@ -// SPDX-License-Identifier: GPL-3.0-only -pragma solidity >0.7.0; -pragma experimental ABIEncoderV2; - -contract BinaryOpMutation { - function myAddition(uint256 x, uint256 y) public pure returns (uint256) { - /// BinaryOpMutation(`+` |==> `%`) of: `return x + y;` - return x%y; - } - - function mySubtraction(uint256 x, uint256 y) public pure returns (uint256) { - return x - y; - } - - function myMultiplication(uint256 x, uint256 y) public pure returns (uint256) { - return x * y; - } - - function myDivision(uint256 x, uint256 y) public pure returns (uint256) { - return x / y; - } - - function myModulo(uint256 x, uint256 y) public pure returns (uint256) { - return x % y; - } - - function myExponentiation(uint256 x, uint256 y) public pure returns (uint256) { - return x ** y; - } - -} diff --git a/resources/regressions/all.json/mutants/40/AssignmentMutation/AssignmentMutation.sol b/resources/regressions/all.json/mutants/40/AssignmentMutation/AssignmentMutation.sol deleted file mode 100644 index f7cf44b..0000000 --- a/resources/regressions/all.json/mutants/40/AssignmentMutation/AssignmentMutation.sol +++ /dev/null @@ -1,20 +0,0 @@ -// SPDX-License-Identifier: GPL-3.0-only -pragma solidity >0.7.0; -pragma experimental ABIEncoderV2; - -contract AssignmentMutation { - uint256 public x; - uint256 public y; - uint256 public z; - bool public a; - bool public b; - - constructor() { - x = 42; // original: 42 - /// AssignmentMutation(`13` |==> `1`) of: `y = 13; // original: 13` - y = 1; // original: 13 - z = 3110; // original: 3110 - a = true; // original: true - b = false; // original: false - } -} diff --git a/resources/regressions/all.json/mutants/41/AssignmentMutation/AssignmentMutation.sol b/resources/regressions/all.json/mutants/41/AssignmentMutation/AssignmentMutation.sol deleted file mode 100644 index 906162c..0000000 --- a/resources/regressions/all.json/mutants/41/AssignmentMutation/AssignmentMutation.sol +++ /dev/null @@ -1,20 +0,0 @@ -// SPDX-License-Identifier: GPL-3.0-only -pragma solidity >0.7.0; -pragma experimental ABIEncoderV2; - -contract AssignmentMutation { - uint256 public x; - uint256 public y; - uint256 public z; - bool public a; - bool public b; - - constructor() { - x = 42; // original: 42 - y = 13; // original: 13 - /// AssignmentMutation(`3110` |==> `0`) of: `z = 3110; // original: 3110` - z = 0; // original: 3110 - a = true; // original: true - b = false; // original: false - } -} diff --git a/resources/regressions/all.json/mutants/42/AssignmentMutation/AssignmentMutation.sol b/resources/regressions/all.json/mutants/42/AssignmentMutation/AssignmentMutation.sol deleted file mode 100644 index 9944eea..0000000 --- a/resources/regressions/all.json/mutants/42/AssignmentMutation/AssignmentMutation.sol +++ /dev/null @@ -1,20 +0,0 @@ -// SPDX-License-Identifier: GPL-3.0-only -pragma solidity >0.7.0; -pragma experimental ABIEncoderV2; - -contract AssignmentMutation { - uint256 public x; - uint256 public y; - uint256 public z; - bool public a; - bool public b; - - constructor() { - x = 42; // original: 42 - y = 13; // original: 13 - /// AssignmentMutation(`3110` |==> `1`) of: `z = 3110; // original: 3110` - z = 1; // original: 3110 - a = true; // original: true - b = false; // original: false - } -} diff --git a/resources/regressions/all.json/mutants/43/AssignmentMutation/AssignmentMutation.sol b/resources/regressions/all.json/mutants/43/AssignmentMutation/AssignmentMutation.sol deleted file mode 100644 index 5b65d36..0000000 --- a/resources/regressions/all.json/mutants/43/AssignmentMutation/AssignmentMutation.sol +++ /dev/null @@ -1,20 +0,0 @@ -// SPDX-License-Identifier: GPL-3.0-only -pragma solidity >0.7.0; -pragma experimental ABIEncoderV2; - -contract AssignmentMutation { - uint256 public x; - uint256 public y; - uint256 public z; - bool public a; - bool public b; - - constructor() { - x = 42; // original: 42 - y = 13; // original: 13 - z = 3110; // original: 3110 - /// AssignmentMutation(`true` |==> `false`) of: `a = true; // original: true` - a = false; // original: true - b = false; // original: false - } -} diff --git a/resources/regressions/all.json/mutants/44/AssignmentMutation/AssignmentMutation.sol b/resources/regressions/all.json/mutants/44/AssignmentMutation/AssignmentMutation.sol deleted file mode 100644 index 16656d4..0000000 --- a/resources/regressions/all.json/mutants/44/AssignmentMutation/AssignmentMutation.sol +++ /dev/null @@ -1,20 +0,0 @@ -// SPDX-License-Identifier: GPL-3.0-only -pragma solidity >0.7.0; -pragma experimental ABIEncoderV2; - -contract AssignmentMutation { - uint256 public x; - uint256 public y; - uint256 public z; - bool public a; - bool public b; - - constructor() { - x = 42; // original: 42 - y = 13; // original: 13 - z = 3110; // original: 3110 - a = true; // original: true - /// AssignmentMutation(`false` |==> `true`) of: `b = false; // original: false` - b = true; // original: false - } -} diff --git a/resources/regressions/all.json/mutants/45/DeleteExpressionMutation/DeleteExpressionMutation.sol b/resources/regressions/all.json/mutants/45/DeleteExpressionMutation/DeleteExpressionMutation.sol deleted file mode 100644 index c35b831..0000000 --- a/resources/regressions/all.json/mutants/45/DeleteExpressionMutation/DeleteExpressionMutation.sol +++ /dev/null @@ -1,15 +0,0 @@ -// SPDX-License-Identifier: GPL-3.0-only -pragma solidity >0.7.0; -pragma experimental ABIEncoderV2; - -contract DeleteExpressionMutation { - - function myIdentity(uint256 x) public pure returns (uint256) { - uint256 result = 0; - for (uint256 i = 0; i < x; i++) { - /// DeleteExpressionMutation(`result ++` |==> `assert(true)`) of: `result ++;` - assert(true); - } - return result; - } -} diff --git a/resources/regressions/all.json/mutants/46/DeleteExpressionMutation/DeleteExpressionMutation.sol b/resources/regressions/all.json/mutants/46/DeleteExpressionMutation/DeleteExpressionMutation.sol deleted file mode 100644 index a96d17f..0000000 --- a/resources/regressions/all.json/mutants/46/DeleteExpressionMutation/DeleteExpressionMutation.sol +++ /dev/null @@ -1,15 +0,0 @@ -// SPDX-License-Identifier: GPL-3.0-only -pragma solidity >0.7.0; -pragma experimental ABIEncoderV2; - -contract DeleteExpressionMutation { - - function myIdentity(uint256 x) public pure returns (uint256) { - uint256 result = 0; - /// DeleteExpressionMutation(`i++` |==> `assert(true)`) of: `for (uint256 i = 0; i < x; i++) {` - for (uint256 i = 0; i < x; assert(true)) { - result ++; - } - return result; - } -} diff --git a/resources/regressions/all.json/mutants/47/IfStatementMutation/IfStatementMutation.sol b/resources/regressions/all.json/mutants/47/IfStatementMutation/IfStatementMutation.sol deleted file mode 100644 index e61e412..0000000 --- a/resources/regressions/all.json/mutants/47/IfStatementMutation/IfStatementMutation.sol +++ /dev/null @@ -1,15 +0,0 @@ -// SPDX-License-Identifier: GPL-3.0-only -pragma solidity >0.7.0; -pragma experimental ABIEncoderV2; - -contract IfStatementMutation { - function myBooleanNegation(bool a) public pure returns (bool) { - /// IfStatementMutation(`a` |==> `true`) of: `if (a) {` - if (true) { - return true; - } - else { - return false; - } - } -} diff --git a/resources/regressions/all.json/mutants/48/IfStatementMutation/IfStatementMutation.sol b/resources/regressions/all.json/mutants/48/IfStatementMutation/IfStatementMutation.sol deleted file mode 100644 index 26a7d94..0000000 --- a/resources/regressions/all.json/mutants/48/IfStatementMutation/IfStatementMutation.sol +++ /dev/null @@ -1,15 +0,0 @@ -// SPDX-License-Identifier: GPL-3.0-only -pragma solidity >0.7.0; -pragma experimental ABIEncoderV2; - -contract IfStatementMutation { - function myBooleanNegation(bool a) public pure returns (bool) { - /// IfStatementMutation(`a` |==> `false`) of: `if (a) {` - if (false) { - return true; - } - else { - return false; - } - } -} diff --git a/resources/regressions/all.json/mutants/49/SwapArgumentsOperatorMutation/SwapArgumentsOperatorMutation.sol b/resources/regressions/all.json/mutants/49/SwapArgumentsOperatorMutation/SwapArgumentsOperatorMutation.sol deleted file mode 100644 index 5dc55e7..0000000 --- a/resources/regressions/all.json/mutants/49/SwapArgumentsOperatorMutation/SwapArgumentsOperatorMutation.sol +++ /dev/null @@ -1,46 +0,0 @@ -// SPDX-License-Identifier: GPL-3.0-only -pragma solidity >0.7.0; -pragma experimental ABIEncoderV2; - -contract SwapArgumentsOperatorMutation { - function mySubtraction(uint256 x, uint256 y) public pure returns (uint256) { - /// SwapArgumentsOperatorMutation(`x - y` |==> `y - x`) of: `return x - y;` - return y - x; - } - - function myDivision(uint256 x, uint256 y) public pure returns (uint256) { - return x / y; - } - - function myModulo(uint256 x, uint256 y) public pure returns (uint256) { - return x % y; - } - - function myExponentiation(uint256 x, uint256 y) public pure returns (uint256) { - return x ** y; - } - - function myGT(uint256 x, uint256 y) public pure returns (bool) { - return x > y; - } - - function myLT(uint256 x, uint256 y) public pure returns (bool) { - return x < y; - } - - function myGE(uint256 x, uint256 y) public pure returns (bool) { - return x >= y; - } - - function myLE(uint256 x, uint256 y) public pure returns (bool) { - return x <= y; - } - - function mySAL(uint256 x, uint256 y) public pure returns (uint256) { - return x << y; - } - - function mySAR(uint256 x, uint256 y) public pure returns (uint256) { - return x >> y; - } -} diff --git a/resources/regressions/all.json/mutants/5/BinaryOpMutation/BinaryOpMutation.sol b/resources/regressions/all.json/mutants/5/BinaryOpMutation/BinaryOpMutation.sol deleted file mode 100644 index 217be92..0000000 --- a/resources/regressions/all.json/mutants/5/BinaryOpMutation/BinaryOpMutation.sol +++ /dev/null @@ -1,31 +0,0 @@ -// SPDX-License-Identifier: GPL-3.0-only -pragma solidity >0.7.0; -pragma experimental ABIEncoderV2; - -contract BinaryOpMutation { - function myAddition(uint256 x, uint256 y) public pure returns (uint256) { - /// BinaryOpMutation(`+` |==> `**`) of: `return x + y;` - return x**y; - } - - function mySubtraction(uint256 x, uint256 y) public pure returns (uint256) { - return x - y; - } - - function myMultiplication(uint256 x, uint256 y) public pure returns (uint256) { - return x * y; - } - - function myDivision(uint256 x, uint256 y) public pure returns (uint256) { - return x / y; - } - - function myModulo(uint256 x, uint256 y) public pure returns (uint256) { - return x % y; - } - - function myExponentiation(uint256 x, uint256 y) public pure returns (uint256) { - return x ** y; - } - -} diff --git a/resources/regressions/all.json/mutants/50/SwapArgumentsOperatorMutation/SwapArgumentsOperatorMutation.sol b/resources/regressions/all.json/mutants/50/SwapArgumentsOperatorMutation/SwapArgumentsOperatorMutation.sol deleted file mode 100644 index 329f233..0000000 --- a/resources/regressions/all.json/mutants/50/SwapArgumentsOperatorMutation/SwapArgumentsOperatorMutation.sol +++ /dev/null @@ -1,46 +0,0 @@ -// SPDX-License-Identifier: GPL-3.0-only -pragma solidity >0.7.0; -pragma experimental ABIEncoderV2; - -contract SwapArgumentsOperatorMutation { - function mySubtraction(uint256 x, uint256 y) public pure returns (uint256) { - return x - y; - } - - function myDivision(uint256 x, uint256 y) public pure returns (uint256) { - /// SwapArgumentsOperatorMutation(`x / y` |==> `y / x`) of: `return x / y;` - return y / x; - } - - function myModulo(uint256 x, uint256 y) public pure returns (uint256) { - return x % y; - } - - function myExponentiation(uint256 x, uint256 y) public pure returns (uint256) { - return x ** y; - } - - function myGT(uint256 x, uint256 y) public pure returns (bool) { - return x > y; - } - - function myLT(uint256 x, uint256 y) public pure returns (bool) { - return x < y; - } - - function myGE(uint256 x, uint256 y) public pure returns (bool) { - return x >= y; - } - - function myLE(uint256 x, uint256 y) public pure returns (bool) { - return x <= y; - } - - function mySAL(uint256 x, uint256 y) public pure returns (uint256) { - return x << y; - } - - function mySAR(uint256 x, uint256 y) public pure returns (uint256) { - return x >> y; - } -} diff --git a/resources/regressions/all.json/mutants/51/SwapArgumentsOperatorMutation/SwapArgumentsOperatorMutation.sol b/resources/regressions/all.json/mutants/51/SwapArgumentsOperatorMutation/SwapArgumentsOperatorMutation.sol deleted file mode 100644 index aac7bcb..0000000 --- a/resources/regressions/all.json/mutants/51/SwapArgumentsOperatorMutation/SwapArgumentsOperatorMutation.sol +++ /dev/null @@ -1,46 +0,0 @@ -// SPDX-License-Identifier: GPL-3.0-only -pragma solidity >0.7.0; -pragma experimental ABIEncoderV2; - -contract SwapArgumentsOperatorMutation { - function mySubtraction(uint256 x, uint256 y) public pure returns (uint256) { - return x - y; - } - - function myDivision(uint256 x, uint256 y) public pure returns (uint256) { - return x / y; - } - - function myModulo(uint256 x, uint256 y) public pure returns (uint256) { - /// SwapArgumentsOperatorMutation(`x % y` |==> `y % x`) of: `return x % y;` - return y % x; - } - - function myExponentiation(uint256 x, uint256 y) public pure returns (uint256) { - return x ** y; - } - - function myGT(uint256 x, uint256 y) public pure returns (bool) { - return x > y; - } - - function myLT(uint256 x, uint256 y) public pure returns (bool) { - return x < y; - } - - function myGE(uint256 x, uint256 y) public pure returns (bool) { - return x >= y; - } - - function myLE(uint256 x, uint256 y) public pure returns (bool) { - return x <= y; - } - - function mySAL(uint256 x, uint256 y) public pure returns (uint256) { - return x << y; - } - - function mySAR(uint256 x, uint256 y) public pure returns (uint256) { - return x >> y; - } -} diff --git a/resources/regressions/all.json/mutants/52/SwapArgumentsOperatorMutation/SwapArgumentsOperatorMutation.sol b/resources/regressions/all.json/mutants/52/SwapArgumentsOperatorMutation/SwapArgumentsOperatorMutation.sol deleted file mode 100644 index 52295f7..0000000 --- a/resources/regressions/all.json/mutants/52/SwapArgumentsOperatorMutation/SwapArgumentsOperatorMutation.sol +++ /dev/null @@ -1,46 +0,0 @@ -// SPDX-License-Identifier: GPL-3.0-only -pragma solidity >0.7.0; -pragma experimental ABIEncoderV2; - -contract SwapArgumentsOperatorMutation { - function mySubtraction(uint256 x, uint256 y) public pure returns (uint256) { - return x - y; - } - - function myDivision(uint256 x, uint256 y) public pure returns (uint256) { - return x / y; - } - - function myModulo(uint256 x, uint256 y) public pure returns (uint256) { - return x % y; - } - - function myExponentiation(uint256 x, uint256 y) public pure returns (uint256) { - /// SwapArgumentsOperatorMutation(`x ** y` |==> `y ** x`) of: `return x ** y;` - return y ** x; - } - - function myGT(uint256 x, uint256 y) public pure returns (bool) { - return x > y; - } - - function myLT(uint256 x, uint256 y) public pure returns (bool) { - return x < y; - } - - function myGE(uint256 x, uint256 y) public pure returns (bool) { - return x >= y; - } - - function myLE(uint256 x, uint256 y) public pure returns (bool) { - return x <= y; - } - - function mySAL(uint256 x, uint256 y) public pure returns (uint256) { - return x << y; - } - - function mySAR(uint256 x, uint256 y) public pure returns (uint256) { - return x >> y; - } -} diff --git a/resources/regressions/all.json/mutants/53/SwapArgumentsOperatorMutation/SwapArgumentsOperatorMutation.sol b/resources/regressions/all.json/mutants/53/SwapArgumentsOperatorMutation/SwapArgumentsOperatorMutation.sol deleted file mode 100644 index 9913046..0000000 --- a/resources/regressions/all.json/mutants/53/SwapArgumentsOperatorMutation/SwapArgumentsOperatorMutation.sol +++ /dev/null @@ -1,46 +0,0 @@ -// SPDX-License-Identifier: GPL-3.0-only -pragma solidity >0.7.0; -pragma experimental ABIEncoderV2; - -contract SwapArgumentsOperatorMutation { - function mySubtraction(uint256 x, uint256 y) public pure returns (uint256) { - return x - y; - } - - function myDivision(uint256 x, uint256 y) public pure returns (uint256) { - return x / y; - } - - function myModulo(uint256 x, uint256 y) public pure returns (uint256) { - return x % y; - } - - function myExponentiation(uint256 x, uint256 y) public pure returns (uint256) { - return x ** y; - } - - function myGT(uint256 x, uint256 y) public pure returns (bool) { - /// SwapArgumentsOperatorMutation(`x > y` |==> `y > x`) of: `return x > y;` - return y > x; - } - - function myLT(uint256 x, uint256 y) public pure returns (bool) { - return x < y; - } - - function myGE(uint256 x, uint256 y) public pure returns (bool) { - return x >= y; - } - - function myLE(uint256 x, uint256 y) public pure returns (bool) { - return x <= y; - } - - function mySAL(uint256 x, uint256 y) public pure returns (uint256) { - return x << y; - } - - function mySAR(uint256 x, uint256 y) public pure returns (uint256) { - return x >> y; - } -} diff --git a/resources/regressions/all.json/mutants/54/SwapArgumentsOperatorMutation/SwapArgumentsOperatorMutation.sol b/resources/regressions/all.json/mutants/54/SwapArgumentsOperatorMutation/SwapArgumentsOperatorMutation.sol deleted file mode 100644 index a8a5928..0000000 --- a/resources/regressions/all.json/mutants/54/SwapArgumentsOperatorMutation/SwapArgumentsOperatorMutation.sol +++ /dev/null @@ -1,46 +0,0 @@ -// SPDX-License-Identifier: GPL-3.0-only -pragma solidity >0.7.0; -pragma experimental ABIEncoderV2; - -contract SwapArgumentsOperatorMutation { - function mySubtraction(uint256 x, uint256 y) public pure returns (uint256) { - return x - y; - } - - function myDivision(uint256 x, uint256 y) public pure returns (uint256) { - return x / y; - } - - function myModulo(uint256 x, uint256 y) public pure returns (uint256) { - return x % y; - } - - function myExponentiation(uint256 x, uint256 y) public pure returns (uint256) { - return x ** y; - } - - function myGT(uint256 x, uint256 y) public pure returns (bool) { - return x > y; - } - - function myLT(uint256 x, uint256 y) public pure returns (bool) { - /// SwapArgumentsOperatorMutation(`x < y` |==> `y < x`) of: `return x < y;` - return y < x; - } - - function myGE(uint256 x, uint256 y) public pure returns (bool) { - return x >= y; - } - - function myLE(uint256 x, uint256 y) public pure returns (bool) { - return x <= y; - } - - function mySAL(uint256 x, uint256 y) public pure returns (uint256) { - return x << y; - } - - function mySAR(uint256 x, uint256 y) public pure returns (uint256) { - return x >> y; - } -} diff --git a/resources/regressions/all.json/mutants/55/SwapArgumentsOperatorMutation/SwapArgumentsOperatorMutation.sol b/resources/regressions/all.json/mutants/55/SwapArgumentsOperatorMutation/SwapArgumentsOperatorMutation.sol deleted file mode 100644 index 479a318..0000000 --- a/resources/regressions/all.json/mutants/55/SwapArgumentsOperatorMutation/SwapArgumentsOperatorMutation.sol +++ /dev/null @@ -1,46 +0,0 @@ -// SPDX-License-Identifier: GPL-3.0-only -pragma solidity >0.7.0; -pragma experimental ABIEncoderV2; - -contract SwapArgumentsOperatorMutation { - function mySubtraction(uint256 x, uint256 y) public pure returns (uint256) { - return x - y; - } - - function myDivision(uint256 x, uint256 y) public pure returns (uint256) { - return x / y; - } - - function myModulo(uint256 x, uint256 y) public pure returns (uint256) { - return x % y; - } - - function myExponentiation(uint256 x, uint256 y) public pure returns (uint256) { - return x ** y; - } - - function myGT(uint256 x, uint256 y) public pure returns (bool) { - return x > y; - } - - function myLT(uint256 x, uint256 y) public pure returns (bool) { - return x < y; - } - - function myGE(uint256 x, uint256 y) public pure returns (bool) { - /// SwapArgumentsOperatorMutation(`x >= y` |==> `y >= x`) of: `return x >= y;` - return y >= x; - } - - function myLE(uint256 x, uint256 y) public pure returns (bool) { - return x <= y; - } - - function mySAL(uint256 x, uint256 y) public pure returns (uint256) { - return x << y; - } - - function mySAR(uint256 x, uint256 y) public pure returns (uint256) { - return x >> y; - } -} diff --git a/resources/regressions/all.json/mutants/56/SwapArgumentsOperatorMutation/SwapArgumentsOperatorMutation.sol b/resources/regressions/all.json/mutants/56/SwapArgumentsOperatorMutation/SwapArgumentsOperatorMutation.sol deleted file mode 100644 index 481319c..0000000 --- a/resources/regressions/all.json/mutants/56/SwapArgumentsOperatorMutation/SwapArgumentsOperatorMutation.sol +++ /dev/null @@ -1,46 +0,0 @@ -// SPDX-License-Identifier: GPL-3.0-only -pragma solidity >0.7.0; -pragma experimental ABIEncoderV2; - -contract SwapArgumentsOperatorMutation { - function mySubtraction(uint256 x, uint256 y) public pure returns (uint256) { - return x - y; - } - - function myDivision(uint256 x, uint256 y) public pure returns (uint256) { - return x / y; - } - - function myModulo(uint256 x, uint256 y) public pure returns (uint256) { - return x % y; - } - - function myExponentiation(uint256 x, uint256 y) public pure returns (uint256) { - return x ** y; - } - - function myGT(uint256 x, uint256 y) public pure returns (bool) { - return x > y; - } - - function myLT(uint256 x, uint256 y) public pure returns (bool) { - return x < y; - } - - function myGE(uint256 x, uint256 y) public pure returns (bool) { - return x >= y; - } - - function myLE(uint256 x, uint256 y) public pure returns (bool) { - /// SwapArgumentsOperatorMutation(`x <= y` |==> `y <= x`) of: `return x <= y;` - return y <= x; - } - - function mySAL(uint256 x, uint256 y) public pure returns (uint256) { - return x << y; - } - - function mySAR(uint256 x, uint256 y) public pure returns (uint256) { - return x >> y; - } -} diff --git a/resources/regressions/all.json/mutants/57/SwapArgumentsOperatorMutation/SwapArgumentsOperatorMutation.sol b/resources/regressions/all.json/mutants/57/SwapArgumentsOperatorMutation/SwapArgumentsOperatorMutation.sol deleted file mode 100644 index 290d524..0000000 --- a/resources/regressions/all.json/mutants/57/SwapArgumentsOperatorMutation/SwapArgumentsOperatorMutation.sol +++ /dev/null @@ -1,46 +0,0 @@ -// SPDX-License-Identifier: GPL-3.0-only -pragma solidity >0.7.0; -pragma experimental ABIEncoderV2; - -contract SwapArgumentsOperatorMutation { - function mySubtraction(uint256 x, uint256 y) public pure returns (uint256) { - return x - y; - } - - function myDivision(uint256 x, uint256 y) public pure returns (uint256) { - return x / y; - } - - function myModulo(uint256 x, uint256 y) public pure returns (uint256) { - return x % y; - } - - function myExponentiation(uint256 x, uint256 y) public pure returns (uint256) { - return x ** y; - } - - function myGT(uint256 x, uint256 y) public pure returns (bool) { - return x > y; - } - - function myLT(uint256 x, uint256 y) public pure returns (bool) { - return x < y; - } - - function myGE(uint256 x, uint256 y) public pure returns (bool) { - return x >= y; - } - - function myLE(uint256 x, uint256 y) public pure returns (bool) { - return x <= y; - } - - function mySAL(uint256 x, uint256 y) public pure returns (uint256) { - /// SwapArgumentsOperatorMutation(`x << y` |==> `y << x`) of: `return x << y;` - return y << x; - } - - function mySAR(uint256 x, uint256 y) public pure returns (uint256) { - return x >> y; - } -} diff --git a/resources/regressions/all.json/mutants/58/SwapArgumentsOperatorMutation/SwapArgumentsOperatorMutation.sol b/resources/regressions/all.json/mutants/58/SwapArgumentsOperatorMutation/SwapArgumentsOperatorMutation.sol deleted file mode 100644 index ba76dd4..0000000 --- a/resources/regressions/all.json/mutants/58/SwapArgumentsOperatorMutation/SwapArgumentsOperatorMutation.sol +++ /dev/null @@ -1,46 +0,0 @@ -// SPDX-License-Identifier: GPL-3.0-only -pragma solidity >0.7.0; -pragma experimental ABIEncoderV2; - -contract SwapArgumentsOperatorMutation { - function mySubtraction(uint256 x, uint256 y) public pure returns (uint256) { - return x - y; - } - - function myDivision(uint256 x, uint256 y) public pure returns (uint256) { - return x / y; - } - - function myModulo(uint256 x, uint256 y) public pure returns (uint256) { - return x % y; - } - - function myExponentiation(uint256 x, uint256 y) public pure returns (uint256) { - return x ** y; - } - - function myGT(uint256 x, uint256 y) public pure returns (bool) { - return x > y; - } - - function myLT(uint256 x, uint256 y) public pure returns (bool) { - return x < y; - } - - function myGE(uint256 x, uint256 y) public pure returns (bool) { - return x >= y; - } - - function myLE(uint256 x, uint256 y) public pure returns (bool) { - return x <= y; - } - - function mySAL(uint256 x, uint256 y) public pure returns (uint256) { - return x << y; - } - - function mySAR(uint256 x, uint256 y) public pure returns (uint256) { - /// SwapArgumentsOperatorMutation(`x >> y` |==> `y >> x`) of: `return x >> y;` - return y >> x; - } -} diff --git a/resources/regressions/all.json/mutants/59/UnaryOperatorMutation/UnaryOperatorMutation.sol b/resources/regressions/all.json/mutants/59/UnaryOperatorMutation/UnaryOperatorMutation.sol deleted file mode 100644 index d0c22db..0000000 --- a/resources/regressions/all.json/mutants/59/UnaryOperatorMutation/UnaryOperatorMutation.sol +++ /dev/null @@ -1,28 +0,0 @@ -// SPDX-License-Identifier: GPL-3.0-only -pragma solidity >0.7.0; -pragma experimental ABIEncoderV2; - -contract UnaryOperatorMutation { - function myBitwiseNeg(uint256 x) public pure returns (uint256) { - /// UnaryOperatorMutation(`~` |==> `++`) of: `return ~ x;` - return ++ x; - } - - function myPrefixIncr(uint256 x) public pure returns (uint256) { - return ++x; - } - - function myPrefixDecr(uint256 x) public pure returns (uint256) { - return --x; - } - - function mySuffixIncr(uint256 x) public pure returns (uint256) { - x++; - return x; - } - - function mySuffixDecr(uint256 x) public pure returns (uint256) { - x--; - return x; - } -} diff --git a/resources/regressions/all.json/mutants/6/BinaryOpMutation/BinaryOpMutation.sol b/resources/regressions/all.json/mutants/6/BinaryOpMutation/BinaryOpMutation.sol deleted file mode 100644 index 6c0d0bd..0000000 --- a/resources/regressions/all.json/mutants/6/BinaryOpMutation/BinaryOpMutation.sol +++ /dev/null @@ -1,31 +0,0 @@ -// SPDX-License-Identifier: GPL-3.0-only -pragma solidity >0.7.0; -pragma experimental ABIEncoderV2; - -contract BinaryOpMutation { - function myAddition(uint256 x, uint256 y) public pure returns (uint256) { - return x + y; - } - - function mySubtraction(uint256 x, uint256 y) public pure returns (uint256) { - /// BinaryOpMutation(`-` |==> `+`) of: `return x - y;` - return x+y; - } - - function myMultiplication(uint256 x, uint256 y) public pure returns (uint256) { - return x * y; - } - - function myDivision(uint256 x, uint256 y) public pure returns (uint256) { - return x / y; - } - - function myModulo(uint256 x, uint256 y) public pure returns (uint256) { - return x % y; - } - - function myExponentiation(uint256 x, uint256 y) public pure returns (uint256) { - return x ** y; - } - -} diff --git a/resources/regressions/all.json/mutants/60/UnaryOperatorMutation/UnaryOperatorMutation.sol b/resources/regressions/all.json/mutants/60/UnaryOperatorMutation/UnaryOperatorMutation.sol deleted file mode 100644 index 93d1076..0000000 --- a/resources/regressions/all.json/mutants/60/UnaryOperatorMutation/UnaryOperatorMutation.sol +++ /dev/null @@ -1,28 +0,0 @@ -// SPDX-License-Identifier: GPL-3.0-only -pragma solidity >0.7.0; -pragma experimental ABIEncoderV2; - -contract UnaryOperatorMutation { - function myBitwiseNeg(uint256 x) public pure returns (uint256) { - /// UnaryOperatorMutation(`~` |==> `--`) of: `return ~ x;` - return -- x; - } - - function myPrefixIncr(uint256 x) public pure returns (uint256) { - return ++x; - } - - function myPrefixDecr(uint256 x) public pure returns (uint256) { - return --x; - } - - function mySuffixIncr(uint256 x) public pure returns (uint256) { - x++; - return x; - } - - function mySuffixDecr(uint256 x) public pure returns (uint256) { - x--; - return x; - } -} diff --git a/resources/regressions/all.json/mutants/61/UnaryOperatorMutation/UnaryOperatorMutation.sol b/resources/regressions/all.json/mutants/61/UnaryOperatorMutation/UnaryOperatorMutation.sol deleted file mode 100644 index b2e1769..0000000 --- a/resources/regressions/all.json/mutants/61/UnaryOperatorMutation/UnaryOperatorMutation.sol +++ /dev/null @@ -1,28 +0,0 @@ -// SPDX-License-Identifier: GPL-3.0-only -pragma solidity >0.7.0; -pragma experimental ABIEncoderV2; - -contract UnaryOperatorMutation { - function myBitwiseNeg(uint256 x) public pure returns (uint256) { - return ~ x; - } - - function myPrefixIncr(uint256 x) public pure returns (uint256) { - /// UnaryOperatorMutation(`++` |==> `--`) of: `return ++x;` - return --x; - } - - function myPrefixDecr(uint256 x) public pure returns (uint256) { - return --x; - } - - function mySuffixIncr(uint256 x) public pure returns (uint256) { - x++; - return x; - } - - function mySuffixDecr(uint256 x) public pure returns (uint256) { - x--; - return x; - } -} diff --git a/resources/regressions/all.json/mutants/62/UnaryOperatorMutation/UnaryOperatorMutation.sol b/resources/regressions/all.json/mutants/62/UnaryOperatorMutation/UnaryOperatorMutation.sol deleted file mode 100644 index 64c3fb2..0000000 --- a/resources/regressions/all.json/mutants/62/UnaryOperatorMutation/UnaryOperatorMutation.sol +++ /dev/null @@ -1,28 +0,0 @@ -// SPDX-License-Identifier: GPL-3.0-only -pragma solidity >0.7.0; -pragma experimental ABIEncoderV2; - -contract UnaryOperatorMutation { - function myBitwiseNeg(uint256 x) public pure returns (uint256) { - return ~ x; - } - - function myPrefixIncr(uint256 x) public pure returns (uint256) { - /// UnaryOperatorMutation(`++` |==> `~`) of: `return ++x;` - return ~x; - } - - function myPrefixDecr(uint256 x) public pure returns (uint256) { - return --x; - } - - function mySuffixIncr(uint256 x) public pure returns (uint256) { - x++; - return x; - } - - function mySuffixDecr(uint256 x) public pure returns (uint256) { - x--; - return x; - } -} diff --git a/resources/regressions/all.json/mutants/63/UnaryOperatorMutation/UnaryOperatorMutation.sol b/resources/regressions/all.json/mutants/63/UnaryOperatorMutation/UnaryOperatorMutation.sol deleted file mode 100644 index d125a7f..0000000 --- a/resources/regressions/all.json/mutants/63/UnaryOperatorMutation/UnaryOperatorMutation.sol +++ /dev/null @@ -1,28 +0,0 @@ -// SPDX-License-Identifier: GPL-3.0-only -pragma solidity >0.7.0; -pragma experimental ABIEncoderV2; - -contract UnaryOperatorMutation { - function myBitwiseNeg(uint256 x) public pure returns (uint256) { - return ~ x; - } - - function myPrefixIncr(uint256 x) public pure returns (uint256) { - return ++x; - } - - function myPrefixDecr(uint256 x) public pure returns (uint256) { - /// UnaryOperatorMutation(`--` |==> `++`) of: `return --x;` - return ++x; - } - - function mySuffixIncr(uint256 x) public pure returns (uint256) { - x++; - return x; - } - - function mySuffixDecr(uint256 x) public pure returns (uint256) { - x--; - return x; - } -} diff --git a/resources/regressions/all.json/mutants/64/UnaryOperatorMutation/UnaryOperatorMutation.sol b/resources/regressions/all.json/mutants/64/UnaryOperatorMutation/UnaryOperatorMutation.sol deleted file mode 100644 index f1d117d..0000000 --- a/resources/regressions/all.json/mutants/64/UnaryOperatorMutation/UnaryOperatorMutation.sol +++ /dev/null @@ -1,28 +0,0 @@ -// SPDX-License-Identifier: GPL-3.0-only -pragma solidity >0.7.0; -pragma experimental ABIEncoderV2; - -contract UnaryOperatorMutation { - function myBitwiseNeg(uint256 x) public pure returns (uint256) { - return ~ x; - } - - function myPrefixIncr(uint256 x) public pure returns (uint256) { - return ++x; - } - - function myPrefixDecr(uint256 x) public pure returns (uint256) { - /// UnaryOperatorMutation(`--` |==> `~`) of: `return --x;` - return ~x; - } - - function mySuffixIncr(uint256 x) public pure returns (uint256) { - x++; - return x; - } - - function mySuffixDecr(uint256 x) public pure returns (uint256) { - x--; - return x; - } -} diff --git a/resources/regressions/all.json/mutants/65/UnaryOperatorMutation/UnaryOperatorMutation.sol b/resources/regressions/all.json/mutants/65/UnaryOperatorMutation/UnaryOperatorMutation.sol deleted file mode 100644 index 8b40209..0000000 --- a/resources/regressions/all.json/mutants/65/UnaryOperatorMutation/UnaryOperatorMutation.sol +++ /dev/null @@ -1,28 +0,0 @@ -// SPDX-License-Identifier: GPL-3.0-only -pragma solidity >0.7.0; -pragma experimental ABIEncoderV2; - -contract UnaryOperatorMutation { - function myBitwiseNeg(uint256 x) public pure returns (uint256) { - return ~ x; - } - - function myPrefixIncr(uint256 x) public pure returns (uint256) { - return ++x; - } - - function myPrefixDecr(uint256 x) public pure returns (uint256) { - return --x; - } - - function mySuffixIncr(uint256 x) public pure returns (uint256) { - /// UnaryOperatorMutation(`++` |==> `--`) of: `x++;` - x--; - return x; - } - - function mySuffixDecr(uint256 x) public pure returns (uint256) { - x--; - return x; - } -} diff --git a/resources/regressions/all.json/mutants/66/UnaryOperatorMutation/UnaryOperatorMutation.sol b/resources/regressions/all.json/mutants/66/UnaryOperatorMutation/UnaryOperatorMutation.sol deleted file mode 100644 index ba1800b..0000000 --- a/resources/regressions/all.json/mutants/66/UnaryOperatorMutation/UnaryOperatorMutation.sol +++ /dev/null @@ -1,28 +0,0 @@ -// SPDX-License-Identifier: GPL-3.0-only -pragma solidity >0.7.0; -pragma experimental ABIEncoderV2; - -contract UnaryOperatorMutation { - function myBitwiseNeg(uint256 x) public pure returns (uint256) { - return ~ x; - } - - function myPrefixIncr(uint256 x) public pure returns (uint256) { - return ++x; - } - - function myPrefixDecr(uint256 x) public pure returns (uint256) { - return --x; - } - - function mySuffixIncr(uint256 x) public pure returns (uint256) { - x++; - return x; - } - - function mySuffixDecr(uint256 x) public pure returns (uint256) { - /// UnaryOperatorMutation(`--` |==> `++`) of: `x--;` - x++; - return x; - } -} diff --git a/resources/regressions/all.json/mutants/67/ElimDelegateMutation/ElimDelegateMutation.sol b/resources/regressions/all.json/mutants/67/ElimDelegateMutation/ElimDelegateMutation.sol deleted file mode 100644 index eb96686..0000000 --- a/resources/regressions/all.json/mutants/67/ElimDelegateMutation/ElimDelegateMutation.sol +++ /dev/null @@ -1,32 +0,0 @@ -// SPDX-License-Identifier: GPL-3.0-only -pragma solidity ^0.8.13; - -contract B { - uint public num; - address public sender; - uint public value; - - function setVars(uint _num) public payable { - num = _num; - sender = msg.sender; - value = msg.value; - } -} - -contract A { - uint public num; - address public sender; - uint public value; - bool public delegateSuccessful; - bytes public myData; - - - function setVars(address _contract, uint _num) public payable { - /// ElimDelegateMutation(`delegatecall` |==> `call`) of: `(bool success, bytes memory data) = _contract.delegatecall(` - (bool success, bytes memory data) = _contract.call( - abi.encodeWithSignature("setVars(uint256)", _num) - ); - delegateSuccessful = success; - myData = data; - } -} diff --git a/resources/regressions/all.json/mutants/7/BinaryOpMutation/BinaryOpMutation.sol b/resources/regressions/all.json/mutants/7/BinaryOpMutation/BinaryOpMutation.sol deleted file mode 100644 index cfbf446..0000000 --- a/resources/regressions/all.json/mutants/7/BinaryOpMutation/BinaryOpMutation.sol +++ /dev/null @@ -1,31 +0,0 @@ -// SPDX-License-Identifier: GPL-3.0-only -pragma solidity >0.7.0; -pragma experimental ABIEncoderV2; - -contract BinaryOpMutation { - function myAddition(uint256 x, uint256 y) public pure returns (uint256) { - return x + y; - } - - function mySubtraction(uint256 x, uint256 y) public pure returns (uint256) { - /// BinaryOpMutation(`-` |==> `*`) of: `return x - y;` - return x*y; - } - - function myMultiplication(uint256 x, uint256 y) public pure returns (uint256) { - return x * y; - } - - function myDivision(uint256 x, uint256 y) public pure returns (uint256) { - return x / y; - } - - function myModulo(uint256 x, uint256 y) public pure returns (uint256) { - return x % y; - } - - function myExponentiation(uint256 x, uint256 y) public pure returns (uint256) { - return x ** y; - } - -} diff --git a/resources/regressions/all.json/mutants/8/BinaryOpMutation/BinaryOpMutation.sol b/resources/regressions/all.json/mutants/8/BinaryOpMutation/BinaryOpMutation.sol deleted file mode 100644 index a3486bf..0000000 --- a/resources/regressions/all.json/mutants/8/BinaryOpMutation/BinaryOpMutation.sol +++ /dev/null @@ -1,31 +0,0 @@ -// SPDX-License-Identifier: GPL-3.0-only -pragma solidity >0.7.0; -pragma experimental ABIEncoderV2; - -contract BinaryOpMutation { - function myAddition(uint256 x, uint256 y) public pure returns (uint256) { - return x + y; - } - - function mySubtraction(uint256 x, uint256 y) public pure returns (uint256) { - /// BinaryOpMutation(`-` |==> `/`) of: `return x - y;` - return x/y; - } - - function myMultiplication(uint256 x, uint256 y) public pure returns (uint256) { - return x * y; - } - - function myDivision(uint256 x, uint256 y) public pure returns (uint256) { - return x / y; - } - - function myModulo(uint256 x, uint256 y) public pure returns (uint256) { - return x % y; - } - - function myExponentiation(uint256 x, uint256 y) public pure returns (uint256) { - return x ** y; - } - -} diff --git a/resources/regressions/all.json/mutants/9/BinaryOpMutation/BinaryOpMutation.sol b/resources/regressions/all.json/mutants/9/BinaryOpMutation/BinaryOpMutation.sol deleted file mode 100644 index f7363ed..0000000 --- a/resources/regressions/all.json/mutants/9/BinaryOpMutation/BinaryOpMutation.sol +++ /dev/null @@ -1,31 +0,0 @@ -// SPDX-License-Identifier: GPL-3.0-only -pragma solidity >0.7.0; -pragma experimental ABIEncoderV2; - -contract BinaryOpMutation { - function myAddition(uint256 x, uint256 y) public pure returns (uint256) { - return x + y; - } - - function mySubtraction(uint256 x, uint256 y) public pure returns (uint256) { - /// BinaryOpMutation(`-` |==> `%`) of: `return x - y;` - return x%y; - } - - function myMultiplication(uint256 x, uint256 y) public pure returns (uint256) { - return x * y; - } - - function myDivision(uint256 x, uint256 y) public pure returns (uint256) { - return x / y; - } - - function myModulo(uint256 x, uint256 y) public pure returns (uint256) { - return x % y; - } - - function myExponentiation(uint256 x, uint256 y) public pure returns (uint256) { - return x ** y; - } - -} diff --git a/resources/regressions/all_ops.json/gambit_results.json b/resources/regressions/all_ops.json/gambit_results.json new file mode 100644 index 0000000..1ff0083 --- /dev/null +++ b/resources/regressions/all_ops.json/gambit_results.json @@ -0,0 +1,914 @@ +[ + { + "col": 18, + "description": "ArithmeticOperatorReplacement", + "diff": "--- original\n+++ mutant\n@@ -9,8 +9,9 @@\n // a * b\n // a / b\n // a % b\n+ /// ArithmeticOperatorReplacement(`+` |==> `-`) of: `return a + b;`\n function plus(int256 a, int256 b) public pure returns (int256) {\n- return a + b;\n+ return a - b;\n }\n \n // Expect 4 mutants:\n", + "id": "1", + "line": 13, + "name": "mutants/1/AOR/AOR.sol", + "op": "AOR", + "orig": "+", + "original": "AOR/AOR.sol", + "repl": "-" + }, + { + "col": 18, + "description": "ArithmeticOperatorReplacement", + "diff": "--- original\n+++ mutant\n@@ -9,8 +9,9 @@\n // a * b\n // a / b\n // a % b\n+ /// ArithmeticOperatorReplacement(`+` |==> `*`) of: `return a + b;`\n function plus(int256 a, int256 b) public pure returns (int256) {\n- return a + b;\n+ return a * b;\n }\n \n // Expect 4 mutants:\n", + "id": "2", + "line": 13, + "name": "mutants/2/AOR/AOR.sol", + "op": "AOR", + "orig": "+", + "original": "AOR/AOR.sol", + "repl": "*" + }, + { + "col": 18, + "description": "ArithmeticOperatorReplacement", + "diff": "--- original\n+++ mutant\n@@ -9,8 +9,9 @@\n // a * b\n // a / b\n // a % b\n+ /// ArithmeticOperatorReplacement(`+` |==> `/`) of: `return a + b;`\n function plus(int256 a, int256 b) public pure returns (int256) {\n- return a + b;\n+ return a / b;\n }\n \n // Expect 4 mutants:\n", + "id": "3", + "line": 13, + "name": "mutants/3/AOR/AOR.sol", + "op": "AOR", + "orig": "+", + "original": "AOR/AOR.sol", + "repl": "/" + }, + { + "col": 18, + "description": "ArithmeticOperatorReplacement", + "diff": "--- original\n+++ mutant\n@@ -9,8 +9,9 @@\n // a * b\n // a / b\n // a % b\n+ /// ArithmeticOperatorReplacement(`+` |==> `%`) of: `return a + b;`\n function plus(int256 a, int256 b) public pure returns (int256) {\n- return a + b;\n+ return a % b;\n }\n \n // Expect 4 mutants:\n", + "id": "4", + "line": 13, + "name": "mutants/4/AOR/AOR.sol", + "op": "AOR", + "orig": "+", + "original": "AOR/AOR.sol", + "repl": "%" + }, + { + "col": 18, + "description": "ArithmeticOperatorReplacement", + "diff": "--- original\n+++ mutant\n@@ -18,8 +18,9 @@\n // a * b\n // a / b\n // a % b\n+ /// ArithmeticOperatorReplacement(`-` |==> `+`) of: `return a - b;`\n function minus(int256 a, int256 b) public pure returns (int256) {\n- return a - b;\n+ return a + b;\n }\n \n // Expect 4 mutants:\n", + "id": "5", + "line": 22, + "name": "mutants/5/AOR/AOR.sol", + "op": "AOR", + "orig": "-", + "original": "AOR/AOR.sol", + "repl": "+" + }, + { + "col": 18, + "description": "ArithmeticOperatorReplacement", + "diff": "--- original\n+++ mutant\n@@ -18,8 +18,9 @@\n // a * b\n // a / b\n // a % b\n+ /// ArithmeticOperatorReplacement(`-` |==> `*`) of: `return a - b;`\n function minus(int256 a, int256 b) public pure returns (int256) {\n- return a - b;\n+ return a * b;\n }\n \n // Expect 4 mutants:\n", + "id": "6", + "line": 22, + "name": "mutants/6/AOR/AOR.sol", + "op": "AOR", + "orig": "-", + "original": "AOR/AOR.sol", + "repl": "*" + }, + { + "col": 18, + "description": "ArithmeticOperatorReplacement", + "diff": "--- original\n+++ mutant\n@@ -18,8 +18,9 @@\n // a * b\n // a / b\n // a % b\n+ /// ArithmeticOperatorReplacement(`-` |==> `/`) of: `return a - b;`\n function minus(int256 a, int256 b) public pure returns (int256) {\n- return a - b;\n+ return a / b;\n }\n \n // Expect 4 mutants:\n", + "id": "7", + "line": 22, + "name": "mutants/7/AOR/AOR.sol", + "op": "AOR", + "orig": "-", + "original": "AOR/AOR.sol", + "repl": "/" + }, + { + "col": 18, + "description": "ArithmeticOperatorReplacement", + "diff": "--- original\n+++ mutant\n@@ -18,8 +18,9 @@\n // a * b\n // a / b\n // a % b\n+ /// ArithmeticOperatorReplacement(`-` |==> `%`) of: `return a - b;`\n function minus(int256 a, int256 b) public pure returns (int256) {\n- return a - b;\n+ return a % b;\n }\n \n // Expect 4 mutants:\n", + "id": "8", + "line": 22, + "name": "mutants/8/AOR/AOR.sol", + "op": "AOR", + "orig": "-", + "original": "AOR/AOR.sol", + "repl": "%" + }, + { + "col": 22, + "description": "ArithmeticOperatorReplacement", + "diff": "--- original\n+++ mutant\n@@ -30,8 +30,9 @@\n function times_with_parens(\n int256 a,\n int256 b\n+ /// ArithmeticOperatorReplacement(`*` |==> `+`) of: `return ((a)) * b;`\n ) public pure returns (int256) {\n- return ((a)) * b;\n+ return ((a)) + b;\n }\n \n // Expect 5 mutants:\n", + "id": "9", + "line": 34, + "name": "mutants/9/AOR/AOR.sol", + "op": "AOR", + "orig": "*", + "original": "AOR/AOR.sol", + "repl": "+" + }, + { + "col": 22, + "description": "ArithmeticOperatorReplacement", + "diff": "--- original\n+++ mutant\n@@ -30,8 +30,9 @@\n function times_with_parens(\n int256 a,\n int256 b\n+ /// ArithmeticOperatorReplacement(`*` |==> `-`) of: `return ((a)) * b;`\n ) public pure returns (int256) {\n- return ((a)) * b;\n+ return ((a)) - b;\n }\n \n // Expect 5 mutants:\n", + "id": "10", + "line": 34, + "name": "mutants/10/AOR/AOR.sol", + "op": "AOR", + "orig": "*", + "original": "AOR/AOR.sol", + "repl": "-" + }, + { + "col": 22, + "description": "ArithmeticOperatorReplacement", + "diff": "--- original\n+++ mutant\n@@ -30,8 +30,9 @@\n function times_with_parens(\n int256 a,\n int256 b\n+ /// ArithmeticOperatorReplacement(`*` |==> `/`) of: `return ((a)) * b;`\n ) public pure returns (int256) {\n- return ((a)) * b;\n+ return ((a)) / b;\n }\n \n // Expect 5 mutants:\n", + "id": "11", + "line": 34, + "name": "mutants/11/AOR/AOR.sol", + "op": "AOR", + "orig": "*", + "original": "AOR/AOR.sol", + "repl": "/" + }, + { + "col": 22, + "description": "ArithmeticOperatorReplacement", + "diff": "--- original\n+++ mutant\n@@ -30,8 +30,9 @@\n function times_with_parens(\n int256 a,\n int256 b\n+ /// ArithmeticOperatorReplacement(`*` |==> `%`) of: `return ((a)) * b;`\n ) public pure returns (int256) {\n- return ((a)) * b;\n+ return ((a)) % b;\n }\n \n // Expect 5 mutants:\n", + "id": "12", + "line": 34, + "name": "mutants/12/AOR/AOR.sol", + "op": "AOR", + "orig": "*", + "original": "AOR/AOR.sol", + "repl": "%" + }, + { + "col": 22, + "description": "ArithmeticOperatorReplacement", + "diff": "--- original\n+++ mutant\n@@ -43,8 +43,9 @@\n function unsigned_times_with_parens(\n uint256 a,\n uint256 b\n+ /// ArithmeticOperatorReplacement(`*` |==> `+`) of: `return ((a)) * b;`\n ) public pure returns (uint256) {\n- return ((a)) * b;\n+ return ((a)) + b;\n }\n \n // Expect 5 mutants:\n", + "id": "13", + "line": 47, + "name": "mutants/13/AOR/AOR.sol", + "op": "AOR", + "orig": "*", + "original": "AOR/AOR.sol", + "repl": "+" + }, + { + "col": 22, + "description": "ArithmeticOperatorReplacement", + "diff": "--- original\n+++ mutant\n@@ -43,8 +43,9 @@\n function unsigned_times_with_parens(\n uint256 a,\n uint256 b\n+ /// ArithmeticOperatorReplacement(`*` |==> `-`) of: `return ((a)) * b;`\n ) public pure returns (uint256) {\n- return ((a)) * b;\n+ return ((a)) - b;\n }\n \n // Expect 5 mutants:\n", + "id": "14", + "line": 47, + "name": "mutants/14/AOR/AOR.sol", + "op": "AOR", + "orig": "*", + "original": "AOR/AOR.sol", + "repl": "-" + }, + { + "col": 22, + "description": "ArithmeticOperatorReplacement", + "diff": "--- original\n+++ mutant\n@@ -43,8 +43,9 @@\n function unsigned_times_with_parens(\n uint256 a,\n uint256 b\n+ /// ArithmeticOperatorReplacement(`*` |==> `/`) of: `return ((a)) * b;`\n ) public pure returns (uint256) {\n- return ((a)) * b;\n+ return ((a)) / b;\n }\n \n // Expect 5 mutants:\n", + "id": "15", + "line": 47, + "name": "mutants/15/AOR/AOR.sol", + "op": "AOR", + "orig": "*", + "original": "AOR/AOR.sol", + "repl": "/" + }, + { + "col": 22, + "description": "ArithmeticOperatorReplacement", + "diff": "--- original\n+++ mutant\n@@ -43,8 +43,9 @@\n function unsigned_times_with_parens(\n uint256 a,\n uint256 b\n+ /// ArithmeticOperatorReplacement(`*` |==> `**`) of: `return ((a)) * b;`\n ) public pure returns (uint256) {\n- return ((a)) * b;\n+ return ((a)) ** b;\n }\n \n // Expect 5 mutants:\n", + "id": "16", + "line": 47, + "name": "mutants/16/AOR/AOR.sol", + "op": "AOR", + "orig": "*", + "original": "AOR/AOR.sol", + "repl": "**" + }, + { + "col": 22, + "description": "ArithmeticOperatorReplacement", + "diff": "--- original\n+++ mutant\n@@ -43,8 +43,9 @@\n function unsigned_times_with_parens(\n uint256 a,\n uint256 b\n+ /// ArithmeticOperatorReplacement(`*` |==> `%`) of: `return ((a)) * b;`\n ) public pure returns (uint256) {\n- return ((a)) * b;\n+ return ((a)) % b;\n }\n \n // Expect 5 mutants:\n", + "id": "17", + "line": 47, + "name": "mutants/17/AOR/AOR.sol", + "op": "AOR", + "orig": "*", + "original": "AOR/AOR.sol", + "repl": "%" + }, + { + "col": 18, + "description": "ArithmeticOperatorReplacement", + "diff": "--- original\n+++ mutant\n@@ -54,7 +54,8 @@\n // a * b\n // a % b\n \n+ /// ArithmeticOperatorReplacement(`**` |==> `+`) of: `return a ** b;`\n function power(uint256 a, uint256 b) public pure returns (uint256) {\n- return a ** b;\n+ return a + b;\n }\n }\n", + "id": "18", + "line": 58, + "name": "mutants/18/AOR/AOR.sol", + "op": "AOR", + "orig": "**", + "original": "AOR/AOR.sol", + "repl": "+" + }, + { + "col": 18, + "description": "ArithmeticOperatorReplacement", + "diff": "--- original\n+++ mutant\n@@ -54,7 +54,8 @@\n // a * b\n // a % b\n \n+ /// ArithmeticOperatorReplacement(`**` |==> `-`) of: `return a ** b;`\n function power(uint256 a, uint256 b) public pure returns (uint256) {\n- return a ** b;\n+ return a - b;\n }\n }\n", + "id": "19", + "line": 58, + "name": "mutants/19/AOR/AOR.sol", + "op": "AOR", + "orig": "**", + "original": "AOR/AOR.sol", + "repl": "-" + }, + { + "col": 18, + "description": "ArithmeticOperatorReplacement", + "diff": "--- original\n+++ mutant\n@@ -54,7 +54,8 @@\n // a * b\n // a % b\n \n+ /// ArithmeticOperatorReplacement(`**` |==> `*`) of: `return a ** b;`\n function power(uint256 a, uint256 b) public pure returns (uint256) {\n- return a ** b;\n+ return a * b;\n }\n }\n", + "id": "20", + "line": 58, + "name": "mutants/20/AOR/AOR.sol", + "op": "AOR", + "orig": "**", + "original": "AOR/AOR.sol", + "repl": "*" + }, + { + "col": 18, + "description": "ArithmeticOperatorReplacement", + "diff": "--- original\n+++ mutant\n@@ -54,7 +54,8 @@\n // a * b\n // a % b\n \n+ /// ArithmeticOperatorReplacement(`**` |==> `/`) of: `return a ** b;`\n function power(uint256 a, uint256 b) public pure returns (uint256) {\n- return a ** b;\n+ return a / b;\n }\n }\n", + "id": "21", + "line": 58, + "name": "mutants/21/AOR/AOR.sol", + "op": "AOR", + "orig": "**", + "original": "AOR/AOR.sol", + "repl": "/" + }, + { + "col": 18, + "description": "ArithmeticOperatorReplacement", + "diff": "--- original\n+++ mutant\n@@ -54,7 +54,8 @@\n // a * b\n // a % b\n \n+ /// ArithmeticOperatorReplacement(`**` |==> `%`) of: `return a ** b;`\n function power(uint256 a, uint256 b) public pure returns (uint256) {\n- return a ** b;\n+ return a % b;\n }\n }\n", + "id": "22", + "line": 58, + "name": "mutants/22/AOR/AOR.sol", + "op": "AOR", + "orig": "**", + "original": "AOR/AOR.sol", + "repl": "%" + }, + { + "col": 18, + "description": "ConditionalOperatorReplacement", + "diff": "--- original\n+++ mutant\n@@ -6,8 +6,9 @@\n contract BOR {\n // Expect 1 mutants:\n // a & b;\n+ /// ConditionalOperatorReplacement(`|` |==> `&`) of: `return a | b;`\n function bw_or(int256 a, int256 b) public pure returns (int256) {\n- return a | b;\n+ return a & b;\n }\n \n // Expect 1 mutants:\n", + "id": "23", + "line": 10, + "name": "mutants/23/BOR/BOR.sol", + "op": "BOR", + "orig": "|", + "original": "BOR/BOR.sol", + "repl": "&" + }, + { + "col": 18, + "description": "ConditionalOperatorReplacement", + "diff": "--- original\n+++ mutant\n@@ -12,8 +12,9 @@\n \n // Expect 1 mutants:\n // a | b;\n+ /// ConditionalOperatorReplacement(`&` |==> `|`) of: `return a & b;`\n function bw_and(int256 a, int256 b) public pure returns (int256) {\n- return a & b;\n+ return a | b;\n }\n \n // Expect 1 mutants:\n", + "id": "24", + "line": 16, + "name": "mutants/24/BOR/BOR.sol", + "op": "BOR", + "orig": "&", + "original": "BOR/BOR.sol", + "repl": "|" + }, + { + "col": 18, + "description": "ConditionalOperatorReplacement", + "diff": "--- original\n+++ mutant\n@@ -18,7 +18,8 @@\n \n // Expect 1 mutants:\n // a | b;\n+ /// ConditionalOperatorReplacement(`^` |==> `&`) of: `return a ^ b;`\n function bw_xor(int256 a, int256 b) public pure returns (int256) {\n- return a ^ b;\n+ return a & b;\n }\n }\n", + "id": "25", + "line": 22, + "name": "mutants/25/BOR/BOR.sol", + "op": "BOR", + "orig": "^", + "original": "BOR/BOR.sol", + "repl": "&" + }, + { + "col": 38, + "description": "ElimDelegateCall", + "diff": "--- original\n+++ mutant\n@@ -12,8 +12,9 @@\n bool public delegateSuccessful;\n bytes public myData;\n \n+ /// ElimDelegateCall(`delegatecall` |==> `call`) of: `(bool success, ) = _contract.delegatecall(`\n function setVars(address _contract) public payable {\n- (bool success, ) = _contract.delegatecall(\n+ (bool success, ) = _contract.call(\n abi.encodeWithSignature(\"setVars(uint256)\", 1)\n );\n require(success, \"Delegatecall failed\");\n", + "id": "26", + "line": 16, + "name": "mutants/26/EDC/EDC.sol", + "op": "EDC", + "orig": "delegatecall", + "original": "EDC/EDC.sol", + "repl": "call" + }, + { + "col": 16, + "description": "LogicalOperatorReplacement", + "diff": "--- original\n+++ mutant\n@@ -5,8 +5,9 @@\n // This contract provides test functions for relational operator replacement (ROR)\n contract LOR {\n // Expect three mutants: a, b, false\n+ /// LogicalOperatorReplacement(`a && b` |==> `a`) of: `return a && b;`\n function and(bool a, bool b) public pure returns (bool) {\n- return a && b;\n+ return a;\n }\n \n // Expect three mutants: a, b, true\n", + "id": "27", + "line": 9, + "name": "mutants/27/LOR/LOR.sol", + "op": "LOR", + "orig": "a && b", + "original": "LOR/LOR.sol", + "repl": "a" + }, + { + "col": 16, + "description": "LogicalOperatorReplacement", + "diff": "--- original\n+++ mutant\n@@ -5,8 +5,9 @@\n // This contract provides test functions for relational operator replacement (ROR)\n contract LOR {\n // Expect three mutants: a, b, false\n+ /// LogicalOperatorReplacement(`a && b` |==> `b`) of: `return a && b;`\n function and(bool a, bool b) public pure returns (bool) {\n- return a && b;\n+ return b;\n }\n \n // Expect three mutants: a, b, true\n", + "id": "28", + "line": 9, + "name": "mutants/28/LOR/LOR.sol", + "op": "LOR", + "orig": "a && b", + "original": "LOR/LOR.sol", + "repl": "b" + }, + { + "col": 16, + "description": "LogicalOperatorReplacement", + "diff": "--- original\n+++ mutant\n@@ -5,8 +5,9 @@\n // This contract provides test functions for relational operator replacement (ROR)\n contract LOR {\n // Expect three mutants: a, b, false\n+ /// LogicalOperatorReplacement(`a && b` |==> `false`) of: `return a && b;`\n function and(bool a, bool b) public pure returns (bool) {\n- return a && b;\n+ return false;\n }\n \n // Expect three mutants: a, b, true\n", + "id": "29", + "line": 9, + "name": "mutants/29/LOR/LOR.sol", + "op": "LOR", + "orig": "a && b", + "original": "LOR/LOR.sol", + "repl": "false" + }, + { + "col": 16, + "description": "LogicalOperatorReplacement", + "diff": "--- original\n+++ mutant\n@@ -10,8 +10,9 @@\n }\n \n // Expect three mutants: a, b, true\n+ /// LogicalOperatorReplacement(`a || b` |==> `a`) of: `return a || b;`\n function or(bool a, bool b) public pure returns (bool) {\n- return a || b;\n+ return a;\n }\n \n // Expect three mutants, x < y, a != (x >= y), true\n", + "id": "30", + "line": 14, + "name": "mutants/30/LOR/LOR.sol", + "op": "LOR", + "orig": "a || b", + "original": "LOR/LOR.sol", + "repl": "a" + }, + { + "col": 16, + "description": "LogicalOperatorReplacement", + "diff": "--- original\n+++ mutant\n@@ -10,8 +10,9 @@\n }\n \n // Expect three mutants: a, b, true\n+ /// LogicalOperatorReplacement(`a || b` |==> `b`) of: `return a || b;`\n function or(bool a, bool b) public pure returns (bool) {\n- return a || b;\n+ return b;\n }\n \n // Expect three mutants, x < y, a != (x >= y), true\n", + "id": "31", + "line": 14, + "name": "mutants/31/LOR/LOR.sol", + "op": "LOR", + "orig": "a || b", + "original": "LOR/LOR.sol", + "repl": "b" + }, + { + "col": 16, + "description": "LogicalOperatorReplacement", + "diff": "--- original\n+++ mutant\n@@ -10,8 +10,9 @@\n }\n \n // Expect three mutants: a, b, true\n+ /// LogicalOperatorReplacement(`a || b` |==> `true`) of: `return a || b;`\n function or(bool a, bool b) public pure returns (bool) {\n- return a || b;\n+ return true;\n }\n \n // Expect three mutants, x < y, a != (x >= y), true\n", + "id": "32", + "line": 14, + "name": "mutants/32/LOR/LOR.sol", + "op": "LOR", + "orig": "a || b", + "original": "LOR/LOR.sol", + "repl": "true" + }, + { + "col": 16, + "description": "LogicalOperatorReplacement", + "diff": "--- original\n+++ mutant\n@@ -15,8 +15,9 @@\n }\n \n // Expect three mutants, x < y, a != (x >= y), true\n+ /// LogicalOperatorReplacement(`(x < y) || (a != (x >= y))` |==> `x < y`) of: `return (x < y) || (a != (x >= y));`\n function more_or(bool a, int x, int y) public pure returns (bool) {\n- return (x < y) || (a != (x >= y));\n+ return x < y;\n }\n \n function not(bool a) public pure returns (bool) {\n", + "id": "33", + "line": 19, + "name": "mutants/33/LOR/LOR.sol", + "op": "LOR", + "orig": "(x < y) || (a != (x >= y))", + "original": "LOR/LOR.sol", + "repl": "x < y" + }, + { + "col": 16, + "description": "LogicalOperatorReplacement", + "diff": "--- original\n+++ mutant\n@@ -15,8 +15,9 @@\n }\n \n // Expect three mutants, x < y, a != (x >= y), true\n+ /// LogicalOperatorReplacement(`(x < y) || (a != (x >= y))` |==> `a != (x >= y)`) of: `return (x < y) || (a != (x >= y));`\n function more_or(bool a, int x, int y) public pure returns (bool) {\n- return (x < y) || (a != (x >= y));\n+ return a != (x >= y);\n }\n \n function not(bool a) public pure returns (bool) {\n", + "id": "34", + "line": 19, + "name": "mutants/34/LOR/LOR.sol", + "op": "LOR", + "orig": "(x < y) || (a != (x >= y))", + "original": "LOR/LOR.sol", + "repl": "a != (x >= y)" + }, + { + "col": 16, + "description": "LogicalOperatorReplacement", + "diff": "--- original\n+++ mutant\n@@ -15,8 +15,9 @@\n }\n \n // Expect three mutants, x < y, a != (x >= y), true\n+ /// LogicalOperatorReplacement(`(x < y) || (a != (x >= y))` |==> `true`) of: `return (x < y) || (a != (x >= y));`\n function more_or(bool a, int x, int y) public pure returns (bool) {\n- return (x < y) || (a != (x >= y));\n+ return true;\n }\n \n function not(bool a) public pure returns (bool) {\n", + "id": "35", + "line": 19, + "name": "mutants/35/LOR/LOR.sol", + "op": "LOR", + "orig": "(x < y) || (a != (x >= y))", + "original": "LOR/LOR.sol", + "repl": "true" + }, + { + "col": 16, + "description": "LogicalOperatorReplacement", + "diff": "--- original\n+++ mutant\n@@ -19,7 +19,8 @@\n return (x < y) || (a != (x >= y));\n }\n \n+ /// LogicalOperatorReplacement(`!a` |==> `true`) of: `return !a;`\n function not(bool a) public pure returns (bool) {\n- return !a;\n+ return true;\n }\n }\n", + "id": "36", + "line": 23, + "name": "mutants/36/LOR/LOR.sol", + "op": "LOR", + "orig": "!a", + "original": "LOR/LOR.sol", + "repl": "true" + }, + { + "col": 16, + "description": "LogicalOperatorReplacement", + "diff": "--- original\n+++ mutant\n@@ -19,7 +19,8 @@\n return (x < y) || (a != (x >= y));\n }\n \n+ /// LogicalOperatorReplacement(`!a` |==> `false`) of: `return !a;`\n function not(bool a) public pure returns (bool) {\n- return !a;\n+ return false;\n }\n }\n", + "id": "37", + "line": 23, + "name": "mutants/37/LOR/LOR.sol", + "op": "LOR", + "orig": "!a", + "original": "LOR/LOR.sol", + "repl": "false" + }, + { + "col": 24, + "description": "LiteralValueReplacement", + "diff": "--- original\n+++ mutant\n@@ -11,8 +11,9 @@\n int256 zero_s = 0;\n \n // Expect 1 mutant: 1\n+ /// LiteralValueReplacement(`0` |==> `1`) of: `uint256 zero = 0;`\n function unsigned_zero() public pure returns (uint256) {\n- uint256 zero = 0;\n+ uint256 zero = 1;\n return zero;\n }\n \n", + "id": "38", + "line": 15, + "name": "mutants/38/LVR/LVR.sol", + "op": "LVR", + "orig": "0", + "original": "LVR/LVR.sol", + "repl": "1" + }, + { + "col": 23, + "description": "LiteralValueReplacement", + "diff": "--- original\n+++ mutant\n@@ -17,8 +17,9 @@\n }\n \n // Expect 2 mutant: 0, 2\n+ /// LiteralValueReplacement(`1` |==> `0`) of: `uint256 one = 1;`\n function unsigned_one() public pure returns (uint256) {\n- uint256 one = 1;\n+ uint256 one = 0;\n return one;\n }\n \n", + "id": "39", + "line": 21, + "name": "mutants/39/LVR/LVR.sol", + "op": "LVR", + "orig": "1", + "original": "LVR/LVR.sol", + "repl": "0" + }, + { + "col": 23, + "description": "LiteralValueReplacement", + "diff": "--- original\n+++ mutant\n@@ -17,8 +17,9 @@\n }\n \n // Expect 2 mutant: 0, 2\n+ /// LiteralValueReplacement(`1` |==> `2`) of: `uint256 one = 1;`\n function unsigned_one() public pure returns (uint256) {\n- uint256 one = 1;\n+ uint256 one = 2;\n return one;\n }\n \n", + "id": "40", + "line": 21, + "name": "mutants/40/LVR/LVR.sol", + "op": "LVR", + "orig": "1", + "original": "LVR/LVR.sol", + "repl": "2" + }, + { + "col": 26, + "description": "LiteralValueReplacement", + "diff": "--- original\n+++ mutant\n@@ -23,8 +23,9 @@\n }\n \n // Expect 2 mutants: 0, 1\n+ /// LiteralValueReplacement(`-1` |==> `0`) of: `int256 neg_one = -1;`\n function signed_neg_one() public pure returns (int256) {\n- int256 neg_one = -1;\n+ int256 neg_one = 0;\n return neg_one;\n }\n \n", + "id": "41", + "line": 27, + "name": "mutants/41/LVR/LVR.sol", + "op": "LVR", + "orig": "-1", + "original": "LVR/LVR.sol", + "repl": "0" + }, + { + "col": 26, + "description": "LiteralValueReplacement", + "diff": "--- original\n+++ mutant\n@@ -23,8 +23,9 @@\n }\n \n // Expect 2 mutants: 0, 1\n+ /// LiteralValueReplacement(`-1` |==> `1`) of: `int256 neg_one = -1;`\n function signed_neg_one() public pure returns (int256) {\n- int256 neg_one = -1;\n+ int256 neg_one = 1;\n return neg_one;\n }\n \n", + "id": "42", + "line": 27, + "name": "mutants/42/LVR/LVR.sol", + "op": "LVR", + "orig": "-1", + "original": "LVR/LVR.sol", + "repl": "1" + }, + { + "col": 26, + "description": "LiteralValueReplacement", + "diff": "--- original\n+++ mutant\n@@ -23,8 +23,9 @@\n }\n \n // Expect 2 mutants: 0, 1\n+ /// LiteralValueReplacement(`-1` |==> `-2`) of: `int256 neg_one = -1;`\n function signed_neg_one() public pure returns (int256) {\n- int256 neg_one = -1;\n+ int256 neg_one = -2;\n return neg_one;\n }\n \n", + "id": "43", + "line": 27, + "name": "mutants/43/LVR/LVR.sol", + "op": "LVR", + "orig": "-1", + "original": "LVR/LVR.sol", + "repl": "-2" + }, + { + "col": 26, + "description": "LiteralValueReplacement", + "diff": "--- original\n+++ mutant\n@@ -29,8 +29,9 @@\n }\n \n // Expect 2 mutants: -1, 0\n+ /// LiteralValueReplacement(`1` |==> `0`) of: `int256 pos_one = 1;`\n function signed_pos_one() public pure returns (int256) {\n- int256 pos_one = 1;\n+ int256 pos_one = 0;\n return pos_one;\n }\n \n", + "id": "44", + "line": 33, + "name": "mutants/44/LVR/LVR.sol", + "op": "LVR", + "orig": "1", + "original": "LVR/LVR.sol", + "repl": "0" + }, + { + "col": 26, + "description": "LiteralValueReplacement", + "diff": "--- original\n+++ mutant\n@@ -29,8 +29,9 @@\n }\n \n // Expect 2 mutants: -1, 0\n+ /// LiteralValueReplacement(`1` |==> `-1`) of: `int256 pos_one = 1;`\n function signed_pos_one() public pure returns (int256) {\n- int256 pos_one = 1;\n+ int256 pos_one = -1;\n return pos_one;\n }\n \n", + "id": "45", + "line": 33, + "name": "mutants/45/LVR/LVR.sol", + "op": "LVR", + "orig": "1", + "original": "LVR/LVR.sol", + "repl": "-1" + }, + { + "col": 26, + "description": "LiteralValueReplacement", + "diff": "--- original\n+++ mutant\n@@ -29,8 +29,9 @@\n }\n \n // Expect 2 mutants: -1, 0\n+ /// LiteralValueReplacement(`1` |==> `2`) of: `int256 pos_one = 1;`\n function signed_pos_one() public pure returns (int256) {\n- int256 pos_one = 1;\n+ int256 pos_one = 2;\n return pos_one;\n }\n \n", + "id": "46", + "line": 33, + "name": "mutants/46/LVR/LVR.sol", + "op": "LVR", + "orig": "1", + "original": "LVR/LVR.sol", + "repl": "2" + }, + { + "col": 23, + "description": "LiteralValueReplacement", + "diff": "--- original\n+++ mutant\n@@ -35,8 +35,9 @@\n }\n \n // Expect 2 mutants: -1, 1\n+ /// LiteralValueReplacement(`0` |==> `-1`) of: `int256 zero = 0;`\n function signed_zero() public pure returns (int256) {\n- int256 zero = 0;\n+ int256 zero = -1;\n return zero;\n }\n }\n", + "id": "47", + "line": 39, + "name": "mutants/47/LVR/LVR.sol", + "op": "LVR", + "orig": "0", + "original": "LVR/LVR.sol", + "repl": "-1" + }, + { + "col": 23, + "description": "LiteralValueReplacement", + "diff": "--- original\n+++ mutant\n@@ -35,8 +35,9 @@\n }\n \n // Expect 2 mutants: -1, 1\n+ /// LiteralValueReplacement(`0` |==> `1`) of: `int256 zero = 0;`\n function signed_zero() public pure returns (int256) {\n- int256 zero = 0;\n+ int256 zero = 1;\n return zero;\n }\n }\n", + "id": "48", + "line": 39, + "name": "mutants/48/LVR/LVR.sol", + "op": "LVR", + "orig": "0", + "original": "LVR/LVR.sol", + "repl": "1" + }, + { + "col": 18, + "description": "RelationalOperatorReplacement", + "diff": "--- original\n+++ mutant\n@@ -5,8 +5,9 @@\n // This contract provides test functions for relational operator replacement (ROR)\n contract ROR {\n // Expect 3 mutants: x <= y, x != y, false\n+ /// RelationalOperatorReplacement(`<` |==> `<=`) of: `return x < y;`\n function less(uint256 x, uint256 y) public pure returns (bool) {\n- return x < y;\n+ return x <= y;\n }\n \n // Expect 3 mutants: x < y, x == y, true\n", + "id": "49", + "line": 9, + "name": "mutants/49/ROR/ROR.sol", + "op": "ROR", + "orig": "<", + "original": "ROR/ROR.sol", + "repl": "<=" + }, + { + "col": 18, + "description": "RelationalOperatorReplacement", + "diff": "--- original\n+++ mutant\n@@ -5,8 +5,9 @@\n // This contract provides test functions for relational operator replacement (ROR)\n contract ROR {\n // Expect 3 mutants: x <= y, x != y, false\n+ /// RelationalOperatorReplacement(`<` |==> `!=`) of: `return x < y;`\n function less(uint256 x, uint256 y) public pure returns (bool) {\n- return x < y;\n+ return x != y;\n }\n \n // Expect 3 mutants: x < y, x == y, true\n", + "id": "50", + "line": 9, + "name": "mutants/50/ROR/ROR.sol", + "op": "ROR", + "orig": "<", + "original": "ROR/ROR.sol", + "repl": "!=" + }, + { + "col": 16, + "description": "RelationalOperatorReplacement", + "diff": "--- original\n+++ mutant\n@@ -5,8 +5,9 @@\n // This contract provides test functions for relational operator replacement (ROR)\n contract ROR {\n // Expect 3 mutants: x <= y, x != y, false\n+ /// RelationalOperatorReplacement(`x < y` |==> `false`) of: `return x < y;`\n function less(uint256 x, uint256 y) public pure returns (bool) {\n- return x < y;\n+ return false;\n }\n \n // Expect 3 mutants: x < y, x == y, true\n", + "id": "51", + "line": 9, + "name": "mutants/51/ROR/ROR.sol", + "op": "ROR", + "orig": "x < y", + "original": "ROR/ROR.sol", + "repl": "false" + }, + { + "col": 18, + "description": "RelationalOperatorReplacement", + "diff": "--- original\n+++ mutant\n@@ -10,8 +10,9 @@\n }\n \n // Expect 3 mutants: x < y, x == y, true\n+ /// RelationalOperatorReplacement(`<=` |==> `<`) of: `return x <= y;`\n function less_equal(uint256 x, uint256 y) public pure returns (bool) {\n- return x <= y;\n+ return x < y;\n }\n \n // Expect 3 mutants: x >= y, x != y, false\n", + "id": "52", + "line": 14, + "name": "mutants/52/ROR/ROR.sol", + "op": "ROR", + "orig": "<=", + "original": "ROR/ROR.sol", + "repl": "<" + }, + { + "col": 18, + "description": "RelationalOperatorReplacement", + "diff": "--- original\n+++ mutant\n@@ -10,8 +10,9 @@\n }\n \n // Expect 3 mutants: x < y, x == y, true\n+ /// RelationalOperatorReplacement(`<=` |==> `==`) of: `return x <= y;`\n function less_equal(uint256 x, uint256 y) public pure returns (bool) {\n- return x <= y;\n+ return x == y;\n }\n \n // Expect 3 mutants: x >= y, x != y, false\n", + "id": "53", + "line": 14, + "name": "mutants/53/ROR/ROR.sol", + "op": "ROR", + "orig": "<=", + "original": "ROR/ROR.sol", + "repl": "==" + }, + { + "col": 16, + "description": "RelationalOperatorReplacement", + "diff": "--- original\n+++ mutant\n@@ -10,8 +10,9 @@\n }\n \n // Expect 3 mutants: x < y, x == y, true\n+ /// RelationalOperatorReplacement(`x <= y` |==> `true`) of: `return x <= y;`\n function less_equal(uint256 x, uint256 y) public pure returns (bool) {\n- return x <= y;\n+ return true;\n }\n \n // Expect 3 mutants: x >= y, x != y, false\n", + "id": "54", + "line": 14, + "name": "mutants/54/ROR/ROR.sol", + "op": "ROR", + "orig": "x <= y", + "original": "ROR/ROR.sol", + "repl": "true" + }, + { + "col": 18, + "description": "RelationalOperatorReplacement", + "diff": "--- original\n+++ mutant\n@@ -15,8 +15,9 @@\n }\n \n // Expect 3 mutants: x >= y, x != y, false\n+ /// RelationalOperatorReplacement(`>` |==> `>=`) of: `return x > y;`\n function more(uint256 x, uint256 y) public pure returns (bool) {\n- return x > y;\n+ return x >= y;\n }\n \n // Expect 3 mutants: x > y, x == y, true\n", + "id": "55", + "line": 19, + "name": "mutants/55/ROR/ROR.sol", + "op": "ROR", + "orig": ">", + "original": "ROR/ROR.sol", + "repl": ">=" + }, + { + "col": 18, + "description": "RelationalOperatorReplacement", + "diff": "--- original\n+++ mutant\n@@ -15,8 +15,9 @@\n }\n \n // Expect 3 mutants: x >= y, x != y, false\n+ /// RelationalOperatorReplacement(`>` |==> `!=`) of: `return x > y;`\n function more(uint256 x, uint256 y) public pure returns (bool) {\n- return x > y;\n+ return x != y;\n }\n \n // Expect 3 mutants: x > y, x == y, true\n", + "id": "56", + "line": 19, + "name": "mutants/56/ROR/ROR.sol", + "op": "ROR", + "orig": ">", + "original": "ROR/ROR.sol", + "repl": "!=" + }, + { + "col": 16, + "description": "RelationalOperatorReplacement", + "diff": "--- original\n+++ mutant\n@@ -15,8 +15,9 @@\n }\n \n // Expect 3 mutants: x >= y, x != y, false\n+ /// RelationalOperatorReplacement(`x > y` |==> `false`) of: `return x > y;`\n function more(uint256 x, uint256 y) public pure returns (bool) {\n- return x > y;\n+ return false;\n }\n \n // Expect 3 mutants: x > y, x == y, true\n", + "id": "57", + "line": 19, + "name": "mutants/57/ROR/ROR.sol", + "op": "ROR", + "orig": "x > y", + "original": "ROR/ROR.sol", + "repl": "false" + }, + { + "col": 18, + "description": "RelationalOperatorReplacement", + "diff": "--- original\n+++ mutant\n@@ -20,8 +20,9 @@\n }\n \n // Expect 3 mutants: x > y, x == y, true\n+ /// RelationalOperatorReplacement(`>=` |==> `>`) of: `return x >= y;`\n function more_equal(uint256 x, uint256 y) public pure returns (bool) {\n- return x >= y;\n+ return x > y;\n }\n \n // Expect 3 mutants: x >= y, x <= y, false\n", + "id": "58", + "line": 24, + "name": "mutants/58/ROR/ROR.sol", + "op": "ROR", + "orig": ">=", + "original": "ROR/ROR.sol", + "repl": ">" + }, + { + "col": 18, + "description": "RelationalOperatorReplacement", + "diff": "--- original\n+++ mutant\n@@ -20,8 +20,9 @@\n }\n \n // Expect 3 mutants: x > y, x == y, true\n+ /// RelationalOperatorReplacement(`>=` |==> `==`) of: `return x >= y;`\n function more_equal(uint256 x, uint256 y) public pure returns (bool) {\n- return x >= y;\n+ return x == y;\n }\n \n // Expect 3 mutants: x >= y, x <= y, false\n", + "id": "59", + "line": 24, + "name": "mutants/59/ROR/ROR.sol", + "op": "ROR", + "orig": ">=", + "original": "ROR/ROR.sol", + "repl": "==" + }, + { + "col": 16, + "description": "RelationalOperatorReplacement", + "diff": "--- original\n+++ mutant\n@@ -20,8 +20,9 @@\n }\n \n // Expect 3 mutants: x > y, x == y, true\n+ /// RelationalOperatorReplacement(`x >= y` |==> `true`) of: `return x >= y;`\n function more_equal(uint256 x, uint256 y) public pure returns (bool) {\n- return x >= y;\n+ return true;\n }\n \n // Expect 3 mutants: x >= y, x <= y, false\n", + "id": "60", + "line": 24, + "name": "mutants/60/ROR/ROR.sol", + "op": "ROR", + "orig": "x >= y", + "original": "ROR/ROR.sol", + "repl": "true" + }, + { + "col": 18, + "description": "RelationalOperatorReplacement", + "diff": "--- original\n+++ mutant\n@@ -25,8 +25,9 @@\n }\n \n // Expect 3 mutants: x >= y, x <= y, false\n+ /// RelationalOperatorReplacement(`==` |==> `<=`) of: `return x == y;`\n function equal_ord(uint256 x, uint256 y) public pure returns (bool) {\n- return x == y;\n+ return x <= y;\n }\n \n // Expect 2 mutants: true, false\n", + "id": "61", + "line": 29, + "name": "mutants/61/ROR/ROR.sol", + "op": "ROR", + "orig": "==", + "original": "ROR/ROR.sol", + "repl": "<=" + }, + { + "col": 18, + "description": "RelationalOperatorReplacement", + "diff": "--- original\n+++ mutant\n@@ -25,8 +25,9 @@\n }\n \n // Expect 3 mutants: x >= y, x <= y, false\n+ /// RelationalOperatorReplacement(`==` |==> `>=`) of: `return x == y;`\n function equal_ord(uint256 x, uint256 y) public pure returns (bool) {\n- return x == y;\n+ return x >= y;\n }\n \n // Expect 2 mutants: true, false\n", + "id": "62", + "line": 29, + "name": "mutants/62/ROR/ROR.sol", + "op": "ROR", + "orig": "==", + "original": "ROR/ROR.sol", + "repl": ">=" + }, + { + "col": 16, + "description": "RelationalOperatorReplacement", + "diff": "--- original\n+++ mutant\n@@ -25,8 +25,9 @@\n }\n \n // Expect 3 mutants: x >= y, x <= y, false\n+ /// RelationalOperatorReplacement(`x == y` |==> `false`) of: `return x == y;`\n function equal_ord(uint256 x, uint256 y) public pure returns (bool) {\n- return x == y;\n+ return false;\n }\n \n // Expect 2 mutants: true, false\n", + "id": "63", + "line": 29, + "name": "mutants/63/ROR/ROR.sol", + "op": "ROR", + "orig": "x == y", + "original": "ROR/ROR.sol", + "repl": "false" + }, + { + "col": 16, + "description": "RelationalOperatorReplacement", + "diff": "--- original\n+++ mutant\n@@ -30,8 +30,9 @@\n }\n \n // Expect 2 mutants: true, false\n+ /// RelationalOperatorReplacement(`x == y` |==> `false`) of: `return x == y;`\n function equal_not_ord(bool x, bool y) public pure returns (bool) {\n- return x == y;\n+ return false;\n }\n \n // Expect 3 mutants: x > y, x < y, true\n", + "id": "64", + "line": 34, + "name": "mutants/64/ROR/ROR.sol", + "op": "ROR", + "orig": "x == y", + "original": "ROR/ROR.sol", + "repl": "false" + }, + { + "col": 18, + "description": "RelationalOperatorReplacement", + "diff": "--- original\n+++ mutant\n@@ -35,8 +35,9 @@\n }\n \n // Expect 3 mutants: x > y, x < y, true\n+ /// RelationalOperatorReplacement(`!=` |==> `<`) of: `return x != y;`\n function not_equal_ord(uint256 x, uint256 y) public pure returns (bool) {\n- return x != y;\n+ return x < y;\n }\n \n // Expect 2 mutants: true, false\n", + "id": "65", + "line": 39, + "name": "mutants/65/ROR/ROR.sol", + "op": "ROR", + "orig": "!=", + "original": "ROR/ROR.sol", + "repl": "<" + }, + { + "col": 18, + "description": "RelationalOperatorReplacement", + "diff": "--- original\n+++ mutant\n@@ -35,8 +35,9 @@\n }\n \n // Expect 3 mutants: x > y, x < y, true\n+ /// RelationalOperatorReplacement(`!=` |==> `>`) of: `return x != y;`\n function not_equal_ord(uint256 x, uint256 y) public pure returns (bool) {\n- return x != y;\n+ return x > y;\n }\n \n // Expect 2 mutants: true, false\n", + "id": "66", + "line": 39, + "name": "mutants/66/ROR/ROR.sol", + "op": "ROR", + "orig": "!=", + "original": "ROR/ROR.sol", + "repl": ">" + }, + { + "col": 16, + "description": "RelationalOperatorReplacement", + "diff": "--- original\n+++ mutant\n@@ -35,8 +35,9 @@\n }\n \n // Expect 3 mutants: x > y, x < y, true\n+ /// RelationalOperatorReplacement(`x != y` |==> `true`) of: `return x != y;`\n function not_equal_ord(uint256 x, uint256 y) public pure returns (bool) {\n- return x != y;\n+ return true;\n }\n \n // Expect 2 mutants: true, false\n", + "id": "67", + "line": 39, + "name": "mutants/67/ROR/ROR.sol", + "op": "ROR", + "orig": "x != y", + "original": "ROR/ROR.sol", + "repl": "true" + }, + { + "col": 16, + "description": "RelationalOperatorReplacement", + "diff": "--- original\n+++ mutant\n@@ -40,8 +40,9 @@\n }\n \n // Expect 2 mutants: true, false\n+ /// RelationalOperatorReplacement(`x != y` |==> `true`) of: `return x != y;`\n function not_equal_not_ord(bool x, bool y) public pure returns (bool) {\n- return x != y;\n+ return true;\n }\n \n // Expect 3 mutants: (x + y) > z, (x + y) == z, true\n", + "id": "68", + "line": 44, + "name": "mutants/68/ROR/ROR.sol", + "op": "ROR", + "orig": "x != y", + "original": "ROR/ROR.sol", + "repl": "true" + }, + { + "col": 24, + "description": "RelationalOperatorReplacement", + "diff": "--- original\n+++ mutant\n@@ -49,8 +49,9 @@\n uint256 x,\n uint256 y,\n uint256 z\n+ /// RelationalOperatorReplacement(`>=` |==> `>`) of: `return (x + y) >= z;`\n ) public pure returns (bool) {\n- return (x + y) >= z;\n+ return (x + y) > z;\n }\n \n // Expect 3 mutants: (x + y) > z, (x + y) < z, true\n", + "id": "69", + "line": 53, + "name": "mutants/69/ROR/ROR.sol", + "op": "ROR", + "orig": ">=", + "original": "ROR/ROR.sol", + "repl": ">" + }, + { + "col": 24, + "description": "RelationalOperatorReplacement", + "diff": "--- original\n+++ mutant\n@@ -49,8 +49,9 @@\n uint256 x,\n uint256 y,\n uint256 z\n+ /// RelationalOperatorReplacement(`>=` |==> `==`) of: `return (x + y) >= z;`\n ) public pure returns (bool) {\n- return (x + y) >= z;\n+ return (x + y) == z;\n }\n \n // Expect 3 mutants: (x + y) > z, (x + y) < z, true\n", + "id": "70", + "line": 53, + "name": "mutants/70/ROR/ROR.sol", + "op": "ROR", + "orig": ">=", + "original": "ROR/ROR.sol", + "repl": "==" + }, + { + "col": 16, + "description": "RelationalOperatorReplacement", + "diff": "--- original\n+++ mutant\n@@ -49,8 +49,9 @@\n uint256 x,\n uint256 y,\n uint256 z\n+ /// RelationalOperatorReplacement(`(x + y) >= z` |==> `true`) of: `return (x + y) >= z;`\n ) public pure returns (bool) {\n- return (x + y) >= z;\n+ return true;\n }\n \n // Expect 3 mutants: (x + y) > z, (x + y) < z, true\n", + "id": "71", + "line": 53, + "name": "mutants/71/ROR/ROR.sol", + "op": "ROR", + "orig": "(x + y) >= z", + "original": "ROR/ROR.sol", + "repl": "true" + }, + { + "col": 24, + "description": "RelationalOperatorReplacement", + "diff": "--- original\n+++ mutant\n@@ -58,7 +58,8 @@\n uint256 x,\n uint256 y,\n uint256 z\n+ /// RelationalOperatorReplacement(`!=` |==> `<`) of: `return (x + y) != z;`\n ) public pure returns (bool) {\n- return (x + y) != z;\n+ return (x + y) < z;\n }\n }\n", + "id": "72", + "line": 62, + "name": "mutants/72/ROR/ROR.sol", + "op": "ROR", + "orig": "!=", + "original": "ROR/ROR.sol", + "repl": "<" + }, + { + "col": 24, + "description": "RelationalOperatorReplacement", + "diff": "--- original\n+++ mutant\n@@ -58,7 +58,8 @@\n uint256 x,\n uint256 y,\n uint256 z\n+ /// RelationalOperatorReplacement(`!=` |==> `>`) of: `return (x + y) != z;`\n ) public pure returns (bool) {\n- return (x + y) != z;\n+ return (x + y) > z;\n }\n }\n", + "id": "73", + "line": 62, + "name": "mutants/73/ROR/ROR.sol", + "op": "ROR", + "orig": "!=", + "original": "ROR/ROR.sol", + "repl": ">" + }, + { + "col": 16, + "description": "RelationalOperatorReplacement", + "diff": "--- original\n+++ mutant\n@@ -58,7 +58,8 @@\n uint256 x,\n uint256 y,\n uint256 z\n+ /// RelationalOperatorReplacement(`(x + y) != z` |==> `true`) of: `return (x + y) != z;`\n ) public pure returns (bool) {\n- return (x + y) != z;\n+ return true;\n }\n }\n", + "id": "74", + "line": 62, + "name": "mutants/74/ROR/ROR.sol", + "op": "ROR", + "orig": "(x + y) != z", + "original": "ROR/ROR.sol", + "repl": "true" + }, + { + "col": 16, + "description": "UnaryOperatorReplacement", + "diff": "--- original\n+++ mutant\n@@ -10,8 +10,9 @@\n }\n \n // Expect a single mutant: -x\n+ /// UnaryOperatorReplacement(`~` |==> `-`) of: `return ~x;`\n function signed_bw_not(int256 x) public pure returns (int256) {\n- return ~x;\n+ return -x;\n }\n \n // Expect a single mutant: ~x\n", + "id": "75", + "line": 14, + "name": "mutants/75/UOR/UOR.sol", + "op": "UOR", + "orig": "~", + "original": "UOR/UOR.sol", + "repl": "-" + }, + { + "col": 16, + "description": "UnaryOperatorReplacement", + "diff": "--- original\n+++ mutant\n@@ -15,7 +15,8 @@\n }\n \n // Expect a single mutant: ~x\n+ /// UnaryOperatorReplacement(`-` |==> `~`) of: `return -x;`\n function signed_neg(int256 x) public pure returns (int256) {\n- return -x;\n+ return ~x;\n }\n }\n", + "id": "76", + "line": 19, + "name": "mutants/76/UOR/UOR.sol", + "op": "UOR", + "orig": "-", + "original": "UOR/UOR.sol", + "repl": "~" + } +] \ No newline at end of file diff --git a/resources/regressions/all_ops.json/mutants.log b/resources/regressions/all_ops.json/mutants.log new file mode 100644 index 0000000..e3828c3 --- /dev/null +++ b/resources/regressions/all_ops.json/mutants.log @@ -0,0 +1,76 @@ +1,AOR,AOR/AOR.sol,13:18,+,- +2,AOR,AOR/AOR.sol,13:18,+,* +3,AOR,AOR/AOR.sol,13:18,+,/ +4,AOR,AOR/AOR.sol,13:18,+,% +5,AOR,AOR/AOR.sol,22:18,-,+ +6,AOR,AOR/AOR.sol,22:18,-,* +7,AOR,AOR/AOR.sol,22:18,-,/ +8,AOR,AOR/AOR.sol,22:18,-,% +9,AOR,AOR/AOR.sol,34:22,*,+ +10,AOR,AOR/AOR.sol,34:22,*,- +11,AOR,AOR/AOR.sol,34:22,*,/ +12,AOR,AOR/AOR.sol,34:22,*,% +13,AOR,AOR/AOR.sol,47:22,*,+ +14,AOR,AOR/AOR.sol,47:22,*,- +15,AOR,AOR/AOR.sol,47:22,*,/ +16,AOR,AOR/AOR.sol,47:22,*,** +17,AOR,AOR/AOR.sol,47:22,*,% +18,AOR,AOR/AOR.sol,58:18,**,+ +19,AOR,AOR/AOR.sol,58:18,**,- +20,AOR,AOR/AOR.sol,58:18,**,* +21,AOR,AOR/AOR.sol,58:18,**,/ +22,AOR,AOR/AOR.sol,58:18,**,% +23,BOR,BOR/BOR.sol,10:18,|,& +24,BOR,BOR/BOR.sol,16:18,&,| +25,BOR,BOR/BOR.sol,22:18,^,& +26,EDC,EDC/EDC.sol,16:38,delegatecall,call +27,LOR,LOR/LOR.sol,9:16,a && b,a +28,LOR,LOR/LOR.sol,9:16,a && b,b +29,LOR,LOR/LOR.sol,9:16,a && b,false +30,LOR,LOR/LOR.sol,14:16,a || b,a +31,LOR,LOR/LOR.sol,14:16,a || b,b +32,LOR,LOR/LOR.sol,14:16,a || b,true +33,LOR,LOR/LOR.sol,19:16,(x < y) || (a != (x >= y)),x < y +34,LOR,LOR/LOR.sol,19:16,(x < y) || (a != (x >= y)),a != (x >= y) +35,LOR,LOR/LOR.sol,19:16,(x < y) || (a != (x >= y)),true +36,LOR,LOR/LOR.sol,23:16,!a,true +37,LOR,LOR/LOR.sol,23:16,!a,false +38,LVR,LVR/LVR.sol,15:24,0,1 +39,LVR,LVR/LVR.sol,21:23,1,0 +40,LVR,LVR/LVR.sol,21:23,1,2 +41,LVR,LVR/LVR.sol,27:26,-1,0 +42,LVR,LVR/LVR.sol,27:26,-1,1 +43,LVR,LVR/LVR.sol,27:26,-1,-2 +44,LVR,LVR/LVR.sol,33:26,1,0 +45,LVR,LVR/LVR.sol,33:26,1,-1 +46,LVR,LVR/LVR.sol,33:26,1,2 +47,LVR,LVR/LVR.sol,39:23,0,-1 +48,LVR,LVR/LVR.sol,39:23,0,1 +49,ROR,ROR/ROR.sol,9:18,<,<= +50,ROR,ROR/ROR.sol,9:18,<,!= +51,ROR,ROR/ROR.sol,9:16,x < y,false +52,ROR,ROR/ROR.sol,14:18,<=,< +53,ROR,ROR/ROR.sol,14:18,<=,== +54,ROR,ROR/ROR.sol,14:16,x <= y,true +55,ROR,ROR/ROR.sol,19:18,>,>= +56,ROR,ROR/ROR.sol,19:18,>,!= +57,ROR,ROR/ROR.sol,19:16,x > y,false +58,ROR,ROR/ROR.sol,24:18,>=,> +59,ROR,ROR/ROR.sol,24:18,>=,== +60,ROR,ROR/ROR.sol,24:16,x >= y,true +61,ROR,ROR/ROR.sol,29:18,==,<= +62,ROR,ROR/ROR.sol,29:18,==,>= +63,ROR,ROR/ROR.sol,29:16,x == y,false +64,ROR,ROR/ROR.sol,34:16,x == y,false +65,ROR,ROR/ROR.sol,39:18,!=,< +66,ROR,ROR/ROR.sol,39:18,!=,> +67,ROR,ROR/ROR.sol,39:16,x != y,true +68,ROR,ROR/ROR.sol,44:16,x != y,true +69,ROR,ROR/ROR.sol,53:24,>=,> +70,ROR,ROR/ROR.sol,53:24,>=,== +71,ROR,ROR/ROR.sol,53:16,(x + y) >= z,true +72,ROR,ROR/ROR.sol,62:24,!=,< +73,ROR,ROR/ROR.sol,62:24,!=,> +74,ROR,ROR/ROR.sol,62:16,(x + y) != z,true +75,UOR,UOR/UOR.sol,14:16,~,- +76,UOR,UOR/UOR.sol,19:16,-,~ diff --git a/resources/regressions/all_ops.json/mutants/1/AOR/AOR.sol b/resources/regressions/all_ops.json/mutants/1/AOR/AOR.sol new file mode 100644 index 0000000..9b516ff --- /dev/null +++ b/resources/regressions/all_ops.json/mutants/1/AOR/AOR.sol @@ -0,0 +1,61 @@ +// SPDX-License-Identifier: GPL-3.0-only +pragma solidity >0.7.0; +pragma experimental ABIEncoderV2; + +// This contract provides test functions for Arithmetic operator replacement +contract AOR { + // Expect 4 mutants: + // a - b + // a * b + // a / b + // a % b + /// ArithmeticOperatorReplacement(`+` |==> `-`) of: `return a + b;` + function plus(int256 a, int256 b) public pure returns (int256) { + return a - b; + } + + // Expect 4 mutants: + // a + b + // a * b + // a / b + // a % b + function minus(int256 a, int256 b) public pure returns (int256) { + return a - b; + } + + // Expect 4 mutants: + // a - b + // a * b + // a / b + // a % b + function times_with_parens( + int256 a, + int256 b + ) public pure returns (int256) { + return ((a)) * b; + } + + // Expect 5 mutants: + // a + b + // a - b + // a / b + // a ** b + // a % b + function unsigned_times_with_parens( + uint256 a, + uint256 b + ) public pure returns (uint256) { + return ((a)) * b; + } + + // Expect 5 mutants: + // a + b + // a - b + // a / b + // a * b + // a % b + + function power(uint256 a, uint256 b) public pure returns (uint256) { + return a ** b; + } +} diff --git a/resources/regressions/all_ops.json/mutants/10/AOR/AOR.sol b/resources/regressions/all_ops.json/mutants/10/AOR/AOR.sol new file mode 100644 index 0000000..c31b43f --- /dev/null +++ b/resources/regressions/all_ops.json/mutants/10/AOR/AOR.sol @@ -0,0 +1,61 @@ +// SPDX-License-Identifier: GPL-3.0-only +pragma solidity >0.7.0; +pragma experimental ABIEncoderV2; + +// This contract provides test functions for Arithmetic operator replacement +contract AOR { + // Expect 4 mutants: + // a - b + // a * b + // a / b + // a % b + function plus(int256 a, int256 b) public pure returns (int256) { + return a + b; + } + + // Expect 4 mutants: + // a + b + // a * b + // a / b + // a % b + function minus(int256 a, int256 b) public pure returns (int256) { + return a - b; + } + + // Expect 4 mutants: + // a - b + // a * b + // a / b + // a % b + function times_with_parens( + int256 a, + int256 b + /// ArithmeticOperatorReplacement(`*` |==> `-`) of: `return ((a)) * b;` + ) public pure returns (int256) { + return ((a)) - b; + } + + // Expect 5 mutants: + // a + b + // a - b + // a / b + // a ** b + // a % b + function unsigned_times_with_parens( + uint256 a, + uint256 b + ) public pure returns (uint256) { + return ((a)) * b; + } + + // Expect 5 mutants: + // a + b + // a - b + // a / b + // a * b + // a % b + + function power(uint256 a, uint256 b) public pure returns (uint256) { + return a ** b; + } +} diff --git a/resources/regressions/all_ops.json/mutants/11/AOR/AOR.sol b/resources/regressions/all_ops.json/mutants/11/AOR/AOR.sol new file mode 100644 index 0000000..823139e --- /dev/null +++ b/resources/regressions/all_ops.json/mutants/11/AOR/AOR.sol @@ -0,0 +1,61 @@ +// SPDX-License-Identifier: GPL-3.0-only +pragma solidity >0.7.0; +pragma experimental ABIEncoderV2; + +// This contract provides test functions for Arithmetic operator replacement +contract AOR { + // Expect 4 mutants: + // a - b + // a * b + // a / b + // a % b + function plus(int256 a, int256 b) public pure returns (int256) { + return a + b; + } + + // Expect 4 mutants: + // a + b + // a * b + // a / b + // a % b + function minus(int256 a, int256 b) public pure returns (int256) { + return a - b; + } + + // Expect 4 mutants: + // a - b + // a * b + // a / b + // a % b + function times_with_parens( + int256 a, + int256 b + /// ArithmeticOperatorReplacement(`*` |==> `/`) of: `return ((a)) * b;` + ) public pure returns (int256) { + return ((a)) / b; + } + + // Expect 5 mutants: + // a + b + // a - b + // a / b + // a ** b + // a % b + function unsigned_times_with_parens( + uint256 a, + uint256 b + ) public pure returns (uint256) { + return ((a)) * b; + } + + // Expect 5 mutants: + // a + b + // a - b + // a / b + // a * b + // a % b + + function power(uint256 a, uint256 b) public pure returns (uint256) { + return a ** b; + } +} diff --git a/resources/regressions/all_ops.json/mutants/12/AOR/AOR.sol b/resources/regressions/all_ops.json/mutants/12/AOR/AOR.sol new file mode 100644 index 0000000..aa4ecd0 --- /dev/null +++ b/resources/regressions/all_ops.json/mutants/12/AOR/AOR.sol @@ -0,0 +1,61 @@ +// SPDX-License-Identifier: GPL-3.0-only +pragma solidity >0.7.0; +pragma experimental ABIEncoderV2; + +// This contract provides test functions for Arithmetic operator replacement +contract AOR { + // Expect 4 mutants: + // a - b + // a * b + // a / b + // a % b + function plus(int256 a, int256 b) public pure returns (int256) { + return a + b; + } + + // Expect 4 mutants: + // a + b + // a * b + // a / b + // a % b + function minus(int256 a, int256 b) public pure returns (int256) { + return a - b; + } + + // Expect 4 mutants: + // a - b + // a * b + // a / b + // a % b + function times_with_parens( + int256 a, + int256 b + /// ArithmeticOperatorReplacement(`*` |==> `%`) of: `return ((a)) * b;` + ) public pure returns (int256) { + return ((a)) % b; + } + + // Expect 5 mutants: + // a + b + // a - b + // a / b + // a ** b + // a % b + function unsigned_times_with_parens( + uint256 a, + uint256 b + ) public pure returns (uint256) { + return ((a)) * b; + } + + // Expect 5 mutants: + // a + b + // a - b + // a / b + // a * b + // a % b + + function power(uint256 a, uint256 b) public pure returns (uint256) { + return a ** b; + } +} diff --git a/resources/regressions/all_ops.json/mutants/13/AOR/AOR.sol b/resources/regressions/all_ops.json/mutants/13/AOR/AOR.sol new file mode 100644 index 0000000..8666cef --- /dev/null +++ b/resources/regressions/all_ops.json/mutants/13/AOR/AOR.sol @@ -0,0 +1,61 @@ +// SPDX-License-Identifier: GPL-3.0-only +pragma solidity >0.7.0; +pragma experimental ABIEncoderV2; + +// This contract provides test functions for Arithmetic operator replacement +contract AOR { + // Expect 4 mutants: + // a - b + // a * b + // a / b + // a % b + function plus(int256 a, int256 b) public pure returns (int256) { + return a + b; + } + + // Expect 4 mutants: + // a + b + // a * b + // a / b + // a % b + function minus(int256 a, int256 b) public pure returns (int256) { + return a - b; + } + + // Expect 4 mutants: + // a - b + // a * b + // a / b + // a % b + function times_with_parens( + int256 a, + int256 b + ) public pure returns (int256) { + return ((a)) * b; + } + + // Expect 5 mutants: + // a + b + // a - b + // a / b + // a ** b + // a % b + function unsigned_times_with_parens( + uint256 a, + uint256 b + /// ArithmeticOperatorReplacement(`*` |==> `+`) of: `return ((a)) * b;` + ) public pure returns (uint256) { + return ((a)) + b; + } + + // Expect 5 mutants: + // a + b + // a - b + // a / b + // a * b + // a % b + + function power(uint256 a, uint256 b) public pure returns (uint256) { + return a ** b; + } +} diff --git a/resources/regressions/all_ops.json/mutants/14/AOR/AOR.sol b/resources/regressions/all_ops.json/mutants/14/AOR/AOR.sol new file mode 100644 index 0000000..4d3c74d --- /dev/null +++ b/resources/regressions/all_ops.json/mutants/14/AOR/AOR.sol @@ -0,0 +1,61 @@ +// SPDX-License-Identifier: GPL-3.0-only +pragma solidity >0.7.0; +pragma experimental ABIEncoderV2; + +// This contract provides test functions for Arithmetic operator replacement +contract AOR { + // Expect 4 mutants: + // a - b + // a * b + // a / b + // a % b + function plus(int256 a, int256 b) public pure returns (int256) { + return a + b; + } + + // Expect 4 mutants: + // a + b + // a * b + // a / b + // a % b + function minus(int256 a, int256 b) public pure returns (int256) { + return a - b; + } + + // Expect 4 mutants: + // a - b + // a * b + // a / b + // a % b + function times_with_parens( + int256 a, + int256 b + ) public pure returns (int256) { + return ((a)) * b; + } + + // Expect 5 mutants: + // a + b + // a - b + // a / b + // a ** b + // a % b + function unsigned_times_with_parens( + uint256 a, + uint256 b + /// ArithmeticOperatorReplacement(`*` |==> `-`) of: `return ((a)) * b;` + ) public pure returns (uint256) { + return ((a)) - b; + } + + // Expect 5 mutants: + // a + b + // a - b + // a / b + // a * b + // a % b + + function power(uint256 a, uint256 b) public pure returns (uint256) { + return a ** b; + } +} diff --git a/resources/regressions/all_ops.json/mutants/15/AOR/AOR.sol b/resources/regressions/all_ops.json/mutants/15/AOR/AOR.sol new file mode 100644 index 0000000..f9a4969 --- /dev/null +++ b/resources/regressions/all_ops.json/mutants/15/AOR/AOR.sol @@ -0,0 +1,61 @@ +// SPDX-License-Identifier: GPL-3.0-only +pragma solidity >0.7.0; +pragma experimental ABIEncoderV2; + +// This contract provides test functions for Arithmetic operator replacement +contract AOR { + // Expect 4 mutants: + // a - b + // a * b + // a / b + // a % b + function plus(int256 a, int256 b) public pure returns (int256) { + return a + b; + } + + // Expect 4 mutants: + // a + b + // a * b + // a / b + // a % b + function minus(int256 a, int256 b) public pure returns (int256) { + return a - b; + } + + // Expect 4 mutants: + // a - b + // a * b + // a / b + // a % b + function times_with_parens( + int256 a, + int256 b + ) public pure returns (int256) { + return ((a)) * b; + } + + // Expect 5 mutants: + // a + b + // a - b + // a / b + // a ** b + // a % b + function unsigned_times_with_parens( + uint256 a, + uint256 b + /// ArithmeticOperatorReplacement(`*` |==> `/`) of: `return ((a)) * b;` + ) public pure returns (uint256) { + return ((a)) / b; + } + + // Expect 5 mutants: + // a + b + // a - b + // a / b + // a * b + // a % b + + function power(uint256 a, uint256 b) public pure returns (uint256) { + return a ** b; + } +} diff --git a/resources/regressions/all_ops.json/mutants/16/AOR/AOR.sol b/resources/regressions/all_ops.json/mutants/16/AOR/AOR.sol new file mode 100644 index 0000000..3706f5c --- /dev/null +++ b/resources/regressions/all_ops.json/mutants/16/AOR/AOR.sol @@ -0,0 +1,61 @@ +// SPDX-License-Identifier: GPL-3.0-only +pragma solidity >0.7.0; +pragma experimental ABIEncoderV2; + +// This contract provides test functions for Arithmetic operator replacement +contract AOR { + // Expect 4 mutants: + // a - b + // a * b + // a / b + // a % b + function plus(int256 a, int256 b) public pure returns (int256) { + return a + b; + } + + // Expect 4 mutants: + // a + b + // a * b + // a / b + // a % b + function minus(int256 a, int256 b) public pure returns (int256) { + return a - b; + } + + // Expect 4 mutants: + // a - b + // a * b + // a / b + // a % b + function times_with_parens( + int256 a, + int256 b + ) public pure returns (int256) { + return ((a)) * b; + } + + // Expect 5 mutants: + // a + b + // a - b + // a / b + // a ** b + // a % b + function unsigned_times_with_parens( + uint256 a, + uint256 b + /// ArithmeticOperatorReplacement(`*` |==> `**`) of: `return ((a)) * b;` + ) public pure returns (uint256) { + return ((a)) ** b; + } + + // Expect 5 mutants: + // a + b + // a - b + // a / b + // a * b + // a % b + + function power(uint256 a, uint256 b) public pure returns (uint256) { + return a ** b; + } +} diff --git a/resources/regressions/all_ops.json/mutants/17/AOR/AOR.sol b/resources/regressions/all_ops.json/mutants/17/AOR/AOR.sol new file mode 100644 index 0000000..67aa6b3 --- /dev/null +++ b/resources/regressions/all_ops.json/mutants/17/AOR/AOR.sol @@ -0,0 +1,61 @@ +// SPDX-License-Identifier: GPL-3.0-only +pragma solidity >0.7.0; +pragma experimental ABIEncoderV2; + +// This contract provides test functions for Arithmetic operator replacement +contract AOR { + // Expect 4 mutants: + // a - b + // a * b + // a / b + // a % b + function plus(int256 a, int256 b) public pure returns (int256) { + return a + b; + } + + // Expect 4 mutants: + // a + b + // a * b + // a / b + // a % b + function minus(int256 a, int256 b) public pure returns (int256) { + return a - b; + } + + // Expect 4 mutants: + // a - b + // a * b + // a / b + // a % b + function times_with_parens( + int256 a, + int256 b + ) public pure returns (int256) { + return ((a)) * b; + } + + // Expect 5 mutants: + // a + b + // a - b + // a / b + // a ** b + // a % b + function unsigned_times_with_parens( + uint256 a, + uint256 b + /// ArithmeticOperatorReplacement(`*` |==> `%`) of: `return ((a)) * b;` + ) public pure returns (uint256) { + return ((a)) % b; + } + + // Expect 5 mutants: + // a + b + // a - b + // a / b + // a * b + // a % b + + function power(uint256 a, uint256 b) public pure returns (uint256) { + return a ** b; + } +} diff --git a/resources/regressions/all_ops.json/mutants/18/AOR/AOR.sol b/resources/regressions/all_ops.json/mutants/18/AOR/AOR.sol new file mode 100644 index 0000000..b577022 --- /dev/null +++ b/resources/regressions/all_ops.json/mutants/18/AOR/AOR.sol @@ -0,0 +1,61 @@ +// SPDX-License-Identifier: GPL-3.0-only +pragma solidity >0.7.0; +pragma experimental ABIEncoderV2; + +// This contract provides test functions for Arithmetic operator replacement +contract AOR { + // Expect 4 mutants: + // a - b + // a * b + // a / b + // a % b + function plus(int256 a, int256 b) public pure returns (int256) { + return a + b; + } + + // Expect 4 mutants: + // a + b + // a * b + // a / b + // a % b + function minus(int256 a, int256 b) public pure returns (int256) { + return a - b; + } + + // Expect 4 mutants: + // a - b + // a * b + // a / b + // a % b + function times_with_parens( + int256 a, + int256 b + ) public pure returns (int256) { + return ((a)) * b; + } + + // Expect 5 mutants: + // a + b + // a - b + // a / b + // a ** b + // a % b + function unsigned_times_with_parens( + uint256 a, + uint256 b + ) public pure returns (uint256) { + return ((a)) * b; + } + + // Expect 5 mutants: + // a + b + // a - b + // a / b + // a * b + // a % b + + /// ArithmeticOperatorReplacement(`**` |==> `+`) of: `return a ** b;` + function power(uint256 a, uint256 b) public pure returns (uint256) { + return a + b; + } +} diff --git a/resources/regressions/all_ops.json/mutants/19/AOR/AOR.sol b/resources/regressions/all_ops.json/mutants/19/AOR/AOR.sol new file mode 100644 index 0000000..fbde14d --- /dev/null +++ b/resources/regressions/all_ops.json/mutants/19/AOR/AOR.sol @@ -0,0 +1,61 @@ +// SPDX-License-Identifier: GPL-3.0-only +pragma solidity >0.7.0; +pragma experimental ABIEncoderV2; + +// This contract provides test functions for Arithmetic operator replacement +contract AOR { + // Expect 4 mutants: + // a - b + // a * b + // a / b + // a % b + function plus(int256 a, int256 b) public pure returns (int256) { + return a + b; + } + + // Expect 4 mutants: + // a + b + // a * b + // a / b + // a % b + function minus(int256 a, int256 b) public pure returns (int256) { + return a - b; + } + + // Expect 4 mutants: + // a - b + // a * b + // a / b + // a % b + function times_with_parens( + int256 a, + int256 b + ) public pure returns (int256) { + return ((a)) * b; + } + + // Expect 5 mutants: + // a + b + // a - b + // a / b + // a ** b + // a % b + function unsigned_times_with_parens( + uint256 a, + uint256 b + ) public pure returns (uint256) { + return ((a)) * b; + } + + // Expect 5 mutants: + // a + b + // a - b + // a / b + // a * b + // a % b + + /// ArithmeticOperatorReplacement(`**` |==> `-`) of: `return a ** b;` + function power(uint256 a, uint256 b) public pure returns (uint256) { + return a - b; + } +} diff --git a/resources/regressions/all_ops.json/mutants/2/AOR/AOR.sol b/resources/regressions/all_ops.json/mutants/2/AOR/AOR.sol new file mode 100644 index 0000000..2e38a56 --- /dev/null +++ b/resources/regressions/all_ops.json/mutants/2/AOR/AOR.sol @@ -0,0 +1,61 @@ +// SPDX-License-Identifier: GPL-3.0-only +pragma solidity >0.7.0; +pragma experimental ABIEncoderV2; + +// This contract provides test functions for Arithmetic operator replacement +contract AOR { + // Expect 4 mutants: + // a - b + // a * b + // a / b + // a % b + /// ArithmeticOperatorReplacement(`+` |==> `*`) of: `return a + b;` + function plus(int256 a, int256 b) public pure returns (int256) { + return a * b; + } + + // Expect 4 mutants: + // a + b + // a * b + // a / b + // a % b + function minus(int256 a, int256 b) public pure returns (int256) { + return a - b; + } + + // Expect 4 mutants: + // a - b + // a * b + // a / b + // a % b + function times_with_parens( + int256 a, + int256 b + ) public pure returns (int256) { + return ((a)) * b; + } + + // Expect 5 mutants: + // a + b + // a - b + // a / b + // a ** b + // a % b + function unsigned_times_with_parens( + uint256 a, + uint256 b + ) public pure returns (uint256) { + return ((a)) * b; + } + + // Expect 5 mutants: + // a + b + // a - b + // a / b + // a * b + // a % b + + function power(uint256 a, uint256 b) public pure returns (uint256) { + return a ** b; + } +} diff --git a/resources/regressions/all_ops.json/mutants/20/AOR/AOR.sol b/resources/regressions/all_ops.json/mutants/20/AOR/AOR.sol new file mode 100644 index 0000000..92cbf4d --- /dev/null +++ b/resources/regressions/all_ops.json/mutants/20/AOR/AOR.sol @@ -0,0 +1,61 @@ +// SPDX-License-Identifier: GPL-3.0-only +pragma solidity >0.7.0; +pragma experimental ABIEncoderV2; + +// This contract provides test functions for Arithmetic operator replacement +contract AOR { + // Expect 4 mutants: + // a - b + // a * b + // a / b + // a % b + function plus(int256 a, int256 b) public pure returns (int256) { + return a + b; + } + + // Expect 4 mutants: + // a + b + // a * b + // a / b + // a % b + function minus(int256 a, int256 b) public pure returns (int256) { + return a - b; + } + + // Expect 4 mutants: + // a - b + // a * b + // a / b + // a % b + function times_with_parens( + int256 a, + int256 b + ) public pure returns (int256) { + return ((a)) * b; + } + + // Expect 5 mutants: + // a + b + // a - b + // a / b + // a ** b + // a % b + function unsigned_times_with_parens( + uint256 a, + uint256 b + ) public pure returns (uint256) { + return ((a)) * b; + } + + // Expect 5 mutants: + // a + b + // a - b + // a / b + // a * b + // a % b + + /// ArithmeticOperatorReplacement(`**` |==> `*`) of: `return a ** b;` + function power(uint256 a, uint256 b) public pure returns (uint256) { + return a * b; + } +} diff --git a/resources/regressions/all_ops.json/mutants/21/AOR/AOR.sol b/resources/regressions/all_ops.json/mutants/21/AOR/AOR.sol new file mode 100644 index 0000000..e3c6067 --- /dev/null +++ b/resources/regressions/all_ops.json/mutants/21/AOR/AOR.sol @@ -0,0 +1,61 @@ +// SPDX-License-Identifier: GPL-3.0-only +pragma solidity >0.7.0; +pragma experimental ABIEncoderV2; + +// This contract provides test functions for Arithmetic operator replacement +contract AOR { + // Expect 4 mutants: + // a - b + // a * b + // a / b + // a % b + function plus(int256 a, int256 b) public pure returns (int256) { + return a + b; + } + + // Expect 4 mutants: + // a + b + // a * b + // a / b + // a % b + function minus(int256 a, int256 b) public pure returns (int256) { + return a - b; + } + + // Expect 4 mutants: + // a - b + // a * b + // a / b + // a % b + function times_with_parens( + int256 a, + int256 b + ) public pure returns (int256) { + return ((a)) * b; + } + + // Expect 5 mutants: + // a + b + // a - b + // a / b + // a ** b + // a % b + function unsigned_times_with_parens( + uint256 a, + uint256 b + ) public pure returns (uint256) { + return ((a)) * b; + } + + // Expect 5 mutants: + // a + b + // a - b + // a / b + // a * b + // a % b + + /// ArithmeticOperatorReplacement(`**` |==> `/`) of: `return a ** b;` + function power(uint256 a, uint256 b) public pure returns (uint256) { + return a / b; + } +} diff --git a/resources/regressions/all_ops.json/mutants/22/AOR/AOR.sol b/resources/regressions/all_ops.json/mutants/22/AOR/AOR.sol new file mode 100644 index 0000000..c63f66b --- /dev/null +++ b/resources/regressions/all_ops.json/mutants/22/AOR/AOR.sol @@ -0,0 +1,61 @@ +// SPDX-License-Identifier: GPL-3.0-only +pragma solidity >0.7.0; +pragma experimental ABIEncoderV2; + +// This contract provides test functions for Arithmetic operator replacement +contract AOR { + // Expect 4 mutants: + // a - b + // a * b + // a / b + // a % b + function plus(int256 a, int256 b) public pure returns (int256) { + return a + b; + } + + // Expect 4 mutants: + // a + b + // a * b + // a / b + // a % b + function minus(int256 a, int256 b) public pure returns (int256) { + return a - b; + } + + // Expect 4 mutants: + // a - b + // a * b + // a / b + // a % b + function times_with_parens( + int256 a, + int256 b + ) public pure returns (int256) { + return ((a)) * b; + } + + // Expect 5 mutants: + // a + b + // a - b + // a / b + // a ** b + // a % b + function unsigned_times_with_parens( + uint256 a, + uint256 b + ) public pure returns (uint256) { + return ((a)) * b; + } + + // Expect 5 mutants: + // a + b + // a - b + // a / b + // a * b + // a % b + + /// ArithmeticOperatorReplacement(`**` |==> `%`) of: `return a ** b;` + function power(uint256 a, uint256 b) public pure returns (uint256) { + return a % b; + } +} diff --git a/resources/regressions/all_ops.json/mutants/23/BOR/BOR.sol b/resources/regressions/all_ops.json/mutants/23/BOR/BOR.sol new file mode 100644 index 0000000..34a280f --- /dev/null +++ b/resources/regressions/all_ops.json/mutants/23/BOR/BOR.sol @@ -0,0 +1,25 @@ +// SPDX-License-Identifier: GPL-3.0-only +pragma solidity >0.7.0; +pragma experimental ABIEncoderV2; + +// This contract provides test functions for Bitwise Operator Replacement (BOR) +contract BOR { + // Expect 1 mutants: + // a & b; + /// ConditionalOperatorReplacement(`|` |==> `&`) of: `return a | b;` + function bw_or(int256 a, int256 b) public pure returns (int256) { + return a & b; + } + + // Expect 1 mutants: + // a | b; + function bw_and(int256 a, int256 b) public pure returns (int256) { + return a & b; + } + + // Expect 1 mutants: + // a | b; + function bw_xor(int256 a, int256 b) public pure returns (int256) { + return a ^ b; + } +} diff --git a/resources/regressions/all_ops.json/mutants/24/BOR/BOR.sol b/resources/regressions/all_ops.json/mutants/24/BOR/BOR.sol new file mode 100644 index 0000000..4bfbc16 --- /dev/null +++ b/resources/regressions/all_ops.json/mutants/24/BOR/BOR.sol @@ -0,0 +1,25 @@ +// SPDX-License-Identifier: GPL-3.0-only +pragma solidity >0.7.0; +pragma experimental ABIEncoderV2; + +// This contract provides test functions for Bitwise Operator Replacement (BOR) +contract BOR { + // Expect 1 mutants: + // a & b; + function bw_or(int256 a, int256 b) public pure returns (int256) { + return a | b; + } + + // Expect 1 mutants: + // a | b; + /// ConditionalOperatorReplacement(`&` |==> `|`) of: `return a & b;` + function bw_and(int256 a, int256 b) public pure returns (int256) { + return a | b; + } + + // Expect 1 mutants: + // a | b; + function bw_xor(int256 a, int256 b) public pure returns (int256) { + return a ^ b; + } +} diff --git a/resources/regressions/all_ops.json/mutants/25/BOR/BOR.sol b/resources/regressions/all_ops.json/mutants/25/BOR/BOR.sol new file mode 100644 index 0000000..d4ee434 --- /dev/null +++ b/resources/regressions/all_ops.json/mutants/25/BOR/BOR.sol @@ -0,0 +1,25 @@ +// SPDX-License-Identifier: GPL-3.0-only +pragma solidity >0.7.0; +pragma experimental ABIEncoderV2; + +// This contract provides test functions for Bitwise Operator Replacement (BOR) +contract BOR { + // Expect 1 mutants: + // a & b; + function bw_or(int256 a, int256 b) public pure returns (int256) { + return a | b; + } + + // Expect 1 mutants: + // a | b; + function bw_and(int256 a, int256 b) public pure returns (int256) { + return a & b; + } + + // Expect 1 mutants: + // a | b; + /// ConditionalOperatorReplacement(`^` |==> `&`) of: `return a ^ b;` + function bw_xor(int256 a, int256 b) public pure returns (int256) { + return a & b; + } +} diff --git a/resources/regressions/all_ops.json/mutants/26/EDC/EDC.sol b/resources/regressions/all_ops.json/mutants/26/EDC/EDC.sol new file mode 100644 index 0000000..1975497 --- /dev/null +++ b/resources/regressions/all_ops.json/mutants/26/EDC/EDC.sol @@ -0,0 +1,22 @@ +// SPDX-License-Identifier: GPL-3.0-only +pragma solidity ^0.8.13; + +contract Helper { + function setVars(uint _num) public payable {} +} + +contract EDC { + uint public num; + address public sender; + uint public value; + bool public delegateSuccessful; + bytes public myData; + + /// ElimDelegateCall(`delegatecall` |==> `call`) of: `(bool success, ) = _contract.delegatecall(` + function setVars(address _contract) public payable { + (bool success, ) = _contract.call( + abi.encodeWithSignature("setVars(uint256)", 1) + ); + require(success, "Delegatecall failed"); + } +} diff --git a/resources/regressions/all_ops.json/mutants/27/LOR/LOR.sol b/resources/regressions/all_ops.json/mutants/27/LOR/LOR.sol new file mode 100644 index 0000000..01536cd --- /dev/null +++ b/resources/regressions/all_ops.json/mutants/27/LOR/LOR.sol @@ -0,0 +1,26 @@ +// SPDX-License-Identifier: GPL-3.0-only +pragma solidity >0.7.0; +pragma experimental ABIEncoderV2; + +// This contract provides test functions for relational operator replacement (ROR) +contract LOR { + // Expect three mutants: a, b, false + /// LogicalOperatorReplacement(`a && b` |==> `a`) of: `return a && b;` + function and(bool a, bool b) public pure returns (bool) { + return a; + } + + // Expect three mutants: a, b, true + function or(bool a, bool b) public pure returns (bool) { + return a || b; + } + + // Expect three mutants, x < y, a != (x >= y), true + function more_or(bool a, int x, int y) public pure returns (bool) { + return (x < y) || (a != (x >= y)); + } + + function not(bool a) public pure returns (bool) { + return !a; + } +} diff --git a/resources/regressions/all_ops.json/mutants/28/LOR/LOR.sol b/resources/regressions/all_ops.json/mutants/28/LOR/LOR.sol new file mode 100644 index 0000000..c97e867 --- /dev/null +++ b/resources/regressions/all_ops.json/mutants/28/LOR/LOR.sol @@ -0,0 +1,26 @@ +// SPDX-License-Identifier: GPL-3.0-only +pragma solidity >0.7.0; +pragma experimental ABIEncoderV2; + +// This contract provides test functions for relational operator replacement (ROR) +contract LOR { + // Expect three mutants: a, b, false + /// LogicalOperatorReplacement(`a && b` |==> `b`) of: `return a && b;` + function and(bool a, bool b) public pure returns (bool) { + return b; + } + + // Expect three mutants: a, b, true + function or(bool a, bool b) public pure returns (bool) { + return a || b; + } + + // Expect three mutants, x < y, a != (x >= y), true + function more_or(bool a, int x, int y) public pure returns (bool) { + return (x < y) || (a != (x >= y)); + } + + function not(bool a) public pure returns (bool) { + return !a; + } +} diff --git a/resources/regressions/all_ops.json/mutants/29/LOR/LOR.sol b/resources/regressions/all_ops.json/mutants/29/LOR/LOR.sol new file mode 100644 index 0000000..492dc45 --- /dev/null +++ b/resources/regressions/all_ops.json/mutants/29/LOR/LOR.sol @@ -0,0 +1,26 @@ +// SPDX-License-Identifier: GPL-3.0-only +pragma solidity >0.7.0; +pragma experimental ABIEncoderV2; + +// This contract provides test functions for relational operator replacement (ROR) +contract LOR { + // Expect three mutants: a, b, false + /// LogicalOperatorReplacement(`a && b` |==> `false`) of: `return a && b;` + function and(bool a, bool b) public pure returns (bool) { + return false; + } + + // Expect three mutants: a, b, true + function or(bool a, bool b) public pure returns (bool) { + return a || b; + } + + // Expect three mutants, x < y, a != (x >= y), true + function more_or(bool a, int x, int y) public pure returns (bool) { + return (x < y) || (a != (x >= y)); + } + + function not(bool a) public pure returns (bool) { + return !a; + } +} diff --git a/resources/regressions/all_ops.json/mutants/3/AOR/AOR.sol b/resources/regressions/all_ops.json/mutants/3/AOR/AOR.sol new file mode 100644 index 0000000..60a969d --- /dev/null +++ b/resources/regressions/all_ops.json/mutants/3/AOR/AOR.sol @@ -0,0 +1,61 @@ +// SPDX-License-Identifier: GPL-3.0-only +pragma solidity >0.7.0; +pragma experimental ABIEncoderV2; + +// This contract provides test functions for Arithmetic operator replacement +contract AOR { + // Expect 4 mutants: + // a - b + // a * b + // a / b + // a % b + /// ArithmeticOperatorReplacement(`+` |==> `/`) of: `return a + b;` + function plus(int256 a, int256 b) public pure returns (int256) { + return a / b; + } + + // Expect 4 mutants: + // a + b + // a * b + // a / b + // a % b + function minus(int256 a, int256 b) public pure returns (int256) { + return a - b; + } + + // Expect 4 mutants: + // a - b + // a * b + // a / b + // a % b + function times_with_parens( + int256 a, + int256 b + ) public pure returns (int256) { + return ((a)) * b; + } + + // Expect 5 mutants: + // a + b + // a - b + // a / b + // a ** b + // a % b + function unsigned_times_with_parens( + uint256 a, + uint256 b + ) public pure returns (uint256) { + return ((a)) * b; + } + + // Expect 5 mutants: + // a + b + // a - b + // a / b + // a * b + // a % b + + function power(uint256 a, uint256 b) public pure returns (uint256) { + return a ** b; + } +} diff --git a/resources/regressions/all_ops.json/mutants/30/LOR/LOR.sol b/resources/regressions/all_ops.json/mutants/30/LOR/LOR.sol new file mode 100644 index 0000000..7f62ba0 --- /dev/null +++ b/resources/regressions/all_ops.json/mutants/30/LOR/LOR.sol @@ -0,0 +1,26 @@ +// SPDX-License-Identifier: GPL-3.0-only +pragma solidity >0.7.0; +pragma experimental ABIEncoderV2; + +// This contract provides test functions for relational operator replacement (ROR) +contract LOR { + // Expect three mutants: a, b, false + function and(bool a, bool b) public pure returns (bool) { + return a && b; + } + + // Expect three mutants: a, b, true + /// LogicalOperatorReplacement(`a || b` |==> `a`) of: `return a || b;` + function or(bool a, bool b) public pure returns (bool) { + return a; + } + + // Expect three mutants, x < y, a != (x >= y), true + function more_or(bool a, int x, int y) public pure returns (bool) { + return (x < y) || (a != (x >= y)); + } + + function not(bool a) public pure returns (bool) { + return !a; + } +} diff --git a/resources/regressions/all_ops.json/mutants/31/LOR/LOR.sol b/resources/regressions/all_ops.json/mutants/31/LOR/LOR.sol new file mode 100644 index 0000000..efb5d5a --- /dev/null +++ b/resources/regressions/all_ops.json/mutants/31/LOR/LOR.sol @@ -0,0 +1,26 @@ +// SPDX-License-Identifier: GPL-3.0-only +pragma solidity >0.7.0; +pragma experimental ABIEncoderV2; + +// This contract provides test functions for relational operator replacement (ROR) +contract LOR { + // Expect three mutants: a, b, false + function and(bool a, bool b) public pure returns (bool) { + return a && b; + } + + // Expect three mutants: a, b, true + /// LogicalOperatorReplacement(`a || b` |==> `b`) of: `return a || b;` + function or(bool a, bool b) public pure returns (bool) { + return b; + } + + // Expect three mutants, x < y, a != (x >= y), true + function more_or(bool a, int x, int y) public pure returns (bool) { + return (x < y) || (a != (x >= y)); + } + + function not(bool a) public pure returns (bool) { + return !a; + } +} diff --git a/resources/regressions/all_ops.json/mutants/32/LOR/LOR.sol b/resources/regressions/all_ops.json/mutants/32/LOR/LOR.sol new file mode 100644 index 0000000..7d3c811 --- /dev/null +++ b/resources/regressions/all_ops.json/mutants/32/LOR/LOR.sol @@ -0,0 +1,26 @@ +// SPDX-License-Identifier: GPL-3.0-only +pragma solidity >0.7.0; +pragma experimental ABIEncoderV2; + +// This contract provides test functions for relational operator replacement (ROR) +contract LOR { + // Expect three mutants: a, b, false + function and(bool a, bool b) public pure returns (bool) { + return a && b; + } + + // Expect three mutants: a, b, true + /// LogicalOperatorReplacement(`a || b` |==> `true`) of: `return a || b;` + function or(bool a, bool b) public pure returns (bool) { + return true; + } + + // Expect three mutants, x < y, a != (x >= y), true + function more_or(bool a, int x, int y) public pure returns (bool) { + return (x < y) || (a != (x >= y)); + } + + function not(bool a) public pure returns (bool) { + return !a; + } +} diff --git a/resources/regressions/all_ops.json/mutants/33/LOR/LOR.sol b/resources/regressions/all_ops.json/mutants/33/LOR/LOR.sol new file mode 100644 index 0000000..4ceda90 --- /dev/null +++ b/resources/regressions/all_ops.json/mutants/33/LOR/LOR.sol @@ -0,0 +1,26 @@ +// SPDX-License-Identifier: GPL-3.0-only +pragma solidity >0.7.0; +pragma experimental ABIEncoderV2; + +// This contract provides test functions for relational operator replacement (ROR) +contract LOR { + // Expect three mutants: a, b, false + function and(bool a, bool b) public pure returns (bool) { + return a && b; + } + + // Expect three mutants: a, b, true + function or(bool a, bool b) public pure returns (bool) { + return a || b; + } + + // Expect three mutants, x < y, a != (x >= y), true + /// LogicalOperatorReplacement(`(x < y) || (a != (x >= y))` |==> `x < y`) of: `return (x < y) || (a != (x >= y));` + function more_or(bool a, int x, int y) public pure returns (bool) { + return x < y; + } + + function not(bool a) public pure returns (bool) { + return !a; + } +} diff --git a/resources/regressions/all_ops.json/mutants/34/LOR/LOR.sol b/resources/regressions/all_ops.json/mutants/34/LOR/LOR.sol new file mode 100644 index 0000000..690fae8 --- /dev/null +++ b/resources/regressions/all_ops.json/mutants/34/LOR/LOR.sol @@ -0,0 +1,26 @@ +// SPDX-License-Identifier: GPL-3.0-only +pragma solidity >0.7.0; +pragma experimental ABIEncoderV2; + +// This contract provides test functions for relational operator replacement (ROR) +contract LOR { + // Expect three mutants: a, b, false + function and(bool a, bool b) public pure returns (bool) { + return a && b; + } + + // Expect three mutants: a, b, true + function or(bool a, bool b) public pure returns (bool) { + return a || b; + } + + // Expect three mutants, x < y, a != (x >= y), true + /// LogicalOperatorReplacement(`(x < y) || (a != (x >= y))` |==> `a != (x >= y)`) of: `return (x < y) || (a != (x >= y));` + function more_or(bool a, int x, int y) public pure returns (bool) { + return a != (x >= y); + } + + function not(bool a) public pure returns (bool) { + return !a; + } +} diff --git a/resources/regressions/all_ops.json/mutants/35/LOR/LOR.sol b/resources/regressions/all_ops.json/mutants/35/LOR/LOR.sol new file mode 100644 index 0000000..2ef1564 --- /dev/null +++ b/resources/regressions/all_ops.json/mutants/35/LOR/LOR.sol @@ -0,0 +1,26 @@ +// SPDX-License-Identifier: GPL-3.0-only +pragma solidity >0.7.0; +pragma experimental ABIEncoderV2; + +// This contract provides test functions for relational operator replacement (ROR) +contract LOR { + // Expect three mutants: a, b, false + function and(bool a, bool b) public pure returns (bool) { + return a && b; + } + + // Expect three mutants: a, b, true + function or(bool a, bool b) public pure returns (bool) { + return a || b; + } + + // Expect three mutants, x < y, a != (x >= y), true + /// LogicalOperatorReplacement(`(x < y) || (a != (x >= y))` |==> `true`) of: `return (x < y) || (a != (x >= y));` + function more_or(bool a, int x, int y) public pure returns (bool) { + return true; + } + + function not(bool a) public pure returns (bool) { + return !a; + } +} diff --git a/resources/regressions/all_ops.json/mutants/36/LOR/LOR.sol b/resources/regressions/all_ops.json/mutants/36/LOR/LOR.sol new file mode 100644 index 0000000..be0e75f --- /dev/null +++ b/resources/regressions/all_ops.json/mutants/36/LOR/LOR.sol @@ -0,0 +1,26 @@ +// SPDX-License-Identifier: GPL-3.0-only +pragma solidity >0.7.0; +pragma experimental ABIEncoderV2; + +// This contract provides test functions for relational operator replacement (ROR) +contract LOR { + // Expect three mutants: a, b, false + function and(bool a, bool b) public pure returns (bool) { + return a && b; + } + + // Expect three mutants: a, b, true + function or(bool a, bool b) public pure returns (bool) { + return a || b; + } + + // Expect three mutants, x < y, a != (x >= y), true + function more_or(bool a, int x, int y) public pure returns (bool) { + return (x < y) || (a != (x >= y)); + } + + /// LogicalOperatorReplacement(`!a` |==> `true`) of: `return !a;` + function not(bool a) public pure returns (bool) { + return true; + } +} diff --git a/resources/regressions/all_ops.json/mutants/37/LOR/LOR.sol b/resources/regressions/all_ops.json/mutants/37/LOR/LOR.sol new file mode 100644 index 0000000..35ee575 --- /dev/null +++ b/resources/regressions/all_ops.json/mutants/37/LOR/LOR.sol @@ -0,0 +1,26 @@ +// SPDX-License-Identifier: GPL-3.0-only +pragma solidity >0.7.0; +pragma experimental ABIEncoderV2; + +// This contract provides test functions for relational operator replacement (ROR) +contract LOR { + // Expect three mutants: a, b, false + function and(bool a, bool b) public pure returns (bool) { + return a && b; + } + + // Expect three mutants: a, b, true + function or(bool a, bool b) public pure returns (bool) { + return a || b; + } + + // Expect three mutants, x < y, a != (x >= y), true + function more_or(bool a, int x, int y) public pure returns (bool) { + return (x < y) || (a != (x >= y)); + } + + /// LogicalOperatorReplacement(`!a` |==> `false`) of: `return !a;` + function not(bool a) public pure returns (bool) { + return false; + } +} diff --git a/resources/regressions/all_ops.json/mutants/38/LVR/LVR.sol b/resources/regressions/all_ops.json/mutants/38/LVR/LVR.sol new file mode 100644 index 0000000..e06271e --- /dev/null +++ b/resources/regressions/all_ops.json/mutants/38/LVR/LVR.sol @@ -0,0 +1,43 @@ +// SPDX-License-Identifier: GPL-3.0-only +pragma solidity >0.7.0; +pragma experimental ABIEncoderV2; + +// This contract provides test functions for relational operator replacement (ROR) +contract LVR { + uint256 one_u = 1; + uint256 zero_u = 0; + int256 n_one_s = -1; + int256 one_s = 1; + int256 zero_s = 0; + + // Expect 1 mutant: 1 + /// LiteralValueReplacement(`0` |==> `1`) of: `uint256 zero = 0;` + function unsigned_zero() public pure returns (uint256) { + uint256 zero = 1; + return zero; + } + + // Expect 2 mutant: 0, 2 + function unsigned_one() public pure returns (uint256) { + uint256 one = 1; + return one; + } + + // Expect 2 mutants: 0, 1 + function signed_neg_one() public pure returns (int256) { + int256 neg_one = -1; + return neg_one; + } + + // Expect 2 mutants: -1, 0 + function signed_pos_one() public pure returns (int256) { + int256 pos_one = 1; + return pos_one; + } + + // Expect 2 mutants: -1, 1 + function signed_zero() public pure returns (int256) { + int256 zero = 0; + return zero; + } +} diff --git a/resources/regressions/all_ops.json/mutants/39/LVR/LVR.sol b/resources/regressions/all_ops.json/mutants/39/LVR/LVR.sol new file mode 100644 index 0000000..f2cb829 --- /dev/null +++ b/resources/regressions/all_ops.json/mutants/39/LVR/LVR.sol @@ -0,0 +1,43 @@ +// SPDX-License-Identifier: GPL-3.0-only +pragma solidity >0.7.0; +pragma experimental ABIEncoderV2; + +// This contract provides test functions for relational operator replacement (ROR) +contract LVR { + uint256 one_u = 1; + uint256 zero_u = 0; + int256 n_one_s = -1; + int256 one_s = 1; + int256 zero_s = 0; + + // Expect 1 mutant: 1 + function unsigned_zero() public pure returns (uint256) { + uint256 zero = 0; + return zero; + } + + // Expect 2 mutant: 0, 2 + /// LiteralValueReplacement(`1` |==> `0`) of: `uint256 one = 1;` + function unsigned_one() public pure returns (uint256) { + uint256 one = 0; + return one; + } + + // Expect 2 mutants: 0, 1 + function signed_neg_one() public pure returns (int256) { + int256 neg_one = -1; + return neg_one; + } + + // Expect 2 mutants: -1, 0 + function signed_pos_one() public pure returns (int256) { + int256 pos_one = 1; + return pos_one; + } + + // Expect 2 mutants: -1, 1 + function signed_zero() public pure returns (int256) { + int256 zero = 0; + return zero; + } +} diff --git a/resources/regressions/all_ops.json/mutants/4/AOR/AOR.sol b/resources/regressions/all_ops.json/mutants/4/AOR/AOR.sol new file mode 100644 index 0000000..61a8854 --- /dev/null +++ b/resources/regressions/all_ops.json/mutants/4/AOR/AOR.sol @@ -0,0 +1,61 @@ +// SPDX-License-Identifier: GPL-3.0-only +pragma solidity >0.7.0; +pragma experimental ABIEncoderV2; + +// This contract provides test functions for Arithmetic operator replacement +contract AOR { + // Expect 4 mutants: + // a - b + // a * b + // a / b + // a % b + /// ArithmeticOperatorReplacement(`+` |==> `%`) of: `return a + b;` + function plus(int256 a, int256 b) public pure returns (int256) { + return a % b; + } + + // Expect 4 mutants: + // a + b + // a * b + // a / b + // a % b + function minus(int256 a, int256 b) public pure returns (int256) { + return a - b; + } + + // Expect 4 mutants: + // a - b + // a * b + // a / b + // a % b + function times_with_parens( + int256 a, + int256 b + ) public pure returns (int256) { + return ((a)) * b; + } + + // Expect 5 mutants: + // a + b + // a - b + // a / b + // a ** b + // a % b + function unsigned_times_with_parens( + uint256 a, + uint256 b + ) public pure returns (uint256) { + return ((a)) * b; + } + + // Expect 5 mutants: + // a + b + // a - b + // a / b + // a * b + // a % b + + function power(uint256 a, uint256 b) public pure returns (uint256) { + return a ** b; + } +} diff --git a/resources/regressions/all_ops.json/mutants/40/LVR/LVR.sol b/resources/regressions/all_ops.json/mutants/40/LVR/LVR.sol new file mode 100644 index 0000000..d18c6c4 --- /dev/null +++ b/resources/regressions/all_ops.json/mutants/40/LVR/LVR.sol @@ -0,0 +1,43 @@ +// SPDX-License-Identifier: GPL-3.0-only +pragma solidity >0.7.0; +pragma experimental ABIEncoderV2; + +// This contract provides test functions for relational operator replacement (ROR) +contract LVR { + uint256 one_u = 1; + uint256 zero_u = 0; + int256 n_one_s = -1; + int256 one_s = 1; + int256 zero_s = 0; + + // Expect 1 mutant: 1 + function unsigned_zero() public pure returns (uint256) { + uint256 zero = 0; + return zero; + } + + // Expect 2 mutant: 0, 2 + /// LiteralValueReplacement(`1` |==> `2`) of: `uint256 one = 1;` + function unsigned_one() public pure returns (uint256) { + uint256 one = 2; + return one; + } + + // Expect 2 mutants: 0, 1 + function signed_neg_one() public pure returns (int256) { + int256 neg_one = -1; + return neg_one; + } + + // Expect 2 mutants: -1, 0 + function signed_pos_one() public pure returns (int256) { + int256 pos_one = 1; + return pos_one; + } + + // Expect 2 mutants: -1, 1 + function signed_zero() public pure returns (int256) { + int256 zero = 0; + return zero; + } +} diff --git a/resources/regressions/all_ops.json/mutants/41/LVR/LVR.sol b/resources/regressions/all_ops.json/mutants/41/LVR/LVR.sol new file mode 100644 index 0000000..173dc54 --- /dev/null +++ b/resources/regressions/all_ops.json/mutants/41/LVR/LVR.sol @@ -0,0 +1,43 @@ +// SPDX-License-Identifier: GPL-3.0-only +pragma solidity >0.7.0; +pragma experimental ABIEncoderV2; + +// This contract provides test functions for relational operator replacement (ROR) +contract LVR { + uint256 one_u = 1; + uint256 zero_u = 0; + int256 n_one_s = -1; + int256 one_s = 1; + int256 zero_s = 0; + + // Expect 1 mutant: 1 + function unsigned_zero() public pure returns (uint256) { + uint256 zero = 0; + return zero; + } + + // Expect 2 mutant: 0, 2 + function unsigned_one() public pure returns (uint256) { + uint256 one = 1; + return one; + } + + // Expect 2 mutants: 0, 1 + /// LiteralValueReplacement(`-1` |==> `0`) of: `int256 neg_one = -1;` + function signed_neg_one() public pure returns (int256) { + int256 neg_one = 0; + return neg_one; + } + + // Expect 2 mutants: -1, 0 + function signed_pos_one() public pure returns (int256) { + int256 pos_one = 1; + return pos_one; + } + + // Expect 2 mutants: -1, 1 + function signed_zero() public pure returns (int256) { + int256 zero = 0; + return zero; + } +} diff --git a/resources/regressions/all_ops.json/mutants/42/LVR/LVR.sol b/resources/regressions/all_ops.json/mutants/42/LVR/LVR.sol new file mode 100644 index 0000000..72ffaed --- /dev/null +++ b/resources/regressions/all_ops.json/mutants/42/LVR/LVR.sol @@ -0,0 +1,43 @@ +// SPDX-License-Identifier: GPL-3.0-only +pragma solidity >0.7.0; +pragma experimental ABIEncoderV2; + +// This contract provides test functions for relational operator replacement (ROR) +contract LVR { + uint256 one_u = 1; + uint256 zero_u = 0; + int256 n_one_s = -1; + int256 one_s = 1; + int256 zero_s = 0; + + // Expect 1 mutant: 1 + function unsigned_zero() public pure returns (uint256) { + uint256 zero = 0; + return zero; + } + + // Expect 2 mutant: 0, 2 + function unsigned_one() public pure returns (uint256) { + uint256 one = 1; + return one; + } + + // Expect 2 mutants: 0, 1 + /// LiteralValueReplacement(`-1` |==> `1`) of: `int256 neg_one = -1;` + function signed_neg_one() public pure returns (int256) { + int256 neg_one = 1; + return neg_one; + } + + // Expect 2 mutants: -1, 0 + function signed_pos_one() public pure returns (int256) { + int256 pos_one = 1; + return pos_one; + } + + // Expect 2 mutants: -1, 1 + function signed_zero() public pure returns (int256) { + int256 zero = 0; + return zero; + } +} diff --git a/resources/regressions/all_ops.json/mutants/43/LVR/LVR.sol b/resources/regressions/all_ops.json/mutants/43/LVR/LVR.sol new file mode 100644 index 0000000..1e24417 --- /dev/null +++ b/resources/regressions/all_ops.json/mutants/43/LVR/LVR.sol @@ -0,0 +1,43 @@ +// SPDX-License-Identifier: GPL-3.0-only +pragma solidity >0.7.0; +pragma experimental ABIEncoderV2; + +// This contract provides test functions for relational operator replacement (ROR) +contract LVR { + uint256 one_u = 1; + uint256 zero_u = 0; + int256 n_one_s = -1; + int256 one_s = 1; + int256 zero_s = 0; + + // Expect 1 mutant: 1 + function unsigned_zero() public pure returns (uint256) { + uint256 zero = 0; + return zero; + } + + // Expect 2 mutant: 0, 2 + function unsigned_one() public pure returns (uint256) { + uint256 one = 1; + return one; + } + + // Expect 2 mutants: 0, 1 + /// LiteralValueReplacement(`-1` |==> `-2`) of: `int256 neg_one = -1;` + function signed_neg_one() public pure returns (int256) { + int256 neg_one = -2; + return neg_one; + } + + // Expect 2 mutants: -1, 0 + function signed_pos_one() public pure returns (int256) { + int256 pos_one = 1; + return pos_one; + } + + // Expect 2 mutants: -1, 1 + function signed_zero() public pure returns (int256) { + int256 zero = 0; + return zero; + } +} diff --git a/resources/regressions/all_ops.json/mutants/44/LVR/LVR.sol b/resources/regressions/all_ops.json/mutants/44/LVR/LVR.sol new file mode 100644 index 0000000..e088a4e --- /dev/null +++ b/resources/regressions/all_ops.json/mutants/44/LVR/LVR.sol @@ -0,0 +1,43 @@ +// SPDX-License-Identifier: GPL-3.0-only +pragma solidity >0.7.0; +pragma experimental ABIEncoderV2; + +// This contract provides test functions for relational operator replacement (ROR) +contract LVR { + uint256 one_u = 1; + uint256 zero_u = 0; + int256 n_one_s = -1; + int256 one_s = 1; + int256 zero_s = 0; + + // Expect 1 mutant: 1 + function unsigned_zero() public pure returns (uint256) { + uint256 zero = 0; + return zero; + } + + // Expect 2 mutant: 0, 2 + function unsigned_one() public pure returns (uint256) { + uint256 one = 1; + return one; + } + + // Expect 2 mutants: 0, 1 + function signed_neg_one() public pure returns (int256) { + int256 neg_one = -1; + return neg_one; + } + + // Expect 2 mutants: -1, 0 + /// LiteralValueReplacement(`1` |==> `0`) of: `int256 pos_one = 1;` + function signed_pos_one() public pure returns (int256) { + int256 pos_one = 0; + return pos_one; + } + + // Expect 2 mutants: -1, 1 + function signed_zero() public pure returns (int256) { + int256 zero = 0; + return zero; + } +} diff --git a/resources/regressions/all_ops.json/mutants/45/LVR/LVR.sol b/resources/regressions/all_ops.json/mutants/45/LVR/LVR.sol new file mode 100644 index 0000000..2407079 --- /dev/null +++ b/resources/regressions/all_ops.json/mutants/45/LVR/LVR.sol @@ -0,0 +1,43 @@ +// SPDX-License-Identifier: GPL-3.0-only +pragma solidity >0.7.0; +pragma experimental ABIEncoderV2; + +// This contract provides test functions for relational operator replacement (ROR) +contract LVR { + uint256 one_u = 1; + uint256 zero_u = 0; + int256 n_one_s = -1; + int256 one_s = 1; + int256 zero_s = 0; + + // Expect 1 mutant: 1 + function unsigned_zero() public pure returns (uint256) { + uint256 zero = 0; + return zero; + } + + // Expect 2 mutant: 0, 2 + function unsigned_one() public pure returns (uint256) { + uint256 one = 1; + return one; + } + + // Expect 2 mutants: 0, 1 + function signed_neg_one() public pure returns (int256) { + int256 neg_one = -1; + return neg_one; + } + + // Expect 2 mutants: -1, 0 + /// LiteralValueReplacement(`1` |==> `-1`) of: `int256 pos_one = 1;` + function signed_pos_one() public pure returns (int256) { + int256 pos_one = -1; + return pos_one; + } + + // Expect 2 mutants: -1, 1 + function signed_zero() public pure returns (int256) { + int256 zero = 0; + return zero; + } +} diff --git a/resources/regressions/all_ops.json/mutants/46/LVR/LVR.sol b/resources/regressions/all_ops.json/mutants/46/LVR/LVR.sol new file mode 100644 index 0000000..a5082f3 --- /dev/null +++ b/resources/regressions/all_ops.json/mutants/46/LVR/LVR.sol @@ -0,0 +1,43 @@ +// SPDX-License-Identifier: GPL-3.0-only +pragma solidity >0.7.0; +pragma experimental ABIEncoderV2; + +// This contract provides test functions for relational operator replacement (ROR) +contract LVR { + uint256 one_u = 1; + uint256 zero_u = 0; + int256 n_one_s = -1; + int256 one_s = 1; + int256 zero_s = 0; + + // Expect 1 mutant: 1 + function unsigned_zero() public pure returns (uint256) { + uint256 zero = 0; + return zero; + } + + // Expect 2 mutant: 0, 2 + function unsigned_one() public pure returns (uint256) { + uint256 one = 1; + return one; + } + + // Expect 2 mutants: 0, 1 + function signed_neg_one() public pure returns (int256) { + int256 neg_one = -1; + return neg_one; + } + + // Expect 2 mutants: -1, 0 + /// LiteralValueReplacement(`1` |==> `2`) of: `int256 pos_one = 1;` + function signed_pos_one() public pure returns (int256) { + int256 pos_one = 2; + return pos_one; + } + + // Expect 2 mutants: -1, 1 + function signed_zero() public pure returns (int256) { + int256 zero = 0; + return zero; + } +} diff --git a/resources/regressions/all_ops.json/mutants/47/LVR/LVR.sol b/resources/regressions/all_ops.json/mutants/47/LVR/LVR.sol new file mode 100644 index 0000000..22af418 --- /dev/null +++ b/resources/regressions/all_ops.json/mutants/47/LVR/LVR.sol @@ -0,0 +1,43 @@ +// SPDX-License-Identifier: GPL-3.0-only +pragma solidity >0.7.0; +pragma experimental ABIEncoderV2; + +// This contract provides test functions for relational operator replacement (ROR) +contract LVR { + uint256 one_u = 1; + uint256 zero_u = 0; + int256 n_one_s = -1; + int256 one_s = 1; + int256 zero_s = 0; + + // Expect 1 mutant: 1 + function unsigned_zero() public pure returns (uint256) { + uint256 zero = 0; + return zero; + } + + // Expect 2 mutant: 0, 2 + function unsigned_one() public pure returns (uint256) { + uint256 one = 1; + return one; + } + + // Expect 2 mutants: 0, 1 + function signed_neg_one() public pure returns (int256) { + int256 neg_one = -1; + return neg_one; + } + + // Expect 2 mutants: -1, 0 + function signed_pos_one() public pure returns (int256) { + int256 pos_one = 1; + return pos_one; + } + + // Expect 2 mutants: -1, 1 + /// LiteralValueReplacement(`0` |==> `-1`) of: `int256 zero = 0;` + function signed_zero() public pure returns (int256) { + int256 zero = -1; + return zero; + } +} diff --git a/resources/regressions/all_ops.json/mutants/48/LVR/LVR.sol b/resources/regressions/all_ops.json/mutants/48/LVR/LVR.sol new file mode 100644 index 0000000..e241973 --- /dev/null +++ b/resources/regressions/all_ops.json/mutants/48/LVR/LVR.sol @@ -0,0 +1,43 @@ +// SPDX-License-Identifier: GPL-3.0-only +pragma solidity >0.7.0; +pragma experimental ABIEncoderV2; + +// This contract provides test functions for relational operator replacement (ROR) +contract LVR { + uint256 one_u = 1; + uint256 zero_u = 0; + int256 n_one_s = -1; + int256 one_s = 1; + int256 zero_s = 0; + + // Expect 1 mutant: 1 + function unsigned_zero() public pure returns (uint256) { + uint256 zero = 0; + return zero; + } + + // Expect 2 mutant: 0, 2 + function unsigned_one() public pure returns (uint256) { + uint256 one = 1; + return one; + } + + // Expect 2 mutants: 0, 1 + function signed_neg_one() public pure returns (int256) { + int256 neg_one = -1; + return neg_one; + } + + // Expect 2 mutants: -1, 0 + function signed_pos_one() public pure returns (int256) { + int256 pos_one = 1; + return pos_one; + } + + // Expect 2 mutants: -1, 1 + /// LiteralValueReplacement(`0` |==> `1`) of: `int256 zero = 0;` + function signed_zero() public pure returns (int256) { + int256 zero = 1; + return zero; + } +} diff --git a/resources/regressions/all_ops.json/mutants/49/ROR/ROR.sol b/resources/regressions/all_ops.json/mutants/49/ROR/ROR.sol new file mode 100644 index 0000000..dec84f2 --- /dev/null +++ b/resources/regressions/all_ops.json/mutants/49/ROR/ROR.sol @@ -0,0 +1,65 @@ +// SPDX-License-Identifier: GPL-3.0-only +pragma solidity >0.7.0; +pragma experimental ABIEncoderV2; + +// This contract provides test functions for relational operator replacement (ROR) +contract ROR { + // Expect 3 mutants: x <= y, x != y, false + /// RelationalOperatorReplacement(`<` |==> `<=`) of: `return x < y;` + function less(uint256 x, uint256 y) public pure returns (bool) { + return x <= y; + } + + // Expect 3 mutants: x < y, x == y, true + function less_equal(uint256 x, uint256 y) public pure returns (bool) { + return x <= y; + } + + // Expect 3 mutants: x >= y, x != y, false + function more(uint256 x, uint256 y) public pure returns (bool) { + return x > y; + } + + // Expect 3 mutants: x > y, x == y, true + function more_equal(uint256 x, uint256 y) public pure returns (bool) { + return x >= y; + } + + // Expect 3 mutants: x >= y, x <= y, false + function equal_ord(uint256 x, uint256 y) public pure returns (bool) { + return x == y; + } + + // Expect 2 mutants: true, false + function equal_not_ord(bool x, bool y) public pure returns (bool) { + return x == y; + } + + // Expect 3 mutants: x > y, x < y, true + function not_equal_ord(uint256 x, uint256 y) public pure returns (bool) { + return x != y; + } + + // Expect 2 mutants: true, false + function not_equal_not_ord(bool x, bool y) public pure returns (bool) { + return x != y; + } + + // Expect 3 mutants: (x + y) > z, (x + y) == z, true + function more_equal_over_aor( + uint256 x, + uint256 y, + uint256 z + ) public pure returns (bool) { + return (x + y) >= z; + } + + // Expect 3 mutants: (x + y) > z, (x + y) < z, true + function not_equal_over_aor( + uint256 x, + uint256 y, + uint256 z + ) public pure returns (bool) { + return (x + y) != z; + } +} diff --git a/resources/regressions/all_ops.json/mutants/5/AOR/AOR.sol b/resources/regressions/all_ops.json/mutants/5/AOR/AOR.sol new file mode 100644 index 0000000..60846bd --- /dev/null +++ b/resources/regressions/all_ops.json/mutants/5/AOR/AOR.sol @@ -0,0 +1,61 @@ +// SPDX-License-Identifier: GPL-3.0-only +pragma solidity >0.7.0; +pragma experimental ABIEncoderV2; + +// This contract provides test functions for Arithmetic operator replacement +contract AOR { + // Expect 4 mutants: + // a - b + // a * b + // a / b + // a % b + function plus(int256 a, int256 b) public pure returns (int256) { + return a + b; + } + + // Expect 4 mutants: + // a + b + // a * b + // a / b + // a % b + /// ArithmeticOperatorReplacement(`-` |==> `+`) of: `return a - b;` + function minus(int256 a, int256 b) public pure returns (int256) { + return a + b; + } + + // Expect 4 mutants: + // a - b + // a * b + // a / b + // a % b + function times_with_parens( + int256 a, + int256 b + ) public pure returns (int256) { + return ((a)) * b; + } + + // Expect 5 mutants: + // a + b + // a - b + // a / b + // a ** b + // a % b + function unsigned_times_with_parens( + uint256 a, + uint256 b + ) public pure returns (uint256) { + return ((a)) * b; + } + + // Expect 5 mutants: + // a + b + // a - b + // a / b + // a * b + // a % b + + function power(uint256 a, uint256 b) public pure returns (uint256) { + return a ** b; + } +} diff --git a/resources/regressions/all_ops.json/mutants/50/ROR/ROR.sol b/resources/regressions/all_ops.json/mutants/50/ROR/ROR.sol new file mode 100644 index 0000000..0c05265 --- /dev/null +++ b/resources/regressions/all_ops.json/mutants/50/ROR/ROR.sol @@ -0,0 +1,65 @@ +// SPDX-License-Identifier: GPL-3.0-only +pragma solidity >0.7.0; +pragma experimental ABIEncoderV2; + +// This contract provides test functions for relational operator replacement (ROR) +contract ROR { + // Expect 3 mutants: x <= y, x != y, false + /// RelationalOperatorReplacement(`<` |==> `!=`) of: `return x < y;` + function less(uint256 x, uint256 y) public pure returns (bool) { + return x != y; + } + + // Expect 3 mutants: x < y, x == y, true + function less_equal(uint256 x, uint256 y) public pure returns (bool) { + return x <= y; + } + + // Expect 3 mutants: x >= y, x != y, false + function more(uint256 x, uint256 y) public pure returns (bool) { + return x > y; + } + + // Expect 3 mutants: x > y, x == y, true + function more_equal(uint256 x, uint256 y) public pure returns (bool) { + return x >= y; + } + + // Expect 3 mutants: x >= y, x <= y, false + function equal_ord(uint256 x, uint256 y) public pure returns (bool) { + return x == y; + } + + // Expect 2 mutants: true, false + function equal_not_ord(bool x, bool y) public pure returns (bool) { + return x == y; + } + + // Expect 3 mutants: x > y, x < y, true + function not_equal_ord(uint256 x, uint256 y) public pure returns (bool) { + return x != y; + } + + // Expect 2 mutants: true, false + function not_equal_not_ord(bool x, bool y) public pure returns (bool) { + return x != y; + } + + // Expect 3 mutants: (x + y) > z, (x + y) == z, true + function more_equal_over_aor( + uint256 x, + uint256 y, + uint256 z + ) public pure returns (bool) { + return (x + y) >= z; + } + + // Expect 3 mutants: (x + y) > z, (x + y) < z, true + function not_equal_over_aor( + uint256 x, + uint256 y, + uint256 z + ) public pure returns (bool) { + return (x + y) != z; + } +} diff --git a/resources/regressions/all_ops.json/mutants/51/ROR/ROR.sol b/resources/regressions/all_ops.json/mutants/51/ROR/ROR.sol new file mode 100644 index 0000000..6141947 --- /dev/null +++ b/resources/regressions/all_ops.json/mutants/51/ROR/ROR.sol @@ -0,0 +1,65 @@ +// SPDX-License-Identifier: GPL-3.0-only +pragma solidity >0.7.0; +pragma experimental ABIEncoderV2; + +// This contract provides test functions for relational operator replacement (ROR) +contract ROR { + // Expect 3 mutants: x <= y, x != y, false + /// RelationalOperatorReplacement(`x < y` |==> `false`) of: `return x < y;` + function less(uint256 x, uint256 y) public pure returns (bool) { + return false; + } + + // Expect 3 mutants: x < y, x == y, true + function less_equal(uint256 x, uint256 y) public pure returns (bool) { + return x <= y; + } + + // Expect 3 mutants: x >= y, x != y, false + function more(uint256 x, uint256 y) public pure returns (bool) { + return x > y; + } + + // Expect 3 mutants: x > y, x == y, true + function more_equal(uint256 x, uint256 y) public pure returns (bool) { + return x >= y; + } + + // Expect 3 mutants: x >= y, x <= y, false + function equal_ord(uint256 x, uint256 y) public pure returns (bool) { + return x == y; + } + + // Expect 2 mutants: true, false + function equal_not_ord(bool x, bool y) public pure returns (bool) { + return x == y; + } + + // Expect 3 mutants: x > y, x < y, true + function not_equal_ord(uint256 x, uint256 y) public pure returns (bool) { + return x != y; + } + + // Expect 2 mutants: true, false + function not_equal_not_ord(bool x, bool y) public pure returns (bool) { + return x != y; + } + + // Expect 3 mutants: (x + y) > z, (x + y) == z, true + function more_equal_over_aor( + uint256 x, + uint256 y, + uint256 z + ) public pure returns (bool) { + return (x + y) >= z; + } + + // Expect 3 mutants: (x + y) > z, (x + y) < z, true + function not_equal_over_aor( + uint256 x, + uint256 y, + uint256 z + ) public pure returns (bool) { + return (x + y) != z; + } +} diff --git a/resources/regressions/all_ops.json/mutants/52/ROR/ROR.sol b/resources/regressions/all_ops.json/mutants/52/ROR/ROR.sol new file mode 100644 index 0000000..9f8ccd0 --- /dev/null +++ b/resources/regressions/all_ops.json/mutants/52/ROR/ROR.sol @@ -0,0 +1,65 @@ +// SPDX-License-Identifier: GPL-3.0-only +pragma solidity >0.7.0; +pragma experimental ABIEncoderV2; + +// This contract provides test functions for relational operator replacement (ROR) +contract ROR { + // Expect 3 mutants: x <= y, x != y, false + function less(uint256 x, uint256 y) public pure returns (bool) { + return x < y; + } + + // Expect 3 mutants: x < y, x == y, true + /// RelationalOperatorReplacement(`<=` |==> `<`) of: `return x <= y;` + function less_equal(uint256 x, uint256 y) public pure returns (bool) { + return x < y; + } + + // Expect 3 mutants: x >= y, x != y, false + function more(uint256 x, uint256 y) public pure returns (bool) { + return x > y; + } + + // Expect 3 mutants: x > y, x == y, true + function more_equal(uint256 x, uint256 y) public pure returns (bool) { + return x >= y; + } + + // Expect 3 mutants: x >= y, x <= y, false + function equal_ord(uint256 x, uint256 y) public pure returns (bool) { + return x == y; + } + + // Expect 2 mutants: true, false + function equal_not_ord(bool x, bool y) public pure returns (bool) { + return x == y; + } + + // Expect 3 mutants: x > y, x < y, true + function not_equal_ord(uint256 x, uint256 y) public pure returns (bool) { + return x != y; + } + + // Expect 2 mutants: true, false + function not_equal_not_ord(bool x, bool y) public pure returns (bool) { + return x != y; + } + + // Expect 3 mutants: (x + y) > z, (x + y) == z, true + function more_equal_over_aor( + uint256 x, + uint256 y, + uint256 z + ) public pure returns (bool) { + return (x + y) >= z; + } + + // Expect 3 mutants: (x + y) > z, (x + y) < z, true + function not_equal_over_aor( + uint256 x, + uint256 y, + uint256 z + ) public pure returns (bool) { + return (x + y) != z; + } +} diff --git a/resources/regressions/all_ops.json/mutants/53/ROR/ROR.sol b/resources/regressions/all_ops.json/mutants/53/ROR/ROR.sol new file mode 100644 index 0000000..18e38f3 --- /dev/null +++ b/resources/regressions/all_ops.json/mutants/53/ROR/ROR.sol @@ -0,0 +1,65 @@ +// SPDX-License-Identifier: GPL-3.0-only +pragma solidity >0.7.0; +pragma experimental ABIEncoderV2; + +// This contract provides test functions for relational operator replacement (ROR) +contract ROR { + // Expect 3 mutants: x <= y, x != y, false + function less(uint256 x, uint256 y) public pure returns (bool) { + return x < y; + } + + // Expect 3 mutants: x < y, x == y, true + /// RelationalOperatorReplacement(`<=` |==> `==`) of: `return x <= y;` + function less_equal(uint256 x, uint256 y) public pure returns (bool) { + return x == y; + } + + // Expect 3 mutants: x >= y, x != y, false + function more(uint256 x, uint256 y) public pure returns (bool) { + return x > y; + } + + // Expect 3 mutants: x > y, x == y, true + function more_equal(uint256 x, uint256 y) public pure returns (bool) { + return x >= y; + } + + // Expect 3 mutants: x >= y, x <= y, false + function equal_ord(uint256 x, uint256 y) public pure returns (bool) { + return x == y; + } + + // Expect 2 mutants: true, false + function equal_not_ord(bool x, bool y) public pure returns (bool) { + return x == y; + } + + // Expect 3 mutants: x > y, x < y, true + function not_equal_ord(uint256 x, uint256 y) public pure returns (bool) { + return x != y; + } + + // Expect 2 mutants: true, false + function not_equal_not_ord(bool x, bool y) public pure returns (bool) { + return x != y; + } + + // Expect 3 mutants: (x + y) > z, (x + y) == z, true + function more_equal_over_aor( + uint256 x, + uint256 y, + uint256 z + ) public pure returns (bool) { + return (x + y) >= z; + } + + // Expect 3 mutants: (x + y) > z, (x + y) < z, true + function not_equal_over_aor( + uint256 x, + uint256 y, + uint256 z + ) public pure returns (bool) { + return (x + y) != z; + } +} diff --git a/resources/regressions/all_ops.json/mutants/54/ROR/ROR.sol b/resources/regressions/all_ops.json/mutants/54/ROR/ROR.sol new file mode 100644 index 0000000..55dd7c7 --- /dev/null +++ b/resources/regressions/all_ops.json/mutants/54/ROR/ROR.sol @@ -0,0 +1,65 @@ +// SPDX-License-Identifier: GPL-3.0-only +pragma solidity >0.7.0; +pragma experimental ABIEncoderV2; + +// This contract provides test functions for relational operator replacement (ROR) +contract ROR { + // Expect 3 mutants: x <= y, x != y, false + function less(uint256 x, uint256 y) public pure returns (bool) { + return x < y; + } + + // Expect 3 mutants: x < y, x == y, true + /// RelationalOperatorReplacement(`x <= y` |==> `true`) of: `return x <= y;` + function less_equal(uint256 x, uint256 y) public pure returns (bool) { + return true; + } + + // Expect 3 mutants: x >= y, x != y, false + function more(uint256 x, uint256 y) public pure returns (bool) { + return x > y; + } + + // Expect 3 mutants: x > y, x == y, true + function more_equal(uint256 x, uint256 y) public pure returns (bool) { + return x >= y; + } + + // Expect 3 mutants: x >= y, x <= y, false + function equal_ord(uint256 x, uint256 y) public pure returns (bool) { + return x == y; + } + + // Expect 2 mutants: true, false + function equal_not_ord(bool x, bool y) public pure returns (bool) { + return x == y; + } + + // Expect 3 mutants: x > y, x < y, true + function not_equal_ord(uint256 x, uint256 y) public pure returns (bool) { + return x != y; + } + + // Expect 2 mutants: true, false + function not_equal_not_ord(bool x, bool y) public pure returns (bool) { + return x != y; + } + + // Expect 3 mutants: (x + y) > z, (x + y) == z, true + function more_equal_over_aor( + uint256 x, + uint256 y, + uint256 z + ) public pure returns (bool) { + return (x + y) >= z; + } + + // Expect 3 mutants: (x + y) > z, (x + y) < z, true + function not_equal_over_aor( + uint256 x, + uint256 y, + uint256 z + ) public pure returns (bool) { + return (x + y) != z; + } +} diff --git a/resources/regressions/all_ops.json/mutants/55/ROR/ROR.sol b/resources/regressions/all_ops.json/mutants/55/ROR/ROR.sol new file mode 100644 index 0000000..52949d0 --- /dev/null +++ b/resources/regressions/all_ops.json/mutants/55/ROR/ROR.sol @@ -0,0 +1,65 @@ +// SPDX-License-Identifier: GPL-3.0-only +pragma solidity >0.7.0; +pragma experimental ABIEncoderV2; + +// This contract provides test functions for relational operator replacement (ROR) +contract ROR { + // Expect 3 mutants: x <= y, x != y, false + function less(uint256 x, uint256 y) public pure returns (bool) { + return x < y; + } + + // Expect 3 mutants: x < y, x == y, true + function less_equal(uint256 x, uint256 y) public pure returns (bool) { + return x <= y; + } + + // Expect 3 mutants: x >= y, x != y, false + /// RelationalOperatorReplacement(`>` |==> `>=`) of: `return x > y;` + function more(uint256 x, uint256 y) public pure returns (bool) { + return x >= y; + } + + // Expect 3 mutants: x > y, x == y, true + function more_equal(uint256 x, uint256 y) public pure returns (bool) { + return x >= y; + } + + // Expect 3 mutants: x >= y, x <= y, false + function equal_ord(uint256 x, uint256 y) public pure returns (bool) { + return x == y; + } + + // Expect 2 mutants: true, false + function equal_not_ord(bool x, bool y) public pure returns (bool) { + return x == y; + } + + // Expect 3 mutants: x > y, x < y, true + function not_equal_ord(uint256 x, uint256 y) public pure returns (bool) { + return x != y; + } + + // Expect 2 mutants: true, false + function not_equal_not_ord(bool x, bool y) public pure returns (bool) { + return x != y; + } + + // Expect 3 mutants: (x + y) > z, (x + y) == z, true + function more_equal_over_aor( + uint256 x, + uint256 y, + uint256 z + ) public pure returns (bool) { + return (x + y) >= z; + } + + // Expect 3 mutants: (x + y) > z, (x + y) < z, true + function not_equal_over_aor( + uint256 x, + uint256 y, + uint256 z + ) public pure returns (bool) { + return (x + y) != z; + } +} diff --git a/resources/regressions/all_ops.json/mutants/56/ROR/ROR.sol b/resources/regressions/all_ops.json/mutants/56/ROR/ROR.sol new file mode 100644 index 0000000..a3e1632 --- /dev/null +++ b/resources/regressions/all_ops.json/mutants/56/ROR/ROR.sol @@ -0,0 +1,65 @@ +// SPDX-License-Identifier: GPL-3.0-only +pragma solidity >0.7.0; +pragma experimental ABIEncoderV2; + +// This contract provides test functions for relational operator replacement (ROR) +contract ROR { + // Expect 3 mutants: x <= y, x != y, false + function less(uint256 x, uint256 y) public pure returns (bool) { + return x < y; + } + + // Expect 3 mutants: x < y, x == y, true + function less_equal(uint256 x, uint256 y) public pure returns (bool) { + return x <= y; + } + + // Expect 3 mutants: x >= y, x != y, false + /// RelationalOperatorReplacement(`>` |==> `!=`) of: `return x > y;` + function more(uint256 x, uint256 y) public pure returns (bool) { + return x != y; + } + + // Expect 3 mutants: x > y, x == y, true + function more_equal(uint256 x, uint256 y) public pure returns (bool) { + return x >= y; + } + + // Expect 3 mutants: x >= y, x <= y, false + function equal_ord(uint256 x, uint256 y) public pure returns (bool) { + return x == y; + } + + // Expect 2 mutants: true, false + function equal_not_ord(bool x, bool y) public pure returns (bool) { + return x == y; + } + + // Expect 3 mutants: x > y, x < y, true + function not_equal_ord(uint256 x, uint256 y) public pure returns (bool) { + return x != y; + } + + // Expect 2 mutants: true, false + function not_equal_not_ord(bool x, bool y) public pure returns (bool) { + return x != y; + } + + // Expect 3 mutants: (x + y) > z, (x + y) == z, true + function more_equal_over_aor( + uint256 x, + uint256 y, + uint256 z + ) public pure returns (bool) { + return (x + y) >= z; + } + + // Expect 3 mutants: (x + y) > z, (x + y) < z, true + function not_equal_over_aor( + uint256 x, + uint256 y, + uint256 z + ) public pure returns (bool) { + return (x + y) != z; + } +} diff --git a/resources/regressions/all_ops.json/mutants/57/ROR/ROR.sol b/resources/regressions/all_ops.json/mutants/57/ROR/ROR.sol new file mode 100644 index 0000000..a902442 --- /dev/null +++ b/resources/regressions/all_ops.json/mutants/57/ROR/ROR.sol @@ -0,0 +1,65 @@ +// SPDX-License-Identifier: GPL-3.0-only +pragma solidity >0.7.0; +pragma experimental ABIEncoderV2; + +// This contract provides test functions for relational operator replacement (ROR) +contract ROR { + // Expect 3 mutants: x <= y, x != y, false + function less(uint256 x, uint256 y) public pure returns (bool) { + return x < y; + } + + // Expect 3 mutants: x < y, x == y, true + function less_equal(uint256 x, uint256 y) public pure returns (bool) { + return x <= y; + } + + // Expect 3 mutants: x >= y, x != y, false + /// RelationalOperatorReplacement(`x > y` |==> `false`) of: `return x > y;` + function more(uint256 x, uint256 y) public pure returns (bool) { + return false; + } + + // Expect 3 mutants: x > y, x == y, true + function more_equal(uint256 x, uint256 y) public pure returns (bool) { + return x >= y; + } + + // Expect 3 mutants: x >= y, x <= y, false + function equal_ord(uint256 x, uint256 y) public pure returns (bool) { + return x == y; + } + + // Expect 2 mutants: true, false + function equal_not_ord(bool x, bool y) public pure returns (bool) { + return x == y; + } + + // Expect 3 mutants: x > y, x < y, true + function not_equal_ord(uint256 x, uint256 y) public pure returns (bool) { + return x != y; + } + + // Expect 2 mutants: true, false + function not_equal_not_ord(bool x, bool y) public pure returns (bool) { + return x != y; + } + + // Expect 3 mutants: (x + y) > z, (x + y) == z, true + function more_equal_over_aor( + uint256 x, + uint256 y, + uint256 z + ) public pure returns (bool) { + return (x + y) >= z; + } + + // Expect 3 mutants: (x + y) > z, (x + y) < z, true + function not_equal_over_aor( + uint256 x, + uint256 y, + uint256 z + ) public pure returns (bool) { + return (x + y) != z; + } +} diff --git a/resources/regressions/all_ops.json/mutants/58/ROR/ROR.sol b/resources/regressions/all_ops.json/mutants/58/ROR/ROR.sol new file mode 100644 index 0000000..337c9a9 --- /dev/null +++ b/resources/regressions/all_ops.json/mutants/58/ROR/ROR.sol @@ -0,0 +1,65 @@ +// SPDX-License-Identifier: GPL-3.0-only +pragma solidity >0.7.0; +pragma experimental ABIEncoderV2; + +// This contract provides test functions for relational operator replacement (ROR) +contract ROR { + // Expect 3 mutants: x <= y, x != y, false + function less(uint256 x, uint256 y) public pure returns (bool) { + return x < y; + } + + // Expect 3 mutants: x < y, x == y, true + function less_equal(uint256 x, uint256 y) public pure returns (bool) { + return x <= y; + } + + // Expect 3 mutants: x >= y, x != y, false + function more(uint256 x, uint256 y) public pure returns (bool) { + return x > y; + } + + // Expect 3 mutants: x > y, x == y, true + /// RelationalOperatorReplacement(`>=` |==> `>`) of: `return x >= y;` + function more_equal(uint256 x, uint256 y) public pure returns (bool) { + return x > y; + } + + // Expect 3 mutants: x >= y, x <= y, false + function equal_ord(uint256 x, uint256 y) public pure returns (bool) { + return x == y; + } + + // Expect 2 mutants: true, false + function equal_not_ord(bool x, bool y) public pure returns (bool) { + return x == y; + } + + // Expect 3 mutants: x > y, x < y, true + function not_equal_ord(uint256 x, uint256 y) public pure returns (bool) { + return x != y; + } + + // Expect 2 mutants: true, false + function not_equal_not_ord(bool x, bool y) public pure returns (bool) { + return x != y; + } + + // Expect 3 mutants: (x + y) > z, (x + y) == z, true + function more_equal_over_aor( + uint256 x, + uint256 y, + uint256 z + ) public pure returns (bool) { + return (x + y) >= z; + } + + // Expect 3 mutants: (x + y) > z, (x + y) < z, true + function not_equal_over_aor( + uint256 x, + uint256 y, + uint256 z + ) public pure returns (bool) { + return (x + y) != z; + } +} diff --git a/resources/regressions/all_ops.json/mutants/59/ROR/ROR.sol b/resources/regressions/all_ops.json/mutants/59/ROR/ROR.sol new file mode 100644 index 0000000..7c02b73 --- /dev/null +++ b/resources/regressions/all_ops.json/mutants/59/ROR/ROR.sol @@ -0,0 +1,65 @@ +// SPDX-License-Identifier: GPL-3.0-only +pragma solidity >0.7.0; +pragma experimental ABIEncoderV2; + +// This contract provides test functions for relational operator replacement (ROR) +contract ROR { + // Expect 3 mutants: x <= y, x != y, false + function less(uint256 x, uint256 y) public pure returns (bool) { + return x < y; + } + + // Expect 3 mutants: x < y, x == y, true + function less_equal(uint256 x, uint256 y) public pure returns (bool) { + return x <= y; + } + + // Expect 3 mutants: x >= y, x != y, false + function more(uint256 x, uint256 y) public pure returns (bool) { + return x > y; + } + + // Expect 3 mutants: x > y, x == y, true + /// RelationalOperatorReplacement(`>=` |==> `==`) of: `return x >= y;` + function more_equal(uint256 x, uint256 y) public pure returns (bool) { + return x == y; + } + + // Expect 3 mutants: x >= y, x <= y, false + function equal_ord(uint256 x, uint256 y) public pure returns (bool) { + return x == y; + } + + // Expect 2 mutants: true, false + function equal_not_ord(bool x, bool y) public pure returns (bool) { + return x == y; + } + + // Expect 3 mutants: x > y, x < y, true + function not_equal_ord(uint256 x, uint256 y) public pure returns (bool) { + return x != y; + } + + // Expect 2 mutants: true, false + function not_equal_not_ord(bool x, bool y) public pure returns (bool) { + return x != y; + } + + // Expect 3 mutants: (x + y) > z, (x + y) == z, true + function more_equal_over_aor( + uint256 x, + uint256 y, + uint256 z + ) public pure returns (bool) { + return (x + y) >= z; + } + + // Expect 3 mutants: (x + y) > z, (x + y) < z, true + function not_equal_over_aor( + uint256 x, + uint256 y, + uint256 z + ) public pure returns (bool) { + return (x + y) != z; + } +} diff --git a/resources/regressions/all_ops.json/mutants/6/AOR/AOR.sol b/resources/regressions/all_ops.json/mutants/6/AOR/AOR.sol new file mode 100644 index 0000000..2ca17b1 --- /dev/null +++ b/resources/regressions/all_ops.json/mutants/6/AOR/AOR.sol @@ -0,0 +1,61 @@ +// SPDX-License-Identifier: GPL-3.0-only +pragma solidity >0.7.0; +pragma experimental ABIEncoderV2; + +// This contract provides test functions for Arithmetic operator replacement +contract AOR { + // Expect 4 mutants: + // a - b + // a * b + // a / b + // a % b + function plus(int256 a, int256 b) public pure returns (int256) { + return a + b; + } + + // Expect 4 mutants: + // a + b + // a * b + // a / b + // a % b + /// ArithmeticOperatorReplacement(`-` |==> `*`) of: `return a - b;` + function minus(int256 a, int256 b) public pure returns (int256) { + return a * b; + } + + // Expect 4 mutants: + // a - b + // a * b + // a / b + // a % b + function times_with_parens( + int256 a, + int256 b + ) public pure returns (int256) { + return ((a)) * b; + } + + // Expect 5 mutants: + // a + b + // a - b + // a / b + // a ** b + // a % b + function unsigned_times_with_parens( + uint256 a, + uint256 b + ) public pure returns (uint256) { + return ((a)) * b; + } + + // Expect 5 mutants: + // a + b + // a - b + // a / b + // a * b + // a % b + + function power(uint256 a, uint256 b) public pure returns (uint256) { + return a ** b; + } +} diff --git a/resources/regressions/all_ops.json/mutants/60/ROR/ROR.sol b/resources/regressions/all_ops.json/mutants/60/ROR/ROR.sol new file mode 100644 index 0000000..3d299df --- /dev/null +++ b/resources/regressions/all_ops.json/mutants/60/ROR/ROR.sol @@ -0,0 +1,65 @@ +// SPDX-License-Identifier: GPL-3.0-only +pragma solidity >0.7.0; +pragma experimental ABIEncoderV2; + +// This contract provides test functions for relational operator replacement (ROR) +contract ROR { + // Expect 3 mutants: x <= y, x != y, false + function less(uint256 x, uint256 y) public pure returns (bool) { + return x < y; + } + + // Expect 3 mutants: x < y, x == y, true + function less_equal(uint256 x, uint256 y) public pure returns (bool) { + return x <= y; + } + + // Expect 3 mutants: x >= y, x != y, false + function more(uint256 x, uint256 y) public pure returns (bool) { + return x > y; + } + + // Expect 3 mutants: x > y, x == y, true + /// RelationalOperatorReplacement(`x >= y` |==> `true`) of: `return x >= y;` + function more_equal(uint256 x, uint256 y) public pure returns (bool) { + return true; + } + + // Expect 3 mutants: x >= y, x <= y, false + function equal_ord(uint256 x, uint256 y) public pure returns (bool) { + return x == y; + } + + // Expect 2 mutants: true, false + function equal_not_ord(bool x, bool y) public pure returns (bool) { + return x == y; + } + + // Expect 3 mutants: x > y, x < y, true + function not_equal_ord(uint256 x, uint256 y) public pure returns (bool) { + return x != y; + } + + // Expect 2 mutants: true, false + function not_equal_not_ord(bool x, bool y) public pure returns (bool) { + return x != y; + } + + // Expect 3 mutants: (x + y) > z, (x + y) == z, true + function more_equal_over_aor( + uint256 x, + uint256 y, + uint256 z + ) public pure returns (bool) { + return (x + y) >= z; + } + + // Expect 3 mutants: (x + y) > z, (x + y) < z, true + function not_equal_over_aor( + uint256 x, + uint256 y, + uint256 z + ) public pure returns (bool) { + return (x + y) != z; + } +} diff --git a/resources/regressions/all_ops.json/mutants/61/ROR/ROR.sol b/resources/regressions/all_ops.json/mutants/61/ROR/ROR.sol new file mode 100644 index 0000000..c865469 --- /dev/null +++ b/resources/regressions/all_ops.json/mutants/61/ROR/ROR.sol @@ -0,0 +1,65 @@ +// SPDX-License-Identifier: GPL-3.0-only +pragma solidity >0.7.0; +pragma experimental ABIEncoderV2; + +// This contract provides test functions for relational operator replacement (ROR) +contract ROR { + // Expect 3 mutants: x <= y, x != y, false + function less(uint256 x, uint256 y) public pure returns (bool) { + return x < y; + } + + // Expect 3 mutants: x < y, x == y, true + function less_equal(uint256 x, uint256 y) public pure returns (bool) { + return x <= y; + } + + // Expect 3 mutants: x >= y, x != y, false + function more(uint256 x, uint256 y) public pure returns (bool) { + return x > y; + } + + // Expect 3 mutants: x > y, x == y, true + function more_equal(uint256 x, uint256 y) public pure returns (bool) { + return x >= y; + } + + // Expect 3 mutants: x >= y, x <= y, false + /// RelationalOperatorReplacement(`==` |==> `<=`) of: `return x == y;` + function equal_ord(uint256 x, uint256 y) public pure returns (bool) { + return x <= y; + } + + // Expect 2 mutants: true, false + function equal_not_ord(bool x, bool y) public pure returns (bool) { + return x == y; + } + + // Expect 3 mutants: x > y, x < y, true + function not_equal_ord(uint256 x, uint256 y) public pure returns (bool) { + return x != y; + } + + // Expect 2 mutants: true, false + function not_equal_not_ord(bool x, bool y) public pure returns (bool) { + return x != y; + } + + // Expect 3 mutants: (x + y) > z, (x + y) == z, true + function more_equal_over_aor( + uint256 x, + uint256 y, + uint256 z + ) public pure returns (bool) { + return (x + y) >= z; + } + + // Expect 3 mutants: (x + y) > z, (x + y) < z, true + function not_equal_over_aor( + uint256 x, + uint256 y, + uint256 z + ) public pure returns (bool) { + return (x + y) != z; + } +} diff --git a/resources/regressions/all_ops.json/mutants/62/ROR/ROR.sol b/resources/regressions/all_ops.json/mutants/62/ROR/ROR.sol new file mode 100644 index 0000000..8cdc1c1 --- /dev/null +++ b/resources/regressions/all_ops.json/mutants/62/ROR/ROR.sol @@ -0,0 +1,65 @@ +// SPDX-License-Identifier: GPL-3.0-only +pragma solidity >0.7.0; +pragma experimental ABIEncoderV2; + +// This contract provides test functions for relational operator replacement (ROR) +contract ROR { + // Expect 3 mutants: x <= y, x != y, false + function less(uint256 x, uint256 y) public pure returns (bool) { + return x < y; + } + + // Expect 3 mutants: x < y, x == y, true + function less_equal(uint256 x, uint256 y) public pure returns (bool) { + return x <= y; + } + + // Expect 3 mutants: x >= y, x != y, false + function more(uint256 x, uint256 y) public pure returns (bool) { + return x > y; + } + + // Expect 3 mutants: x > y, x == y, true + function more_equal(uint256 x, uint256 y) public pure returns (bool) { + return x >= y; + } + + // Expect 3 mutants: x >= y, x <= y, false + /// RelationalOperatorReplacement(`==` |==> `>=`) of: `return x == y;` + function equal_ord(uint256 x, uint256 y) public pure returns (bool) { + return x >= y; + } + + // Expect 2 mutants: true, false + function equal_not_ord(bool x, bool y) public pure returns (bool) { + return x == y; + } + + // Expect 3 mutants: x > y, x < y, true + function not_equal_ord(uint256 x, uint256 y) public pure returns (bool) { + return x != y; + } + + // Expect 2 mutants: true, false + function not_equal_not_ord(bool x, bool y) public pure returns (bool) { + return x != y; + } + + // Expect 3 mutants: (x + y) > z, (x + y) == z, true + function more_equal_over_aor( + uint256 x, + uint256 y, + uint256 z + ) public pure returns (bool) { + return (x + y) >= z; + } + + // Expect 3 mutants: (x + y) > z, (x + y) < z, true + function not_equal_over_aor( + uint256 x, + uint256 y, + uint256 z + ) public pure returns (bool) { + return (x + y) != z; + } +} diff --git a/resources/regressions/all_ops.json/mutants/63/ROR/ROR.sol b/resources/regressions/all_ops.json/mutants/63/ROR/ROR.sol new file mode 100644 index 0000000..de6a436 --- /dev/null +++ b/resources/regressions/all_ops.json/mutants/63/ROR/ROR.sol @@ -0,0 +1,65 @@ +// SPDX-License-Identifier: GPL-3.0-only +pragma solidity >0.7.0; +pragma experimental ABIEncoderV2; + +// This contract provides test functions for relational operator replacement (ROR) +contract ROR { + // Expect 3 mutants: x <= y, x != y, false + function less(uint256 x, uint256 y) public pure returns (bool) { + return x < y; + } + + // Expect 3 mutants: x < y, x == y, true + function less_equal(uint256 x, uint256 y) public pure returns (bool) { + return x <= y; + } + + // Expect 3 mutants: x >= y, x != y, false + function more(uint256 x, uint256 y) public pure returns (bool) { + return x > y; + } + + // Expect 3 mutants: x > y, x == y, true + function more_equal(uint256 x, uint256 y) public pure returns (bool) { + return x >= y; + } + + // Expect 3 mutants: x >= y, x <= y, false + /// RelationalOperatorReplacement(`x == y` |==> `false`) of: `return x == y;` + function equal_ord(uint256 x, uint256 y) public pure returns (bool) { + return false; + } + + // Expect 2 mutants: true, false + function equal_not_ord(bool x, bool y) public pure returns (bool) { + return x == y; + } + + // Expect 3 mutants: x > y, x < y, true + function not_equal_ord(uint256 x, uint256 y) public pure returns (bool) { + return x != y; + } + + // Expect 2 mutants: true, false + function not_equal_not_ord(bool x, bool y) public pure returns (bool) { + return x != y; + } + + // Expect 3 mutants: (x + y) > z, (x + y) == z, true + function more_equal_over_aor( + uint256 x, + uint256 y, + uint256 z + ) public pure returns (bool) { + return (x + y) >= z; + } + + // Expect 3 mutants: (x + y) > z, (x + y) < z, true + function not_equal_over_aor( + uint256 x, + uint256 y, + uint256 z + ) public pure returns (bool) { + return (x + y) != z; + } +} diff --git a/resources/regressions/all_ops.json/mutants/64/ROR/ROR.sol b/resources/regressions/all_ops.json/mutants/64/ROR/ROR.sol new file mode 100644 index 0000000..ab40e6c --- /dev/null +++ b/resources/regressions/all_ops.json/mutants/64/ROR/ROR.sol @@ -0,0 +1,65 @@ +// SPDX-License-Identifier: GPL-3.0-only +pragma solidity >0.7.0; +pragma experimental ABIEncoderV2; + +// This contract provides test functions for relational operator replacement (ROR) +contract ROR { + // Expect 3 mutants: x <= y, x != y, false + function less(uint256 x, uint256 y) public pure returns (bool) { + return x < y; + } + + // Expect 3 mutants: x < y, x == y, true + function less_equal(uint256 x, uint256 y) public pure returns (bool) { + return x <= y; + } + + // Expect 3 mutants: x >= y, x != y, false + function more(uint256 x, uint256 y) public pure returns (bool) { + return x > y; + } + + // Expect 3 mutants: x > y, x == y, true + function more_equal(uint256 x, uint256 y) public pure returns (bool) { + return x >= y; + } + + // Expect 3 mutants: x >= y, x <= y, false + function equal_ord(uint256 x, uint256 y) public pure returns (bool) { + return x == y; + } + + // Expect 2 mutants: true, false + /// RelationalOperatorReplacement(`x == y` |==> `false`) of: `return x == y;` + function equal_not_ord(bool x, bool y) public pure returns (bool) { + return false; + } + + // Expect 3 mutants: x > y, x < y, true + function not_equal_ord(uint256 x, uint256 y) public pure returns (bool) { + return x != y; + } + + // Expect 2 mutants: true, false + function not_equal_not_ord(bool x, bool y) public pure returns (bool) { + return x != y; + } + + // Expect 3 mutants: (x + y) > z, (x + y) == z, true + function more_equal_over_aor( + uint256 x, + uint256 y, + uint256 z + ) public pure returns (bool) { + return (x + y) >= z; + } + + // Expect 3 mutants: (x + y) > z, (x + y) < z, true + function not_equal_over_aor( + uint256 x, + uint256 y, + uint256 z + ) public pure returns (bool) { + return (x + y) != z; + } +} diff --git a/resources/regressions/all_ops.json/mutants/65/ROR/ROR.sol b/resources/regressions/all_ops.json/mutants/65/ROR/ROR.sol new file mode 100644 index 0000000..f42e7b7 --- /dev/null +++ b/resources/regressions/all_ops.json/mutants/65/ROR/ROR.sol @@ -0,0 +1,65 @@ +// SPDX-License-Identifier: GPL-3.0-only +pragma solidity >0.7.0; +pragma experimental ABIEncoderV2; + +// This contract provides test functions for relational operator replacement (ROR) +contract ROR { + // Expect 3 mutants: x <= y, x != y, false + function less(uint256 x, uint256 y) public pure returns (bool) { + return x < y; + } + + // Expect 3 mutants: x < y, x == y, true + function less_equal(uint256 x, uint256 y) public pure returns (bool) { + return x <= y; + } + + // Expect 3 mutants: x >= y, x != y, false + function more(uint256 x, uint256 y) public pure returns (bool) { + return x > y; + } + + // Expect 3 mutants: x > y, x == y, true + function more_equal(uint256 x, uint256 y) public pure returns (bool) { + return x >= y; + } + + // Expect 3 mutants: x >= y, x <= y, false + function equal_ord(uint256 x, uint256 y) public pure returns (bool) { + return x == y; + } + + // Expect 2 mutants: true, false + function equal_not_ord(bool x, bool y) public pure returns (bool) { + return x == y; + } + + // Expect 3 mutants: x > y, x < y, true + /// RelationalOperatorReplacement(`!=` |==> `<`) of: `return x != y;` + function not_equal_ord(uint256 x, uint256 y) public pure returns (bool) { + return x < y; + } + + // Expect 2 mutants: true, false + function not_equal_not_ord(bool x, bool y) public pure returns (bool) { + return x != y; + } + + // Expect 3 mutants: (x + y) > z, (x + y) == z, true + function more_equal_over_aor( + uint256 x, + uint256 y, + uint256 z + ) public pure returns (bool) { + return (x + y) >= z; + } + + // Expect 3 mutants: (x + y) > z, (x + y) < z, true + function not_equal_over_aor( + uint256 x, + uint256 y, + uint256 z + ) public pure returns (bool) { + return (x + y) != z; + } +} diff --git a/resources/regressions/all_ops.json/mutants/66/ROR/ROR.sol b/resources/regressions/all_ops.json/mutants/66/ROR/ROR.sol new file mode 100644 index 0000000..e5f5032 --- /dev/null +++ b/resources/regressions/all_ops.json/mutants/66/ROR/ROR.sol @@ -0,0 +1,65 @@ +// SPDX-License-Identifier: GPL-3.0-only +pragma solidity >0.7.0; +pragma experimental ABIEncoderV2; + +// This contract provides test functions for relational operator replacement (ROR) +contract ROR { + // Expect 3 mutants: x <= y, x != y, false + function less(uint256 x, uint256 y) public pure returns (bool) { + return x < y; + } + + // Expect 3 mutants: x < y, x == y, true + function less_equal(uint256 x, uint256 y) public pure returns (bool) { + return x <= y; + } + + // Expect 3 mutants: x >= y, x != y, false + function more(uint256 x, uint256 y) public pure returns (bool) { + return x > y; + } + + // Expect 3 mutants: x > y, x == y, true + function more_equal(uint256 x, uint256 y) public pure returns (bool) { + return x >= y; + } + + // Expect 3 mutants: x >= y, x <= y, false + function equal_ord(uint256 x, uint256 y) public pure returns (bool) { + return x == y; + } + + // Expect 2 mutants: true, false + function equal_not_ord(bool x, bool y) public pure returns (bool) { + return x == y; + } + + // Expect 3 mutants: x > y, x < y, true + /// RelationalOperatorReplacement(`!=` |==> `>`) of: `return x != y;` + function not_equal_ord(uint256 x, uint256 y) public pure returns (bool) { + return x > y; + } + + // Expect 2 mutants: true, false + function not_equal_not_ord(bool x, bool y) public pure returns (bool) { + return x != y; + } + + // Expect 3 mutants: (x + y) > z, (x + y) == z, true + function more_equal_over_aor( + uint256 x, + uint256 y, + uint256 z + ) public pure returns (bool) { + return (x + y) >= z; + } + + // Expect 3 mutants: (x + y) > z, (x + y) < z, true + function not_equal_over_aor( + uint256 x, + uint256 y, + uint256 z + ) public pure returns (bool) { + return (x + y) != z; + } +} diff --git a/resources/regressions/all_ops.json/mutants/67/ROR/ROR.sol b/resources/regressions/all_ops.json/mutants/67/ROR/ROR.sol new file mode 100644 index 0000000..8368448 --- /dev/null +++ b/resources/regressions/all_ops.json/mutants/67/ROR/ROR.sol @@ -0,0 +1,65 @@ +// SPDX-License-Identifier: GPL-3.0-only +pragma solidity >0.7.0; +pragma experimental ABIEncoderV2; + +// This contract provides test functions for relational operator replacement (ROR) +contract ROR { + // Expect 3 mutants: x <= y, x != y, false + function less(uint256 x, uint256 y) public pure returns (bool) { + return x < y; + } + + // Expect 3 mutants: x < y, x == y, true + function less_equal(uint256 x, uint256 y) public pure returns (bool) { + return x <= y; + } + + // Expect 3 mutants: x >= y, x != y, false + function more(uint256 x, uint256 y) public pure returns (bool) { + return x > y; + } + + // Expect 3 mutants: x > y, x == y, true + function more_equal(uint256 x, uint256 y) public pure returns (bool) { + return x >= y; + } + + // Expect 3 mutants: x >= y, x <= y, false + function equal_ord(uint256 x, uint256 y) public pure returns (bool) { + return x == y; + } + + // Expect 2 mutants: true, false + function equal_not_ord(bool x, bool y) public pure returns (bool) { + return x == y; + } + + // Expect 3 mutants: x > y, x < y, true + /// RelationalOperatorReplacement(`x != y` |==> `true`) of: `return x != y;` + function not_equal_ord(uint256 x, uint256 y) public pure returns (bool) { + return true; + } + + // Expect 2 mutants: true, false + function not_equal_not_ord(bool x, bool y) public pure returns (bool) { + return x != y; + } + + // Expect 3 mutants: (x + y) > z, (x + y) == z, true + function more_equal_over_aor( + uint256 x, + uint256 y, + uint256 z + ) public pure returns (bool) { + return (x + y) >= z; + } + + // Expect 3 mutants: (x + y) > z, (x + y) < z, true + function not_equal_over_aor( + uint256 x, + uint256 y, + uint256 z + ) public pure returns (bool) { + return (x + y) != z; + } +} diff --git a/resources/regressions/all_ops.json/mutants/68/ROR/ROR.sol b/resources/regressions/all_ops.json/mutants/68/ROR/ROR.sol new file mode 100644 index 0000000..3ae9213 --- /dev/null +++ b/resources/regressions/all_ops.json/mutants/68/ROR/ROR.sol @@ -0,0 +1,65 @@ +// SPDX-License-Identifier: GPL-3.0-only +pragma solidity >0.7.0; +pragma experimental ABIEncoderV2; + +// This contract provides test functions for relational operator replacement (ROR) +contract ROR { + // Expect 3 mutants: x <= y, x != y, false + function less(uint256 x, uint256 y) public pure returns (bool) { + return x < y; + } + + // Expect 3 mutants: x < y, x == y, true + function less_equal(uint256 x, uint256 y) public pure returns (bool) { + return x <= y; + } + + // Expect 3 mutants: x >= y, x != y, false + function more(uint256 x, uint256 y) public pure returns (bool) { + return x > y; + } + + // Expect 3 mutants: x > y, x == y, true + function more_equal(uint256 x, uint256 y) public pure returns (bool) { + return x >= y; + } + + // Expect 3 mutants: x >= y, x <= y, false + function equal_ord(uint256 x, uint256 y) public pure returns (bool) { + return x == y; + } + + // Expect 2 mutants: true, false + function equal_not_ord(bool x, bool y) public pure returns (bool) { + return x == y; + } + + // Expect 3 mutants: x > y, x < y, true + function not_equal_ord(uint256 x, uint256 y) public pure returns (bool) { + return x != y; + } + + // Expect 2 mutants: true, false + /// RelationalOperatorReplacement(`x != y` |==> `true`) of: `return x != y;` + function not_equal_not_ord(bool x, bool y) public pure returns (bool) { + return true; + } + + // Expect 3 mutants: (x + y) > z, (x + y) == z, true + function more_equal_over_aor( + uint256 x, + uint256 y, + uint256 z + ) public pure returns (bool) { + return (x + y) >= z; + } + + // Expect 3 mutants: (x + y) > z, (x + y) < z, true + function not_equal_over_aor( + uint256 x, + uint256 y, + uint256 z + ) public pure returns (bool) { + return (x + y) != z; + } +} diff --git a/resources/regressions/all_ops.json/mutants/69/ROR/ROR.sol b/resources/regressions/all_ops.json/mutants/69/ROR/ROR.sol new file mode 100644 index 0000000..bdeac3a --- /dev/null +++ b/resources/regressions/all_ops.json/mutants/69/ROR/ROR.sol @@ -0,0 +1,65 @@ +// SPDX-License-Identifier: GPL-3.0-only +pragma solidity >0.7.0; +pragma experimental ABIEncoderV2; + +// This contract provides test functions for relational operator replacement (ROR) +contract ROR { + // Expect 3 mutants: x <= y, x != y, false + function less(uint256 x, uint256 y) public pure returns (bool) { + return x < y; + } + + // Expect 3 mutants: x < y, x == y, true + function less_equal(uint256 x, uint256 y) public pure returns (bool) { + return x <= y; + } + + // Expect 3 mutants: x >= y, x != y, false + function more(uint256 x, uint256 y) public pure returns (bool) { + return x > y; + } + + // Expect 3 mutants: x > y, x == y, true + function more_equal(uint256 x, uint256 y) public pure returns (bool) { + return x >= y; + } + + // Expect 3 mutants: x >= y, x <= y, false + function equal_ord(uint256 x, uint256 y) public pure returns (bool) { + return x == y; + } + + // Expect 2 mutants: true, false + function equal_not_ord(bool x, bool y) public pure returns (bool) { + return x == y; + } + + // Expect 3 mutants: x > y, x < y, true + function not_equal_ord(uint256 x, uint256 y) public pure returns (bool) { + return x != y; + } + + // Expect 2 mutants: true, false + function not_equal_not_ord(bool x, bool y) public pure returns (bool) { + return x != y; + } + + // Expect 3 mutants: (x + y) > z, (x + y) == z, true + function more_equal_over_aor( + uint256 x, + uint256 y, + uint256 z + /// RelationalOperatorReplacement(`>=` |==> `>`) of: `return (x + y) >= z;` + ) public pure returns (bool) { + return (x + y) > z; + } + + // Expect 3 mutants: (x + y) > z, (x + y) < z, true + function not_equal_over_aor( + uint256 x, + uint256 y, + uint256 z + ) public pure returns (bool) { + return (x + y) != z; + } +} diff --git a/resources/regressions/all_ops.json/mutants/7/AOR/AOR.sol b/resources/regressions/all_ops.json/mutants/7/AOR/AOR.sol new file mode 100644 index 0000000..c07a6ae --- /dev/null +++ b/resources/regressions/all_ops.json/mutants/7/AOR/AOR.sol @@ -0,0 +1,61 @@ +// SPDX-License-Identifier: GPL-3.0-only +pragma solidity >0.7.0; +pragma experimental ABIEncoderV2; + +// This contract provides test functions for Arithmetic operator replacement +contract AOR { + // Expect 4 mutants: + // a - b + // a * b + // a / b + // a % b + function plus(int256 a, int256 b) public pure returns (int256) { + return a + b; + } + + // Expect 4 mutants: + // a + b + // a * b + // a / b + // a % b + /// ArithmeticOperatorReplacement(`-` |==> `/`) of: `return a - b;` + function minus(int256 a, int256 b) public pure returns (int256) { + return a / b; + } + + // Expect 4 mutants: + // a - b + // a * b + // a / b + // a % b + function times_with_parens( + int256 a, + int256 b + ) public pure returns (int256) { + return ((a)) * b; + } + + // Expect 5 mutants: + // a + b + // a - b + // a / b + // a ** b + // a % b + function unsigned_times_with_parens( + uint256 a, + uint256 b + ) public pure returns (uint256) { + return ((a)) * b; + } + + // Expect 5 mutants: + // a + b + // a - b + // a / b + // a * b + // a % b + + function power(uint256 a, uint256 b) public pure returns (uint256) { + return a ** b; + } +} diff --git a/resources/regressions/all_ops.json/mutants/70/ROR/ROR.sol b/resources/regressions/all_ops.json/mutants/70/ROR/ROR.sol new file mode 100644 index 0000000..430379f --- /dev/null +++ b/resources/regressions/all_ops.json/mutants/70/ROR/ROR.sol @@ -0,0 +1,65 @@ +// SPDX-License-Identifier: GPL-3.0-only +pragma solidity >0.7.0; +pragma experimental ABIEncoderV2; + +// This contract provides test functions for relational operator replacement (ROR) +contract ROR { + // Expect 3 mutants: x <= y, x != y, false + function less(uint256 x, uint256 y) public pure returns (bool) { + return x < y; + } + + // Expect 3 mutants: x < y, x == y, true + function less_equal(uint256 x, uint256 y) public pure returns (bool) { + return x <= y; + } + + // Expect 3 mutants: x >= y, x != y, false + function more(uint256 x, uint256 y) public pure returns (bool) { + return x > y; + } + + // Expect 3 mutants: x > y, x == y, true + function more_equal(uint256 x, uint256 y) public pure returns (bool) { + return x >= y; + } + + // Expect 3 mutants: x >= y, x <= y, false + function equal_ord(uint256 x, uint256 y) public pure returns (bool) { + return x == y; + } + + // Expect 2 mutants: true, false + function equal_not_ord(bool x, bool y) public pure returns (bool) { + return x == y; + } + + // Expect 3 mutants: x > y, x < y, true + function not_equal_ord(uint256 x, uint256 y) public pure returns (bool) { + return x != y; + } + + // Expect 2 mutants: true, false + function not_equal_not_ord(bool x, bool y) public pure returns (bool) { + return x != y; + } + + // Expect 3 mutants: (x + y) > z, (x + y) == z, true + function more_equal_over_aor( + uint256 x, + uint256 y, + uint256 z + /// RelationalOperatorReplacement(`>=` |==> `==`) of: `return (x + y) >= z;` + ) public pure returns (bool) { + return (x + y) == z; + } + + // Expect 3 mutants: (x + y) > z, (x + y) < z, true + function not_equal_over_aor( + uint256 x, + uint256 y, + uint256 z + ) public pure returns (bool) { + return (x + y) != z; + } +} diff --git a/resources/regressions/all_ops.json/mutants/71/ROR/ROR.sol b/resources/regressions/all_ops.json/mutants/71/ROR/ROR.sol new file mode 100644 index 0000000..3d67c15 --- /dev/null +++ b/resources/regressions/all_ops.json/mutants/71/ROR/ROR.sol @@ -0,0 +1,65 @@ +// SPDX-License-Identifier: GPL-3.0-only +pragma solidity >0.7.0; +pragma experimental ABIEncoderV2; + +// This contract provides test functions for relational operator replacement (ROR) +contract ROR { + // Expect 3 mutants: x <= y, x != y, false + function less(uint256 x, uint256 y) public pure returns (bool) { + return x < y; + } + + // Expect 3 mutants: x < y, x == y, true + function less_equal(uint256 x, uint256 y) public pure returns (bool) { + return x <= y; + } + + // Expect 3 mutants: x >= y, x != y, false + function more(uint256 x, uint256 y) public pure returns (bool) { + return x > y; + } + + // Expect 3 mutants: x > y, x == y, true + function more_equal(uint256 x, uint256 y) public pure returns (bool) { + return x >= y; + } + + // Expect 3 mutants: x >= y, x <= y, false + function equal_ord(uint256 x, uint256 y) public pure returns (bool) { + return x == y; + } + + // Expect 2 mutants: true, false + function equal_not_ord(bool x, bool y) public pure returns (bool) { + return x == y; + } + + // Expect 3 mutants: x > y, x < y, true + function not_equal_ord(uint256 x, uint256 y) public pure returns (bool) { + return x != y; + } + + // Expect 2 mutants: true, false + function not_equal_not_ord(bool x, bool y) public pure returns (bool) { + return x != y; + } + + // Expect 3 mutants: (x + y) > z, (x + y) == z, true + function more_equal_over_aor( + uint256 x, + uint256 y, + uint256 z + /// RelationalOperatorReplacement(`(x + y) >= z` |==> `true`) of: `return (x + y) >= z;` + ) public pure returns (bool) { + return true; + } + + // Expect 3 mutants: (x + y) > z, (x + y) < z, true + function not_equal_over_aor( + uint256 x, + uint256 y, + uint256 z + ) public pure returns (bool) { + return (x + y) != z; + } +} diff --git a/resources/regressions/all_ops.json/mutants/72/ROR/ROR.sol b/resources/regressions/all_ops.json/mutants/72/ROR/ROR.sol new file mode 100644 index 0000000..1361261 --- /dev/null +++ b/resources/regressions/all_ops.json/mutants/72/ROR/ROR.sol @@ -0,0 +1,65 @@ +// SPDX-License-Identifier: GPL-3.0-only +pragma solidity >0.7.0; +pragma experimental ABIEncoderV2; + +// This contract provides test functions for relational operator replacement (ROR) +contract ROR { + // Expect 3 mutants: x <= y, x != y, false + function less(uint256 x, uint256 y) public pure returns (bool) { + return x < y; + } + + // Expect 3 mutants: x < y, x == y, true + function less_equal(uint256 x, uint256 y) public pure returns (bool) { + return x <= y; + } + + // Expect 3 mutants: x >= y, x != y, false + function more(uint256 x, uint256 y) public pure returns (bool) { + return x > y; + } + + // Expect 3 mutants: x > y, x == y, true + function more_equal(uint256 x, uint256 y) public pure returns (bool) { + return x >= y; + } + + // Expect 3 mutants: x >= y, x <= y, false + function equal_ord(uint256 x, uint256 y) public pure returns (bool) { + return x == y; + } + + // Expect 2 mutants: true, false + function equal_not_ord(bool x, bool y) public pure returns (bool) { + return x == y; + } + + // Expect 3 mutants: x > y, x < y, true + function not_equal_ord(uint256 x, uint256 y) public pure returns (bool) { + return x != y; + } + + // Expect 2 mutants: true, false + function not_equal_not_ord(bool x, bool y) public pure returns (bool) { + return x != y; + } + + // Expect 3 mutants: (x + y) > z, (x + y) == z, true + function more_equal_over_aor( + uint256 x, + uint256 y, + uint256 z + ) public pure returns (bool) { + return (x + y) >= z; + } + + // Expect 3 mutants: (x + y) > z, (x + y) < z, true + function not_equal_over_aor( + uint256 x, + uint256 y, + uint256 z + /// RelationalOperatorReplacement(`!=` |==> `<`) of: `return (x + y) != z;` + ) public pure returns (bool) { + return (x + y) < z; + } +} diff --git a/resources/regressions/all_ops.json/mutants/73/ROR/ROR.sol b/resources/regressions/all_ops.json/mutants/73/ROR/ROR.sol new file mode 100644 index 0000000..dd0c83c --- /dev/null +++ b/resources/regressions/all_ops.json/mutants/73/ROR/ROR.sol @@ -0,0 +1,65 @@ +// SPDX-License-Identifier: GPL-3.0-only +pragma solidity >0.7.0; +pragma experimental ABIEncoderV2; + +// This contract provides test functions for relational operator replacement (ROR) +contract ROR { + // Expect 3 mutants: x <= y, x != y, false + function less(uint256 x, uint256 y) public pure returns (bool) { + return x < y; + } + + // Expect 3 mutants: x < y, x == y, true + function less_equal(uint256 x, uint256 y) public pure returns (bool) { + return x <= y; + } + + // Expect 3 mutants: x >= y, x != y, false + function more(uint256 x, uint256 y) public pure returns (bool) { + return x > y; + } + + // Expect 3 mutants: x > y, x == y, true + function more_equal(uint256 x, uint256 y) public pure returns (bool) { + return x >= y; + } + + // Expect 3 mutants: x >= y, x <= y, false + function equal_ord(uint256 x, uint256 y) public pure returns (bool) { + return x == y; + } + + // Expect 2 mutants: true, false + function equal_not_ord(bool x, bool y) public pure returns (bool) { + return x == y; + } + + // Expect 3 mutants: x > y, x < y, true + function not_equal_ord(uint256 x, uint256 y) public pure returns (bool) { + return x != y; + } + + // Expect 2 mutants: true, false + function not_equal_not_ord(bool x, bool y) public pure returns (bool) { + return x != y; + } + + // Expect 3 mutants: (x + y) > z, (x + y) == z, true + function more_equal_over_aor( + uint256 x, + uint256 y, + uint256 z + ) public pure returns (bool) { + return (x + y) >= z; + } + + // Expect 3 mutants: (x + y) > z, (x + y) < z, true + function not_equal_over_aor( + uint256 x, + uint256 y, + uint256 z + /// RelationalOperatorReplacement(`!=` |==> `>`) of: `return (x + y) != z;` + ) public pure returns (bool) { + return (x + y) > z; + } +} diff --git a/resources/regressions/all_ops.json/mutants/74/ROR/ROR.sol b/resources/regressions/all_ops.json/mutants/74/ROR/ROR.sol new file mode 100644 index 0000000..8488911 --- /dev/null +++ b/resources/regressions/all_ops.json/mutants/74/ROR/ROR.sol @@ -0,0 +1,65 @@ +// SPDX-License-Identifier: GPL-3.0-only +pragma solidity >0.7.0; +pragma experimental ABIEncoderV2; + +// This contract provides test functions for relational operator replacement (ROR) +contract ROR { + // Expect 3 mutants: x <= y, x != y, false + function less(uint256 x, uint256 y) public pure returns (bool) { + return x < y; + } + + // Expect 3 mutants: x < y, x == y, true + function less_equal(uint256 x, uint256 y) public pure returns (bool) { + return x <= y; + } + + // Expect 3 mutants: x >= y, x != y, false + function more(uint256 x, uint256 y) public pure returns (bool) { + return x > y; + } + + // Expect 3 mutants: x > y, x == y, true + function more_equal(uint256 x, uint256 y) public pure returns (bool) { + return x >= y; + } + + // Expect 3 mutants: x >= y, x <= y, false + function equal_ord(uint256 x, uint256 y) public pure returns (bool) { + return x == y; + } + + // Expect 2 mutants: true, false + function equal_not_ord(bool x, bool y) public pure returns (bool) { + return x == y; + } + + // Expect 3 mutants: x > y, x < y, true + function not_equal_ord(uint256 x, uint256 y) public pure returns (bool) { + return x != y; + } + + // Expect 2 mutants: true, false + function not_equal_not_ord(bool x, bool y) public pure returns (bool) { + return x != y; + } + + // Expect 3 mutants: (x + y) > z, (x + y) == z, true + function more_equal_over_aor( + uint256 x, + uint256 y, + uint256 z + ) public pure returns (bool) { + return (x + y) >= z; + } + + // Expect 3 mutants: (x + y) > z, (x + y) < z, true + function not_equal_over_aor( + uint256 x, + uint256 y, + uint256 z + /// RelationalOperatorReplacement(`(x + y) != z` |==> `true`) of: `return (x + y) != z;` + ) public pure returns (bool) { + return true; + } +} diff --git a/resources/regressions/all_ops.json/mutants/75/UOR/UOR.sol b/resources/regressions/all_ops.json/mutants/75/UOR/UOR.sol new file mode 100644 index 0000000..50d0957 --- /dev/null +++ b/resources/regressions/all_ops.json/mutants/75/UOR/UOR.sol @@ -0,0 +1,22 @@ +// SPDX-License-Identifier: GPL-3.0-only +pragma solidity >0.7.0; +pragma experimental ABIEncoderV2; + +// Unary Operator Replacement +contract UOR { + // Expect no mutants: cannot negate an unsigned integer + function unsigned_bw_not(uint256 x) public pure returns (uint256) { + return ~x; + } + + // Expect a single mutant: -x + /// UnaryOperatorReplacement(`~` |==> `-`) of: `return ~x;` + function signed_bw_not(int256 x) public pure returns (int256) { + return -x; + } + + // Expect a single mutant: ~x + function signed_neg(int256 x) public pure returns (int256) { + return -x; + } +} diff --git a/resources/regressions/all_ops.json/mutants/76/UOR/UOR.sol b/resources/regressions/all_ops.json/mutants/76/UOR/UOR.sol new file mode 100644 index 0000000..84eae0c --- /dev/null +++ b/resources/regressions/all_ops.json/mutants/76/UOR/UOR.sol @@ -0,0 +1,22 @@ +// SPDX-License-Identifier: GPL-3.0-only +pragma solidity >0.7.0; +pragma experimental ABIEncoderV2; + +// Unary Operator Replacement +contract UOR { + // Expect no mutants: cannot negate an unsigned integer + function unsigned_bw_not(uint256 x) public pure returns (uint256) { + return ~x; + } + + // Expect a single mutant: -x + function signed_bw_not(int256 x) public pure returns (int256) { + return ~x; + } + + // Expect a single mutant: ~x + /// UnaryOperatorReplacement(`-` |==> `~`) of: `return -x;` + function signed_neg(int256 x) public pure returns (int256) { + return ~x; + } +} diff --git a/resources/regressions/all_ops.json/mutants/8/AOR/AOR.sol b/resources/regressions/all_ops.json/mutants/8/AOR/AOR.sol new file mode 100644 index 0000000..bd874f1 --- /dev/null +++ b/resources/regressions/all_ops.json/mutants/8/AOR/AOR.sol @@ -0,0 +1,61 @@ +// SPDX-License-Identifier: GPL-3.0-only +pragma solidity >0.7.0; +pragma experimental ABIEncoderV2; + +// This contract provides test functions for Arithmetic operator replacement +contract AOR { + // Expect 4 mutants: + // a - b + // a * b + // a / b + // a % b + function plus(int256 a, int256 b) public pure returns (int256) { + return a + b; + } + + // Expect 4 mutants: + // a + b + // a * b + // a / b + // a % b + /// ArithmeticOperatorReplacement(`-` |==> `%`) of: `return a - b;` + function minus(int256 a, int256 b) public pure returns (int256) { + return a % b; + } + + // Expect 4 mutants: + // a - b + // a * b + // a / b + // a % b + function times_with_parens( + int256 a, + int256 b + ) public pure returns (int256) { + return ((a)) * b; + } + + // Expect 5 mutants: + // a + b + // a - b + // a / b + // a ** b + // a % b + function unsigned_times_with_parens( + uint256 a, + uint256 b + ) public pure returns (uint256) { + return ((a)) * b; + } + + // Expect 5 mutants: + // a + b + // a - b + // a / b + // a * b + // a % b + + function power(uint256 a, uint256 b) public pure returns (uint256) { + return a ** b; + } +} diff --git a/resources/regressions/all_ops.json/mutants/9/AOR/AOR.sol b/resources/regressions/all_ops.json/mutants/9/AOR/AOR.sol new file mode 100644 index 0000000..5d9ca89 --- /dev/null +++ b/resources/regressions/all_ops.json/mutants/9/AOR/AOR.sol @@ -0,0 +1,61 @@ +// SPDX-License-Identifier: GPL-3.0-only +pragma solidity >0.7.0; +pragma experimental ABIEncoderV2; + +// This contract provides test functions for Arithmetic operator replacement +contract AOR { + // Expect 4 mutants: + // a - b + // a * b + // a / b + // a % b + function plus(int256 a, int256 b) public pure returns (int256) { + return a + b; + } + + // Expect 4 mutants: + // a + b + // a * b + // a / b + // a % b + function minus(int256 a, int256 b) public pure returns (int256) { + return a - b; + } + + // Expect 4 mutants: + // a - b + // a * b + // a / b + // a % b + function times_with_parens( + int256 a, + int256 b + /// ArithmeticOperatorReplacement(`*` |==> `+`) of: `return ((a)) * b;` + ) public pure returns (int256) { + return ((a)) + b; + } + + // Expect 5 mutants: + // a + b + // a - b + // a / b + // a ** b + // a % b + function unsigned_times_with_parens( + uint256 a, + uint256 b + ) public pure returns (uint256) { + return ((a)) * b; + } + + // Expect 5 mutants: + // a + b + // a - b + // a / b + // a * b + // a % b + + function power(uint256 a, uint256 b) public pure returns (uint256) { + return a ** b; + } +} diff --git a/resources/regressions/aor.json/gambit_results.json b/resources/regressions/aor.json/gambit_results.json new file mode 100644 index 0000000..db4270f --- /dev/null +++ b/resources/regressions/aor.json/gambit_results.json @@ -0,0 +1,266 @@ +[ + { + "col": 18, + "description": "ArithmeticOperatorReplacement", + "diff": "--- original\n+++ mutant\n@@ -9,8 +9,9 @@\n // a * b\n // a / b\n // a % b\n+ /// ArithmeticOperatorReplacement(`+` |==> `-`) of: `return a + b;`\n function plus(int256 a, int256 b) public pure returns (int256) {\n- return a + b;\n+ return a - b;\n }\n \n // Expect 4 mutants:\n", + "id": "1", + "line": 13, + "name": "mutants/1/Ops/AOR/AOR.sol", + "op": "AOR", + "orig": "+", + "original": "Ops/AOR/AOR.sol", + "repl": "-" + }, + { + "col": 18, + "description": "ArithmeticOperatorReplacement", + "diff": "--- original\n+++ mutant\n@@ -9,8 +9,9 @@\n // a * b\n // a / b\n // a % b\n+ /// ArithmeticOperatorReplacement(`+` |==> `*`) of: `return a + b;`\n function plus(int256 a, int256 b) public pure returns (int256) {\n- return a + b;\n+ return a * b;\n }\n \n // Expect 4 mutants:\n", + "id": "2", + "line": 13, + "name": "mutants/2/Ops/AOR/AOR.sol", + "op": "AOR", + "orig": "+", + "original": "Ops/AOR/AOR.sol", + "repl": "*" + }, + { + "col": 18, + "description": "ArithmeticOperatorReplacement", + "diff": "--- original\n+++ mutant\n@@ -9,8 +9,9 @@\n // a * b\n // a / b\n // a % b\n+ /// ArithmeticOperatorReplacement(`+` |==> `/`) of: `return a + b;`\n function plus(int256 a, int256 b) public pure returns (int256) {\n- return a + b;\n+ return a / b;\n }\n \n // Expect 4 mutants:\n", + "id": "3", + "line": 13, + "name": "mutants/3/Ops/AOR/AOR.sol", + "op": "AOR", + "orig": "+", + "original": "Ops/AOR/AOR.sol", + "repl": "/" + }, + { + "col": 18, + "description": "ArithmeticOperatorReplacement", + "diff": "--- original\n+++ mutant\n@@ -9,8 +9,9 @@\n // a * b\n // a / b\n // a % b\n+ /// ArithmeticOperatorReplacement(`+` |==> `%`) of: `return a + b;`\n function plus(int256 a, int256 b) public pure returns (int256) {\n- return a + b;\n+ return a % b;\n }\n \n // Expect 4 mutants:\n", + "id": "4", + "line": 13, + "name": "mutants/4/Ops/AOR/AOR.sol", + "op": "AOR", + "orig": "+", + "original": "Ops/AOR/AOR.sol", + "repl": "%" + }, + { + "col": 18, + "description": "ArithmeticOperatorReplacement", + "diff": "--- original\n+++ mutant\n@@ -18,8 +18,9 @@\n // a * b\n // a / b\n // a % b\n+ /// ArithmeticOperatorReplacement(`-` |==> `+`) of: `return a - b;`\n function minus(int256 a, int256 b) public pure returns (int256) {\n- return a - b;\n+ return a + b;\n }\n \n // Expect 4 mutants:\n", + "id": "5", + "line": 22, + "name": "mutants/5/Ops/AOR/AOR.sol", + "op": "AOR", + "orig": "-", + "original": "Ops/AOR/AOR.sol", + "repl": "+" + }, + { + "col": 18, + "description": "ArithmeticOperatorReplacement", + "diff": "--- original\n+++ mutant\n@@ -18,8 +18,9 @@\n // a * b\n // a / b\n // a % b\n+ /// ArithmeticOperatorReplacement(`-` |==> `*`) of: `return a - b;`\n function minus(int256 a, int256 b) public pure returns (int256) {\n- return a - b;\n+ return a * b;\n }\n \n // Expect 4 mutants:\n", + "id": "6", + "line": 22, + "name": "mutants/6/Ops/AOR/AOR.sol", + "op": "AOR", + "orig": "-", + "original": "Ops/AOR/AOR.sol", + "repl": "*" + }, + { + "col": 18, + "description": "ArithmeticOperatorReplacement", + "diff": "--- original\n+++ mutant\n@@ -18,8 +18,9 @@\n // a * b\n // a / b\n // a % b\n+ /// ArithmeticOperatorReplacement(`-` |==> `/`) of: `return a - b;`\n function minus(int256 a, int256 b) public pure returns (int256) {\n- return a - b;\n+ return a / b;\n }\n \n // Expect 4 mutants:\n", + "id": "7", + "line": 22, + "name": "mutants/7/Ops/AOR/AOR.sol", + "op": "AOR", + "orig": "-", + "original": "Ops/AOR/AOR.sol", + "repl": "/" + }, + { + "col": 18, + "description": "ArithmeticOperatorReplacement", + "diff": "--- original\n+++ mutant\n@@ -18,8 +18,9 @@\n // a * b\n // a / b\n // a % b\n+ /// ArithmeticOperatorReplacement(`-` |==> `%`) of: `return a - b;`\n function minus(int256 a, int256 b) public pure returns (int256) {\n- return a - b;\n+ return a % b;\n }\n \n // Expect 4 mutants:\n", + "id": "8", + "line": 22, + "name": "mutants/8/Ops/AOR/AOR.sol", + "op": "AOR", + "orig": "-", + "original": "Ops/AOR/AOR.sol", + "repl": "%" + }, + { + "col": 22, + "description": "ArithmeticOperatorReplacement", + "diff": "--- original\n+++ mutant\n@@ -30,8 +30,9 @@\n function times_with_parens(\n int256 a,\n int256 b\n+ /// ArithmeticOperatorReplacement(`*` |==> `+`) of: `return ((a)) * b;`\n ) public pure returns (int256) {\n- return ((a)) * b;\n+ return ((a)) + b;\n }\n \n // Expect 5 mutants:\n", + "id": "9", + "line": 34, + "name": "mutants/9/Ops/AOR/AOR.sol", + "op": "AOR", + "orig": "*", + "original": "Ops/AOR/AOR.sol", + "repl": "+" + }, + { + "col": 22, + "description": "ArithmeticOperatorReplacement", + "diff": "--- original\n+++ mutant\n@@ -30,8 +30,9 @@\n function times_with_parens(\n int256 a,\n int256 b\n+ /// ArithmeticOperatorReplacement(`*` |==> `-`) of: `return ((a)) * b;`\n ) public pure returns (int256) {\n- return ((a)) * b;\n+ return ((a)) - b;\n }\n \n // Expect 5 mutants:\n", + "id": "10", + "line": 34, + "name": "mutants/10/Ops/AOR/AOR.sol", + "op": "AOR", + "orig": "*", + "original": "Ops/AOR/AOR.sol", + "repl": "-" + }, + { + "col": 22, + "description": "ArithmeticOperatorReplacement", + "diff": "--- original\n+++ mutant\n@@ -30,8 +30,9 @@\n function times_with_parens(\n int256 a,\n int256 b\n+ /// ArithmeticOperatorReplacement(`*` |==> `/`) of: `return ((a)) * b;`\n ) public pure returns (int256) {\n- return ((a)) * b;\n+ return ((a)) / b;\n }\n \n // Expect 5 mutants:\n", + "id": "11", + "line": 34, + "name": "mutants/11/Ops/AOR/AOR.sol", + "op": "AOR", + "orig": "*", + "original": "Ops/AOR/AOR.sol", + "repl": "/" + }, + { + "col": 22, + "description": "ArithmeticOperatorReplacement", + "diff": "--- original\n+++ mutant\n@@ -30,8 +30,9 @@\n function times_with_parens(\n int256 a,\n int256 b\n+ /// ArithmeticOperatorReplacement(`*` |==> `%`) of: `return ((a)) * b;`\n ) public pure returns (int256) {\n- return ((a)) * b;\n+ return ((a)) % b;\n }\n \n // Expect 5 mutants:\n", + "id": "12", + "line": 34, + "name": "mutants/12/Ops/AOR/AOR.sol", + "op": "AOR", + "orig": "*", + "original": "Ops/AOR/AOR.sol", + "repl": "%" + }, + { + "col": 22, + "description": "ArithmeticOperatorReplacement", + "diff": "--- original\n+++ mutant\n@@ -43,8 +43,9 @@\n function unsigned_times_with_parens(\n uint256 a,\n uint256 b\n+ /// ArithmeticOperatorReplacement(`*` |==> `+`) of: `return ((a)) * b;`\n ) public pure returns (uint256) {\n- return ((a)) * b;\n+ return ((a)) + b;\n }\n \n // Expect 5 mutants:\n", + "id": "13", + "line": 47, + "name": "mutants/13/Ops/AOR/AOR.sol", + "op": "AOR", + "orig": "*", + "original": "Ops/AOR/AOR.sol", + "repl": "+" + }, + { + "col": 22, + "description": "ArithmeticOperatorReplacement", + "diff": "--- original\n+++ mutant\n@@ -43,8 +43,9 @@\n function unsigned_times_with_parens(\n uint256 a,\n uint256 b\n+ /// ArithmeticOperatorReplacement(`*` |==> `-`) of: `return ((a)) * b;`\n ) public pure returns (uint256) {\n- return ((a)) * b;\n+ return ((a)) - b;\n }\n \n // Expect 5 mutants:\n", + "id": "14", + "line": 47, + "name": "mutants/14/Ops/AOR/AOR.sol", + "op": "AOR", + "orig": "*", + "original": "Ops/AOR/AOR.sol", + "repl": "-" + }, + { + "col": 22, + "description": "ArithmeticOperatorReplacement", + "diff": "--- original\n+++ mutant\n@@ -43,8 +43,9 @@\n function unsigned_times_with_parens(\n uint256 a,\n uint256 b\n+ /// ArithmeticOperatorReplacement(`*` |==> `/`) of: `return ((a)) * b;`\n ) public pure returns (uint256) {\n- return ((a)) * b;\n+ return ((a)) / b;\n }\n \n // Expect 5 mutants:\n", + "id": "15", + "line": 47, + "name": "mutants/15/Ops/AOR/AOR.sol", + "op": "AOR", + "orig": "*", + "original": "Ops/AOR/AOR.sol", + "repl": "/" + }, + { + "col": 22, + "description": "ArithmeticOperatorReplacement", + "diff": "--- original\n+++ mutant\n@@ -43,8 +43,9 @@\n function unsigned_times_with_parens(\n uint256 a,\n uint256 b\n+ /// ArithmeticOperatorReplacement(`*` |==> `**`) of: `return ((a)) * b;`\n ) public pure returns (uint256) {\n- return ((a)) * b;\n+ return ((a)) ** b;\n }\n \n // Expect 5 mutants:\n", + "id": "16", + "line": 47, + "name": "mutants/16/Ops/AOR/AOR.sol", + "op": "AOR", + "orig": "*", + "original": "Ops/AOR/AOR.sol", + "repl": "**" + }, + { + "col": 22, + "description": "ArithmeticOperatorReplacement", + "diff": "--- original\n+++ mutant\n@@ -43,8 +43,9 @@\n function unsigned_times_with_parens(\n uint256 a,\n uint256 b\n+ /// ArithmeticOperatorReplacement(`*` |==> `%`) of: `return ((a)) * b;`\n ) public pure returns (uint256) {\n- return ((a)) * b;\n+ return ((a)) % b;\n }\n \n // Expect 5 mutants:\n", + "id": "17", + "line": 47, + "name": "mutants/17/Ops/AOR/AOR.sol", + "op": "AOR", + "orig": "*", + "original": "Ops/AOR/AOR.sol", + "repl": "%" + }, + { + "col": 18, + "description": "ArithmeticOperatorReplacement", + "diff": "--- original\n+++ mutant\n@@ -54,7 +54,8 @@\n // a * b\n // a % b\n \n+ /// ArithmeticOperatorReplacement(`**` |==> `+`) of: `return a ** b;`\n function power(uint256 a, uint256 b) public pure returns (uint256) {\n- return a ** b;\n+ return a + b;\n }\n }\n", + "id": "18", + "line": 58, + "name": "mutants/18/Ops/AOR/AOR.sol", + "op": "AOR", + "orig": "**", + "original": "Ops/AOR/AOR.sol", + "repl": "+" + }, + { + "col": 18, + "description": "ArithmeticOperatorReplacement", + "diff": "--- original\n+++ mutant\n@@ -54,7 +54,8 @@\n // a * b\n // a % b\n \n+ /// ArithmeticOperatorReplacement(`**` |==> `-`) of: `return a ** b;`\n function power(uint256 a, uint256 b) public pure returns (uint256) {\n- return a ** b;\n+ return a - b;\n }\n }\n", + "id": "19", + "line": 58, + "name": "mutants/19/Ops/AOR/AOR.sol", + "op": "AOR", + "orig": "**", + "original": "Ops/AOR/AOR.sol", + "repl": "-" + }, + { + "col": 18, + "description": "ArithmeticOperatorReplacement", + "diff": "--- original\n+++ mutant\n@@ -54,7 +54,8 @@\n // a * b\n // a % b\n \n+ /// ArithmeticOperatorReplacement(`**` |==> `*`) of: `return a ** b;`\n function power(uint256 a, uint256 b) public pure returns (uint256) {\n- return a ** b;\n+ return a * b;\n }\n }\n", + "id": "20", + "line": 58, + "name": "mutants/20/Ops/AOR/AOR.sol", + "op": "AOR", + "orig": "**", + "original": "Ops/AOR/AOR.sol", + "repl": "*" + }, + { + "col": 18, + "description": "ArithmeticOperatorReplacement", + "diff": "--- original\n+++ mutant\n@@ -54,7 +54,8 @@\n // a * b\n // a % b\n \n+ /// ArithmeticOperatorReplacement(`**` |==> `/`) of: `return a ** b;`\n function power(uint256 a, uint256 b) public pure returns (uint256) {\n- return a ** b;\n+ return a / b;\n }\n }\n", + "id": "21", + "line": 58, + "name": "mutants/21/Ops/AOR/AOR.sol", + "op": "AOR", + "orig": "**", + "original": "Ops/AOR/AOR.sol", + "repl": "/" + }, + { + "col": 18, + "description": "ArithmeticOperatorReplacement", + "diff": "--- original\n+++ mutant\n@@ -54,7 +54,8 @@\n // a * b\n // a % b\n \n+ /// ArithmeticOperatorReplacement(`**` |==> `%`) of: `return a ** b;`\n function power(uint256 a, uint256 b) public pure returns (uint256) {\n- return a ** b;\n+ return a % b;\n }\n }\n", + "id": "22", + "line": 58, + "name": "mutants/22/Ops/AOR/AOR.sol", + "op": "AOR", + "orig": "**", + "original": "Ops/AOR/AOR.sol", + "repl": "%" + } +] \ No newline at end of file diff --git a/resources/regressions/aor.json/mutants.log b/resources/regressions/aor.json/mutants.log new file mode 100644 index 0000000..ee12562 --- /dev/null +++ b/resources/regressions/aor.json/mutants.log @@ -0,0 +1,22 @@ +1,AOR,Ops/AOR/AOR.sol,13:18,+,- +2,AOR,Ops/AOR/AOR.sol,13:18,+,* +3,AOR,Ops/AOR/AOR.sol,13:18,+,/ +4,AOR,Ops/AOR/AOR.sol,13:18,+,% +5,AOR,Ops/AOR/AOR.sol,22:18,-,+ +6,AOR,Ops/AOR/AOR.sol,22:18,-,* +7,AOR,Ops/AOR/AOR.sol,22:18,-,/ +8,AOR,Ops/AOR/AOR.sol,22:18,-,% +9,AOR,Ops/AOR/AOR.sol,34:22,*,+ +10,AOR,Ops/AOR/AOR.sol,34:22,*,- +11,AOR,Ops/AOR/AOR.sol,34:22,*,/ +12,AOR,Ops/AOR/AOR.sol,34:22,*,% +13,AOR,Ops/AOR/AOR.sol,47:22,*,+ +14,AOR,Ops/AOR/AOR.sol,47:22,*,- +15,AOR,Ops/AOR/AOR.sol,47:22,*,/ +16,AOR,Ops/AOR/AOR.sol,47:22,*,** +17,AOR,Ops/AOR/AOR.sol,47:22,*,% +18,AOR,Ops/AOR/AOR.sol,58:18,**,+ +19,AOR,Ops/AOR/AOR.sol,58:18,**,- +20,AOR,Ops/AOR/AOR.sol,58:18,**,* +21,AOR,Ops/AOR/AOR.sol,58:18,**,/ +22,AOR,Ops/AOR/AOR.sol,58:18,**,% diff --git a/resources/regressions/aor.json/mutants/1/Ops/AOR/AOR.sol b/resources/regressions/aor.json/mutants/1/Ops/AOR/AOR.sol new file mode 100644 index 0000000..9b516ff --- /dev/null +++ b/resources/regressions/aor.json/mutants/1/Ops/AOR/AOR.sol @@ -0,0 +1,61 @@ +// SPDX-License-Identifier: GPL-3.0-only +pragma solidity >0.7.0; +pragma experimental ABIEncoderV2; + +// This contract provides test functions for Arithmetic operator replacement +contract AOR { + // Expect 4 mutants: + // a - b + // a * b + // a / b + // a % b + /// ArithmeticOperatorReplacement(`+` |==> `-`) of: `return a + b;` + function plus(int256 a, int256 b) public pure returns (int256) { + return a - b; + } + + // Expect 4 mutants: + // a + b + // a * b + // a / b + // a % b + function minus(int256 a, int256 b) public pure returns (int256) { + return a - b; + } + + // Expect 4 mutants: + // a - b + // a * b + // a / b + // a % b + function times_with_parens( + int256 a, + int256 b + ) public pure returns (int256) { + return ((a)) * b; + } + + // Expect 5 mutants: + // a + b + // a - b + // a / b + // a ** b + // a % b + function unsigned_times_with_parens( + uint256 a, + uint256 b + ) public pure returns (uint256) { + return ((a)) * b; + } + + // Expect 5 mutants: + // a + b + // a - b + // a / b + // a * b + // a % b + + function power(uint256 a, uint256 b) public pure returns (uint256) { + return a ** b; + } +} diff --git a/resources/regressions/aor.json/mutants/10/Ops/AOR/AOR.sol b/resources/regressions/aor.json/mutants/10/Ops/AOR/AOR.sol new file mode 100644 index 0000000..c31b43f --- /dev/null +++ b/resources/regressions/aor.json/mutants/10/Ops/AOR/AOR.sol @@ -0,0 +1,61 @@ +// SPDX-License-Identifier: GPL-3.0-only +pragma solidity >0.7.0; +pragma experimental ABIEncoderV2; + +// This contract provides test functions for Arithmetic operator replacement +contract AOR { + // Expect 4 mutants: + // a - b + // a * b + // a / b + // a % b + function plus(int256 a, int256 b) public pure returns (int256) { + return a + b; + } + + // Expect 4 mutants: + // a + b + // a * b + // a / b + // a % b + function minus(int256 a, int256 b) public pure returns (int256) { + return a - b; + } + + // Expect 4 mutants: + // a - b + // a * b + // a / b + // a % b + function times_with_parens( + int256 a, + int256 b + /// ArithmeticOperatorReplacement(`*` |==> `-`) of: `return ((a)) * b;` + ) public pure returns (int256) { + return ((a)) - b; + } + + // Expect 5 mutants: + // a + b + // a - b + // a / b + // a ** b + // a % b + function unsigned_times_with_parens( + uint256 a, + uint256 b + ) public pure returns (uint256) { + return ((a)) * b; + } + + // Expect 5 mutants: + // a + b + // a - b + // a / b + // a * b + // a % b + + function power(uint256 a, uint256 b) public pure returns (uint256) { + return a ** b; + } +} diff --git a/resources/regressions/aor.json/mutants/11/Ops/AOR/AOR.sol b/resources/regressions/aor.json/mutants/11/Ops/AOR/AOR.sol new file mode 100644 index 0000000..823139e --- /dev/null +++ b/resources/regressions/aor.json/mutants/11/Ops/AOR/AOR.sol @@ -0,0 +1,61 @@ +// SPDX-License-Identifier: GPL-3.0-only +pragma solidity >0.7.0; +pragma experimental ABIEncoderV2; + +// This contract provides test functions for Arithmetic operator replacement +contract AOR { + // Expect 4 mutants: + // a - b + // a * b + // a / b + // a % b + function plus(int256 a, int256 b) public pure returns (int256) { + return a + b; + } + + // Expect 4 mutants: + // a + b + // a * b + // a / b + // a % b + function minus(int256 a, int256 b) public pure returns (int256) { + return a - b; + } + + // Expect 4 mutants: + // a - b + // a * b + // a / b + // a % b + function times_with_parens( + int256 a, + int256 b + /// ArithmeticOperatorReplacement(`*` |==> `/`) of: `return ((a)) * b;` + ) public pure returns (int256) { + return ((a)) / b; + } + + // Expect 5 mutants: + // a + b + // a - b + // a / b + // a ** b + // a % b + function unsigned_times_with_parens( + uint256 a, + uint256 b + ) public pure returns (uint256) { + return ((a)) * b; + } + + // Expect 5 mutants: + // a + b + // a - b + // a / b + // a * b + // a % b + + function power(uint256 a, uint256 b) public pure returns (uint256) { + return a ** b; + } +} diff --git a/resources/regressions/aor.json/mutants/12/Ops/AOR/AOR.sol b/resources/regressions/aor.json/mutants/12/Ops/AOR/AOR.sol new file mode 100644 index 0000000..aa4ecd0 --- /dev/null +++ b/resources/regressions/aor.json/mutants/12/Ops/AOR/AOR.sol @@ -0,0 +1,61 @@ +// SPDX-License-Identifier: GPL-3.0-only +pragma solidity >0.7.0; +pragma experimental ABIEncoderV2; + +// This contract provides test functions for Arithmetic operator replacement +contract AOR { + // Expect 4 mutants: + // a - b + // a * b + // a / b + // a % b + function plus(int256 a, int256 b) public pure returns (int256) { + return a + b; + } + + // Expect 4 mutants: + // a + b + // a * b + // a / b + // a % b + function minus(int256 a, int256 b) public pure returns (int256) { + return a - b; + } + + // Expect 4 mutants: + // a - b + // a * b + // a / b + // a % b + function times_with_parens( + int256 a, + int256 b + /// ArithmeticOperatorReplacement(`*` |==> `%`) of: `return ((a)) * b;` + ) public pure returns (int256) { + return ((a)) % b; + } + + // Expect 5 mutants: + // a + b + // a - b + // a / b + // a ** b + // a % b + function unsigned_times_with_parens( + uint256 a, + uint256 b + ) public pure returns (uint256) { + return ((a)) * b; + } + + // Expect 5 mutants: + // a + b + // a - b + // a / b + // a * b + // a % b + + function power(uint256 a, uint256 b) public pure returns (uint256) { + return a ** b; + } +} diff --git a/resources/regressions/aor.json/mutants/13/Ops/AOR/AOR.sol b/resources/regressions/aor.json/mutants/13/Ops/AOR/AOR.sol new file mode 100644 index 0000000..8666cef --- /dev/null +++ b/resources/regressions/aor.json/mutants/13/Ops/AOR/AOR.sol @@ -0,0 +1,61 @@ +// SPDX-License-Identifier: GPL-3.0-only +pragma solidity >0.7.0; +pragma experimental ABIEncoderV2; + +// This contract provides test functions for Arithmetic operator replacement +contract AOR { + // Expect 4 mutants: + // a - b + // a * b + // a / b + // a % b + function plus(int256 a, int256 b) public pure returns (int256) { + return a + b; + } + + // Expect 4 mutants: + // a + b + // a * b + // a / b + // a % b + function minus(int256 a, int256 b) public pure returns (int256) { + return a - b; + } + + // Expect 4 mutants: + // a - b + // a * b + // a / b + // a % b + function times_with_parens( + int256 a, + int256 b + ) public pure returns (int256) { + return ((a)) * b; + } + + // Expect 5 mutants: + // a + b + // a - b + // a / b + // a ** b + // a % b + function unsigned_times_with_parens( + uint256 a, + uint256 b + /// ArithmeticOperatorReplacement(`*` |==> `+`) of: `return ((a)) * b;` + ) public pure returns (uint256) { + return ((a)) + b; + } + + // Expect 5 mutants: + // a + b + // a - b + // a / b + // a * b + // a % b + + function power(uint256 a, uint256 b) public pure returns (uint256) { + return a ** b; + } +} diff --git a/resources/regressions/aor.json/mutants/14/Ops/AOR/AOR.sol b/resources/regressions/aor.json/mutants/14/Ops/AOR/AOR.sol new file mode 100644 index 0000000..4d3c74d --- /dev/null +++ b/resources/regressions/aor.json/mutants/14/Ops/AOR/AOR.sol @@ -0,0 +1,61 @@ +// SPDX-License-Identifier: GPL-3.0-only +pragma solidity >0.7.0; +pragma experimental ABIEncoderV2; + +// This contract provides test functions for Arithmetic operator replacement +contract AOR { + // Expect 4 mutants: + // a - b + // a * b + // a / b + // a % b + function plus(int256 a, int256 b) public pure returns (int256) { + return a + b; + } + + // Expect 4 mutants: + // a + b + // a * b + // a / b + // a % b + function minus(int256 a, int256 b) public pure returns (int256) { + return a - b; + } + + // Expect 4 mutants: + // a - b + // a * b + // a / b + // a % b + function times_with_parens( + int256 a, + int256 b + ) public pure returns (int256) { + return ((a)) * b; + } + + // Expect 5 mutants: + // a + b + // a - b + // a / b + // a ** b + // a % b + function unsigned_times_with_parens( + uint256 a, + uint256 b + /// ArithmeticOperatorReplacement(`*` |==> `-`) of: `return ((a)) * b;` + ) public pure returns (uint256) { + return ((a)) - b; + } + + // Expect 5 mutants: + // a + b + // a - b + // a / b + // a * b + // a % b + + function power(uint256 a, uint256 b) public pure returns (uint256) { + return a ** b; + } +} diff --git a/resources/regressions/aor.json/mutants/15/Ops/AOR/AOR.sol b/resources/regressions/aor.json/mutants/15/Ops/AOR/AOR.sol new file mode 100644 index 0000000..f9a4969 --- /dev/null +++ b/resources/regressions/aor.json/mutants/15/Ops/AOR/AOR.sol @@ -0,0 +1,61 @@ +// SPDX-License-Identifier: GPL-3.0-only +pragma solidity >0.7.0; +pragma experimental ABIEncoderV2; + +// This contract provides test functions for Arithmetic operator replacement +contract AOR { + // Expect 4 mutants: + // a - b + // a * b + // a / b + // a % b + function plus(int256 a, int256 b) public pure returns (int256) { + return a + b; + } + + // Expect 4 mutants: + // a + b + // a * b + // a / b + // a % b + function minus(int256 a, int256 b) public pure returns (int256) { + return a - b; + } + + // Expect 4 mutants: + // a - b + // a * b + // a / b + // a % b + function times_with_parens( + int256 a, + int256 b + ) public pure returns (int256) { + return ((a)) * b; + } + + // Expect 5 mutants: + // a + b + // a - b + // a / b + // a ** b + // a % b + function unsigned_times_with_parens( + uint256 a, + uint256 b + /// ArithmeticOperatorReplacement(`*` |==> `/`) of: `return ((a)) * b;` + ) public pure returns (uint256) { + return ((a)) / b; + } + + // Expect 5 mutants: + // a + b + // a - b + // a / b + // a * b + // a % b + + function power(uint256 a, uint256 b) public pure returns (uint256) { + return a ** b; + } +} diff --git a/resources/regressions/aor.json/mutants/16/Ops/AOR/AOR.sol b/resources/regressions/aor.json/mutants/16/Ops/AOR/AOR.sol new file mode 100644 index 0000000..3706f5c --- /dev/null +++ b/resources/regressions/aor.json/mutants/16/Ops/AOR/AOR.sol @@ -0,0 +1,61 @@ +// SPDX-License-Identifier: GPL-3.0-only +pragma solidity >0.7.0; +pragma experimental ABIEncoderV2; + +// This contract provides test functions for Arithmetic operator replacement +contract AOR { + // Expect 4 mutants: + // a - b + // a * b + // a / b + // a % b + function plus(int256 a, int256 b) public pure returns (int256) { + return a + b; + } + + // Expect 4 mutants: + // a + b + // a * b + // a / b + // a % b + function minus(int256 a, int256 b) public pure returns (int256) { + return a - b; + } + + // Expect 4 mutants: + // a - b + // a * b + // a / b + // a % b + function times_with_parens( + int256 a, + int256 b + ) public pure returns (int256) { + return ((a)) * b; + } + + // Expect 5 mutants: + // a + b + // a - b + // a / b + // a ** b + // a % b + function unsigned_times_with_parens( + uint256 a, + uint256 b + /// ArithmeticOperatorReplacement(`*` |==> `**`) of: `return ((a)) * b;` + ) public pure returns (uint256) { + return ((a)) ** b; + } + + // Expect 5 mutants: + // a + b + // a - b + // a / b + // a * b + // a % b + + function power(uint256 a, uint256 b) public pure returns (uint256) { + return a ** b; + } +} diff --git a/resources/regressions/aor.json/mutants/17/Ops/AOR/AOR.sol b/resources/regressions/aor.json/mutants/17/Ops/AOR/AOR.sol new file mode 100644 index 0000000..67aa6b3 --- /dev/null +++ b/resources/regressions/aor.json/mutants/17/Ops/AOR/AOR.sol @@ -0,0 +1,61 @@ +// SPDX-License-Identifier: GPL-3.0-only +pragma solidity >0.7.0; +pragma experimental ABIEncoderV2; + +// This contract provides test functions for Arithmetic operator replacement +contract AOR { + // Expect 4 mutants: + // a - b + // a * b + // a / b + // a % b + function plus(int256 a, int256 b) public pure returns (int256) { + return a + b; + } + + // Expect 4 mutants: + // a + b + // a * b + // a / b + // a % b + function minus(int256 a, int256 b) public pure returns (int256) { + return a - b; + } + + // Expect 4 mutants: + // a - b + // a * b + // a / b + // a % b + function times_with_parens( + int256 a, + int256 b + ) public pure returns (int256) { + return ((a)) * b; + } + + // Expect 5 mutants: + // a + b + // a - b + // a / b + // a ** b + // a % b + function unsigned_times_with_parens( + uint256 a, + uint256 b + /// ArithmeticOperatorReplacement(`*` |==> `%`) of: `return ((a)) * b;` + ) public pure returns (uint256) { + return ((a)) % b; + } + + // Expect 5 mutants: + // a + b + // a - b + // a / b + // a * b + // a % b + + function power(uint256 a, uint256 b) public pure returns (uint256) { + return a ** b; + } +} diff --git a/resources/regressions/aor.json/mutants/18/Ops/AOR/AOR.sol b/resources/regressions/aor.json/mutants/18/Ops/AOR/AOR.sol new file mode 100644 index 0000000..b577022 --- /dev/null +++ b/resources/regressions/aor.json/mutants/18/Ops/AOR/AOR.sol @@ -0,0 +1,61 @@ +// SPDX-License-Identifier: GPL-3.0-only +pragma solidity >0.7.0; +pragma experimental ABIEncoderV2; + +// This contract provides test functions for Arithmetic operator replacement +contract AOR { + // Expect 4 mutants: + // a - b + // a * b + // a / b + // a % b + function plus(int256 a, int256 b) public pure returns (int256) { + return a + b; + } + + // Expect 4 mutants: + // a + b + // a * b + // a / b + // a % b + function minus(int256 a, int256 b) public pure returns (int256) { + return a - b; + } + + // Expect 4 mutants: + // a - b + // a * b + // a / b + // a % b + function times_with_parens( + int256 a, + int256 b + ) public pure returns (int256) { + return ((a)) * b; + } + + // Expect 5 mutants: + // a + b + // a - b + // a / b + // a ** b + // a % b + function unsigned_times_with_parens( + uint256 a, + uint256 b + ) public pure returns (uint256) { + return ((a)) * b; + } + + // Expect 5 mutants: + // a + b + // a - b + // a / b + // a * b + // a % b + + /// ArithmeticOperatorReplacement(`**` |==> `+`) of: `return a ** b;` + function power(uint256 a, uint256 b) public pure returns (uint256) { + return a + b; + } +} diff --git a/resources/regressions/aor.json/mutants/19/Ops/AOR/AOR.sol b/resources/regressions/aor.json/mutants/19/Ops/AOR/AOR.sol new file mode 100644 index 0000000..fbde14d --- /dev/null +++ b/resources/regressions/aor.json/mutants/19/Ops/AOR/AOR.sol @@ -0,0 +1,61 @@ +// SPDX-License-Identifier: GPL-3.0-only +pragma solidity >0.7.0; +pragma experimental ABIEncoderV2; + +// This contract provides test functions for Arithmetic operator replacement +contract AOR { + // Expect 4 mutants: + // a - b + // a * b + // a / b + // a % b + function plus(int256 a, int256 b) public pure returns (int256) { + return a + b; + } + + // Expect 4 mutants: + // a + b + // a * b + // a / b + // a % b + function minus(int256 a, int256 b) public pure returns (int256) { + return a - b; + } + + // Expect 4 mutants: + // a - b + // a * b + // a / b + // a % b + function times_with_parens( + int256 a, + int256 b + ) public pure returns (int256) { + return ((a)) * b; + } + + // Expect 5 mutants: + // a + b + // a - b + // a / b + // a ** b + // a % b + function unsigned_times_with_parens( + uint256 a, + uint256 b + ) public pure returns (uint256) { + return ((a)) * b; + } + + // Expect 5 mutants: + // a + b + // a - b + // a / b + // a * b + // a % b + + /// ArithmeticOperatorReplacement(`**` |==> `-`) of: `return a ** b;` + function power(uint256 a, uint256 b) public pure returns (uint256) { + return a - b; + } +} diff --git a/resources/regressions/aor.json/mutants/2/Ops/AOR/AOR.sol b/resources/regressions/aor.json/mutants/2/Ops/AOR/AOR.sol new file mode 100644 index 0000000..2e38a56 --- /dev/null +++ b/resources/regressions/aor.json/mutants/2/Ops/AOR/AOR.sol @@ -0,0 +1,61 @@ +// SPDX-License-Identifier: GPL-3.0-only +pragma solidity >0.7.0; +pragma experimental ABIEncoderV2; + +// This contract provides test functions for Arithmetic operator replacement +contract AOR { + // Expect 4 mutants: + // a - b + // a * b + // a / b + // a % b + /// ArithmeticOperatorReplacement(`+` |==> `*`) of: `return a + b;` + function plus(int256 a, int256 b) public pure returns (int256) { + return a * b; + } + + // Expect 4 mutants: + // a + b + // a * b + // a / b + // a % b + function minus(int256 a, int256 b) public pure returns (int256) { + return a - b; + } + + // Expect 4 mutants: + // a - b + // a * b + // a / b + // a % b + function times_with_parens( + int256 a, + int256 b + ) public pure returns (int256) { + return ((a)) * b; + } + + // Expect 5 mutants: + // a + b + // a - b + // a / b + // a ** b + // a % b + function unsigned_times_with_parens( + uint256 a, + uint256 b + ) public pure returns (uint256) { + return ((a)) * b; + } + + // Expect 5 mutants: + // a + b + // a - b + // a / b + // a * b + // a % b + + function power(uint256 a, uint256 b) public pure returns (uint256) { + return a ** b; + } +} diff --git a/resources/regressions/aor.json/mutants/20/Ops/AOR/AOR.sol b/resources/regressions/aor.json/mutants/20/Ops/AOR/AOR.sol new file mode 100644 index 0000000..92cbf4d --- /dev/null +++ b/resources/regressions/aor.json/mutants/20/Ops/AOR/AOR.sol @@ -0,0 +1,61 @@ +// SPDX-License-Identifier: GPL-3.0-only +pragma solidity >0.7.0; +pragma experimental ABIEncoderV2; + +// This contract provides test functions for Arithmetic operator replacement +contract AOR { + // Expect 4 mutants: + // a - b + // a * b + // a / b + // a % b + function plus(int256 a, int256 b) public pure returns (int256) { + return a + b; + } + + // Expect 4 mutants: + // a + b + // a * b + // a / b + // a % b + function minus(int256 a, int256 b) public pure returns (int256) { + return a - b; + } + + // Expect 4 mutants: + // a - b + // a * b + // a / b + // a % b + function times_with_parens( + int256 a, + int256 b + ) public pure returns (int256) { + return ((a)) * b; + } + + // Expect 5 mutants: + // a + b + // a - b + // a / b + // a ** b + // a % b + function unsigned_times_with_parens( + uint256 a, + uint256 b + ) public pure returns (uint256) { + return ((a)) * b; + } + + // Expect 5 mutants: + // a + b + // a - b + // a / b + // a * b + // a % b + + /// ArithmeticOperatorReplacement(`**` |==> `*`) of: `return a ** b;` + function power(uint256 a, uint256 b) public pure returns (uint256) { + return a * b; + } +} diff --git a/resources/regressions/aor.json/mutants/21/Ops/AOR/AOR.sol b/resources/regressions/aor.json/mutants/21/Ops/AOR/AOR.sol new file mode 100644 index 0000000..e3c6067 --- /dev/null +++ b/resources/regressions/aor.json/mutants/21/Ops/AOR/AOR.sol @@ -0,0 +1,61 @@ +// SPDX-License-Identifier: GPL-3.0-only +pragma solidity >0.7.0; +pragma experimental ABIEncoderV2; + +// This contract provides test functions for Arithmetic operator replacement +contract AOR { + // Expect 4 mutants: + // a - b + // a * b + // a / b + // a % b + function plus(int256 a, int256 b) public pure returns (int256) { + return a + b; + } + + // Expect 4 mutants: + // a + b + // a * b + // a / b + // a % b + function minus(int256 a, int256 b) public pure returns (int256) { + return a - b; + } + + // Expect 4 mutants: + // a - b + // a * b + // a / b + // a % b + function times_with_parens( + int256 a, + int256 b + ) public pure returns (int256) { + return ((a)) * b; + } + + // Expect 5 mutants: + // a + b + // a - b + // a / b + // a ** b + // a % b + function unsigned_times_with_parens( + uint256 a, + uint256 b + ) public pure returns (uint256) { + return ((a)) * b; + } + + // Expect 5 mutants: + // a + b + // a - b + // a / b + // a * b + // a % b + + /// ArithmeticOperatorReplacement(`**` |==> `/`) of: `return a ** b;` + function power(uint256 a, uint256 b) public pure returns (uint256) { + return a / b; + } +} diff --git a/resources/regressions/aor.json/mutants/22/Ops/AOR/AOR.sol b/resources/regressions/aor.json/mutants/22/Ops/AOR/AOR.sol new file mode 100644 index 0000000..c63f66b --- /dev/null +++ b/resources/regressions/aor.json/mutants/22/Ops/AOR/AOR.sol @@ -0,0 +1,61 @@ +// SPDX-License-Identifier: GPL-3.0-only +pragma solidity >0.7.0; +pragma experimental ABIEncoderV2; + +// This contract provides test functions for Arithmetic operator replacement +contract AOR { + // Expect 4 mutants: + // a - b + // a * b + // a / b + // a % b + function plus(int256 a, int256 b) public pure returns (int256) { + return a + b; + } + + // Expect 4 mutants: + // a + b + // a * b + // a / b + // a % b + function minus(int256 a, int256 b) public pure returns (int256) { + return a - b; + } + + // Expect 4 mutants: + // a - b + // a * b + // a / b + // a % b + function times_with_parens( + int256 a, + int256 b + ) public pure returns (int256) { + return ((a)) * b; + } + + // Expect 5 mutants: + // a + b + // a - b + // a / b + // a ** b + // a % b + function unsigned_times_with_parens( + uint256 a, + uint256 b + ) public pure returns (uint256) { + return ((a)) * b; + } + + // Expect 5 mutants: + // a + b + // a - b + // a / b + // a * b + // a % b + + /// ArithmeticOperatorReplacement(`**` |==> `%`) of: `return a ** b;` + function power(uint256 a, uint256 b) public pure returns (uint256) { + return a % b; + } +} diff --git a/resources/regressions/aor.json/mutants/3/Ops/AOR/AOR.sol b/resources/regressions/aor.json/mutants/3/Ops/AOR/AOR.sol new file mode 100644 index 0000000..60a969d --- /dev/null +++ b/resources/regressions/aor.json/mutants/3/Ops/AOR/AOR.sol @@ -0,0 +1,61 @@ +// SPDX-License-Identifier: GPL-3.0-only +pragma solidity >0.7.0; +pragma experimental ABIEncoderV2; + +// This contract provides test functions for Arithmetic operator replacement +contract AOR { + // Expect 4 mutants: + // a - b + // a * b + // a / b + // a % b + /// ArithmeticOperatorReplacement(`+` |==> `/`) of: `return a + b;` + function plus(int256 a, int256 b) public pure returns (int256) { + return a / b; + } + + // Expect 4 mutants: + // a + b + // a * b + // a / b + // a % b + function minus(int256 a, int256 b) public pure returns (int256) { + return a - b; + } + + // Expect 4 mutants: + // a - b + // a * b + // a / b + // a % b + function times_with_parens( + int256 a, + int256 b + ) public pure returns (int256) { + return ((a)) * b; + } + + // Expect 5 mutants: + // a + b + // a - b + // a / b + // a ** b + // a % b + function unsigned_times_with_parens( + uint256 a, + uint256 b + ) public pure returns (uint256) { + return ((a)) * b; + } + + // Expect 5 mutants: + // a + b + // a - b + // a / b + // a * b + // a % b + + function power(uint256 a, uint256 b) public pure returns (uint256) { + return a ** b; + } +} diff --git a/resources/regressions/aor.json/mutants/4/Ops/AOR/AOR.sol b/resources/regressions/aor.json/mutants/4/Ops/AOR/AOR.sol new file mode 100644 index 0000000..61a8854 --- /dev/null +++ b/resources/regressions/aor.json/mutants/4/Ops/AOR/AOR.sol @@ -0,0 +1,61 @@ +// SPDX-License-Identifier: GPL-3.0-only +pragma solidity >0.7.0; +pragma experimental ABIEncoderV2; + +// This contract provides test functions for Arithmetic operator replacement +contract AOR { + // Expect 4 mutants: + // a - b + // a * b + // a / b + // a % b + /// ArithmeticOperatorReplacement(`+` |==> `%`) of: `return a + b;` + function plus(int256 a, int256 b) public pure returns (int256) { + return a % b; + } + + // Expect 4 mutants: + // a + b + // a * b + // a / b + // a % b + function minus(int256 a, int256 b) public pure returns (int256) { + return a - b; + } + + // Expect 4 mutants: + // a - b + // a * b + // a / b + // a % b + function times_with_parens( + int256 a, + int256 b + ) public pure returns (int256) { + return ((a)) * b; + } + + // Expect 5 mutants: + // a + b + // a - b + // a / b + // a ** b + // a % b + function unsigned_times_with_parens( + uint256 a, + uint256 b + ) public pure returns (uint256) { + return ((a)) * b; + } + + // Expect 5 mutants: + // a + b + // a - b + // a / b + // a * b + // a % b + + function power(uint256 a, uint256 b) public pure returns (uint256) { + return a ** b; + } +} diff --git a/resources/regressions/aor.json/mutants/5/Ops/AOR/AOR.sol b/resources/regressions/aor.json/mutants/5/Ops/AOR/AOR.sol new file mode 100644 index 0000000..60846bd --- /dev/null +++ b/resources/regressions/aor.json/mutants/5/Ops/AOR/AOR.sol @@ -0,0 +1,61 @@ +// SPDX-License-Identifier: GPL-3.0-only +pragma solidity >0.7.0; +pragma experimental ABIEncoderV2; + +// This contract provides test functions for Arithmetic operator replacement +contract AOR { + // Expect 4 mutants: + // a - b + // a * b + // a / b + // a % b + function plus(int256 a, int256 b) public pure returns (int256) { + return a + b; + } + + // Expect 4 mutants: + // a + b + // a * b + // a / b + // a % b + /// ArithmeticOperatorReplacement(`-` |==> `+`) of: `return a - b;` + function minus(int256 a, int256 b) public pure returns (int256) { + return a + b; + } + + // Expect 4 mutants: + // a - b + // a * b + // a / b + // a % b + function times_with_parens( + int256 a, + int256 b + ) public pure returns (int256) { + return ((a)) * b; + } + + // Expect 5 mutants: + // a + b + // a - b + // a / b + // a ** b + // a % b + function unsigned_times_with_parens( + uint256 a, + uint256 b + ) public pure returns (uint256) { + return ((a)) * b; + } + + // Expect 5 mutants: + // a + b + // a - b + // a / b + // a * b + // a % b + + function power(uint256 a, uint256 b) public pure returns (uint256) { + return a ** b; + } +} diff --git a/resources/regressions/aor.json/mutants/6/Ops/AOR/AOR.sol b/resources/regressions/aor.json/mutants/6/Ops/AOR/AOR.sol new file mode 100644 index 0000000..2ca17b1 --- /dev/null +++ b/resources/regressions/aor.json/mutants/6/Ops/AOR/AOR.sol @@ -0,0 +1,61 @@ +// SPDX-License-Identifier: GPL-3.0-only +pragma solidity >0.7.0; +pragma experimental ABIEncoderV2; + +// This contract provides test functions for Arithmetic operator replacement +contract AOR { + // Expect 4 mutants: + // a - b + // a * b + // a / b + // a % b + function plus(int256 a, int256 b) public pure returns (int256) { + return a + b; + } + + // Expect 4 mutants: + // a + b + // a * b + // a / b + // a % b + /// ArithmeticOperatorReplacement(`-` |==> `*`) of: `return a - b;` + function minus(int256 a, int256 b) public pure returns (int256) { + return a * b; + } + + // Expect 4 mutants: + // a - b + // a * b + // a / b + // a % b + function times_with_parens( + int256 a, + int256 b + ) public pure returns (int256) { + return ((a)) * b; + } + + // Expect 5 mutants: + // a + b + // a - b + // a / b + // a ** b + // a % b + function unsigned_times_with_parens( + uint256 a, + uint256 b + ) public pure returns (uint256) { + return ((a)) * b; + } + + // Expect 5 mutants: + // a + b + // a - b + // a / b + // a * b + // a % b + + function power(uint256 a, uint256 b) public pure returns (uint256) { + return a ** b; + } +} diff --git a/resources/regressions/aor.json/mutants/7/Ops/AOR/AOR.sol b/resources/regressions/aor.json/mutants/7/Ops/AOR/AOR.sol new file mode 100644 index 0000000..c07a6ae --- /dev/null +++ b/resources/regressions/aor.json/mutants/7/Ops/AOR/AOR.sol @@ -0,0 +1,61 @@ +// SPDX-License-Identifier: GPL-3.0-only +pragma solidity >0.7.0; +pragma experimental ABIEncoderV2; + +// This contract provides test functions for Arithmetic operator replacement +contract AOR { + // Expect 4 mutants: + // a - b + // a * b + // a / b + // a % b + function plus(int256 a, int256 b) public pure returns (int256) { + return a + b; + } + + // Expect 4 mutants: + // a + b + // a * b + // a / b + // a % b + /// ArithmeticOperatorReplacement(`-` |==> `/`) of: `return a - b;` + function minus(int256 a, int256 b) public pure returns (int256) { + return a / b; + } + + // Expect 4 mutants: + // a - b + // a * b + // a / b + // a % b + function times_with_parens( + int256 a, + int256 b + ) public pure returns (int256) { + return ((a)) * b; + } + + // Expect 5 mutants: + // a + b + // a - b + // a / b + // a ** b + // a % b + function unsigned_times_with_parens( + uint256 a, + uint256 b + ) public pure returns (uint256) { + return ((a)) * b; + } + + // Expect 5 mutants: + // a + b + // a - b + // a / b + // a * b + // a % b + + function power(uint256 a, uint256 b) public pure returns (uint256) { + return a ** b; + } +} diff --git a/resources/regressions/aor.json/mutants/8/Ops/AOR/AOR.sol b/resources/regressions/aor.json/mutants/8/Ops/AOR/AOR.sol new file mode 100644 index 0000000..bd874f1 --- /dev/null +++ b/resources/regressions/aor.json/mutants/8/Ops/AOR/AOR.sol @@ -0,0 +1,61 @@ +// SPDX-License-Identifier: GPL-3.0-only +pragma solidity >0.7.0; +pragma experimental ABIEncoderV2; + +// This contract provides test functions for Arithmetic operator replacement +contract AOR { + // Expect 4 mutants: + // a - b + // a * b + // a / b + // a % b + function plus(int256 a, int256 b) public pure returns (int256) { + return a + b; + } + + // Expect 4 mutants: + // a + b + // a * b + // a / b + // a % b + /// ArithmeticOperatorReplacement(`-` |==> `%`) of: `return a - b;` + function minus(int256 a, int256 b) public pure returns (int256) { + return a % b; + } + + // Expect 4 mutants: + // a - b + // a * b + // a / b + // a % b + function times_with_parens( + int256 a, + int256 b + ) public pure returns (int256) { + return ((a)) * b; + } + + // Expect 5 mutants: + // a + b + // a - b + // a / b + // a ** b + // a % b + function unsigned_times_with_parens( + uint256 a, + uint256 b + ) public pure returns (uint256) { + return ((a)) * b; + } + + // Expect 5 mutants: + // a + b + // a - b + // a / b + // a * b + // a % b + + function power(uint256 a, uint256 b) public pure returns (uint256) { + return a ** b; + } +} diff --git a/resources/regressions/aor.json/mutants/9/Ops/AOR/AOR.sol b/resources/regressions/aor.json/mutants/9/Ops/AOR/AOR.sol new file mode 100644 index 0000000..5d9ca89 --- /dev/null +++ b/resources/regressions/aor.json/mutants/9/Ops/AOR/AOR.sol @@ -0,0 +1,61 @@ +// SPDX-License-Identifier: GPL-3.0-only +pragma solidity >0.7.0; +pragma experimental ABIEncoderV2; + +// This contract provides test functions for Arithmetic operator replacement +contract AOR { + // Expect 4 mutants: + // a - b + // a * b + // a / b + // a % b + function plus(int256 a, int256 b) public pure returns (int256) { + return a + b; + } + + // Expect 4 mutants: + // a + b + // a * b + // a / b + // a % b + function minus(int256 a, int256 b) public pure returns (int256) { + return a - b; + } + + // Expect 4 mutants: + // a - b + // a * b + // a / b + // a % b + function times_with_parens( + int256 a, + int256 b + /// ArithmeticOperatorReplacement(`*` |==> `+`) of: `return ((a)) * b;` + ) public pure returns (int256) { + return ((a)) + b; + } + + // Expect 5 mutants: + // a + b + // a - b + // a / b + // a ** b + // a % b + function unsigned_times_with_parens( + uint256 a, + uint256 b + ) public pure returns (uint256) { + return ((a)) * b; + } + + // Expect 5 mutants: + // a + b + // a - b + // a / b + // a * b + // a % b + + function power(uint256 a, uint256 b) public pure returns (uint256) { + return a ** b; + } +} diff --git a/resources/regressions/bor.json/gambit_results.json b/resources/regressions/bor.json/gambit_results.json new file mode 100644 index 0000000..7a0e4c8 --- /dev/null +++ b/resources/regressions/bor.json/gambit_results.json @@ -0,0 +1,38 @@ +[ + { + "col": 18, + "description": "ConditionalOperatorReplacement", + "diff": "--- original\n+++ mutant\n@@ -6,8 +6,9 @@\n contract BOR {\n // Expect 1 mutants:\n // a & b;\n+ /// ConditionalOperatorReplacement(`|` |==> `&`) of: `return a | b;`\n function bw_or(int256 a, int256 b) public pure returns (int256) {\n- return a | b;\n+ return a & b;\n }\n \n // Expect 1 mutants:\n", + "id": "1", + "line": 10, + "name": "mutants/1/Ops/BOR/BOR.sol", + "op": "BOR", + "orig": "|", + "original": "Ops/BOR/BOR.sol", + "repl": "&" + }, + { + "col": 18, + "description": "ConditionalOperatorReplacement", + "diff": "--- original\n+++ mutant\n@@ -12,8 +12,9 @@\n \n // Expect 1 mutants:\n // a | b;\n+ /// ConditionalOperatorReplacement(`&` |==> `|`) of: `return a & b;`\n function bw_and(int256 a, int256 b) public pure returns (int256) {\n- return a & b;\n+ return a | b;\n }\n \n // Expect 1 mutants:\n", + "id": "2", + "line": 16, + "name": "mutants/2/Ops/BOR/BOR.sol", + "op": "BOR", + "orig": "&", + "original": "Ops/BOR/BOR.sol", + "repl": "|" + }, + { + "col": 18, + "description": "ConditionalOperatorReplacement", + "diff": "--- original\n+++ mutant\n@@ -18,7 +18,8 @@\n \n // Expect 1 mutants:\n // a | b;\n+ /// ConditionalOperatorReplacement(`^` |==> `&`) of: `return a ^ b;`\n function bw_xor(int256 a, int256 b) public pure returns (int256) {\n- return a ^ b;\n+ return a & b;\n }\n }\n", + "id": "3", + "line": 22, + "name": "mutants/3/Ops/BOR/BOR.sol", + "op": "BOR", + "orig": "^", + "original": "Ops/BOR/BOR.sol", + "repl": "&" + } +] \ No newline at end of file diff --git a/resources/regressions/bor.json/mutants.log b/resources/regressions/bor.json/mutants.log new file mode 100644 index 0000000..f91f416 --- /dev/null +++ b/resources/regressions/bor.json/mutants.log @@ -0,0 +1,3 @@ +1,BOR,Ops/BOR/BOR.sol,10:18,|,& +2,BOR,Ops/BOR/BOR.sol,16:18,&,| +3,BOR,Ops/BOR/BOR.sol,22:18,^,& diff --git a/resources/regressions/bor.json/mutants/1/Ops/BOR/BOR.sol b/resources/regressions/bor.json/mutants/1/Ops/BOR/BOR.sol new file mode 100644 index 0000000..34a280f --- /dev/null +++ b/resources/regressions/bor.json/mutants/1/Ops/BOR/BOR.sol @@ -0,0 +1,25 @@ +// SPDX-License-Identifier: GPL-3.0-only +pragma solidity >0.7.0; +pragma experimental ABIEncoderV2; + +// This contract provides test functions for Bitwise Operator Replacement (BOR) +contract BOR { + // Expect 1 mutants: + // a & b; + /// ConditionalOperatorReplacement(`|` |==> `&`) of: `return a | b;` + function bw_or(int256 a, int256 b) public pure returns (int256) { + return a & b; + } + + // Expect 1 mutants: + // a | b; + function bw_and(int256 a, int256 b) public pure returns (int256) { + return a & b; + } + + // Expect 1 mutants: + // a | b; + function bw_xor(int256 a, int256 b) public pure returns (int256) { + return a ^ b; + } +} diff --git a/resources/regressions/bor.json/mutants/2/Ops/BOR/BOR.sol b/resources/regressions/bor.json/mutants/2/Ops/BOR/BOR.sol new file mode 100644 index 0000000..4bfbc16 --- /dev/null +++ b/resources/regressions/bor.json/mutants/2/Ops/BOR/BOR.sol @@ -0,0 +1,25 @@ +// SPDX-License-Identifier: GPL-3.0-only +pragma solidity >0.7.0; +pragma experimental ABIEncoderV2; + +// This contract provides test functions for Bitwise Operator Replacement (BOR) +contract BOR { + // Expect 1 mutants: + // a & b; + function bw_or(int256 a, int256 b) public pure returns (int256) { + return a | b; + } + + // Expect 1 mutants: + // a | b; + /// ConditionalOperatorReplacement(`&` |==> `|`) of: `return a & b;` + function bw_and(int256 a, int256 b) public pure returns (int256) { + return a | b; + } + + // Expect 1 mutants: + // a | b; + function bw_xor(int256 a, int256 b) public pure returns (int256) { + return a ^ b; + } +} diff --git a/resources/regressions/bor.json/mutants/3/Ops/BOR/BOR.sol b/resources/regressions/bor.json/mutants/3/Ops/BOR/BOR.sol new file mode 100644 index 0000000..d4ee434 --- /dev/null +++ b/resources/regressions/bor.json/mutants/3/Ops/BOR/BOR.sol @@ -0,0 +1,25 @@ +// SPDX-License-Identifier: GPL-3.0-only +pragma solidity >0.7.0; +pragma experimental ABIEncoderV2; + +// This contract provides test functions for Bitwise Operator Replacement (BOR) +contract BOR { + // Expect 1 mutants: + // a & b; + function bw_or(int256 a, int256 b) public pure returns (int256) { + return a | b; + } + + // Expect 1 mutants: + // a | b; + function bw_and(int256 a, int256 b) public pure returns (int256) { + return a & b; + } + + // Expect 1 mutants: + // a | b; + /// ConditionalOperatorReplacement(`^` |==> `&`) of: `return a ^ b;` + function bw_xor(int256 a, int256 b) public pure returns (int256) { + return a & b; + } +} diff --git a/resources/regressions/edc.json/gambit_results.json b/resources/regressions/edc.json/gambit_results.json new file mode 100644 index 0000000..0b99ff0 --- /dev/null +++ b/resources/regressions/edc.json/gambit_results.json @@ -0,0 +1,14 @@ +[ + { + "col": 38, + "description": "ElimDelegateCall", + "diff": "--- original\n+++ mutant\n@@ -12,8 +12,9 @@\n bool public delegateSuccessful;\n bytes public myData;\n \n+ /// ElimDelegateCall(`delegatecall` |==> `call`) of: `(bool success, ) = _contract.delegatecall(`\n function setVars(address _contract) public payable {\n- (bool success, ) = _contract.delegatecall(\n+ (bool success, ) = _contract.call(\n abi.encodeWithSignature(\"setVars(uint256)\", 1)\n );\n require(success, \"Delegatecall failed\");\n", + "id": "1", + "line": 16, + "name": "mutants/1/Ops/EDC/EDC.sol", + "op": "EDC", + "orig": "delegatecall", + "original": "Ops/EDC/EDC.sol", + "repl": "call" + } +] \ No newline at end of file diff --git a/resources/regressions/edc.json/mutants.log b/resources/regressions/edc.json/mutants.log new file mode 100644 index 0000000..379d8f7 --- /dev/null +++ b/resources/regressions/edc.json/mutants.log @@ -0,0 +1 @@ +1,EDC,Ops/EDC/EDC.sol,16:38,delegatecall,call diff --git a/resources/regressions/edc.json/mutants/1/Ops/EDC/EDC.sol b/resources/regressions/edc.json/mutants/1/Ops/EDC/EDC.sol new file mode 100644 index 0000000..1975497 --- /dev/null +++ b/resources/regressions/edc.json/mutants/1/Ops/EDC/EDC.sol @@ -0,0 +1,22 @@ +// SPDX-License-Identifier: GPL-3.0-only +pragma solidity ^0.8.13; + +contract Helper { + function setVars(uint _num) public payable {} +} + +contract EDC { + uint public num; + address public sender; + uint public value; + bool public delegateSuccessful; + bytes public myData; + + /// ElimDelegateCall(`delegatecall` |==> `call`) of: `(bool success, ) = _contract.delegatecall(` + function setVars(address _contract) public payable { + (bool success, ) = _contract.call( + abi.encodeWithSignature("setVars(uint256)", 1) + ); + require(success, "Delegatecall failed"); + } +} diff --git a/resources/regressions/evr.json/gambit_results.json b/resources/regressions/evr.json/gambit_results.json new file mode 100644 index 0000000..8bc9f42 --- /dev/null +++ b/resources/regressions/evr.json/gambit_results.json @@ -0,0 +1,194 @@ +[ + { + "col": 16, + "description": "ExpressionValueReplacement", + "diff": "--- original\n+++ mutant\n@@ -4,8 +4,9 @@\n \n // This contract provides test functions for relational operator replacement (ROR)\n contract EVR {\n+ /// ExpressionValueReplacement(`a + b` |==> `0`) of: `return a + b;`\n function add(uint256 a, uint256 b) public pure returns (uint256) {\n- return a + b;\n+ return 0;\n }\n \n function evr_test_1(uint256 a, uint256 b) public pure returns (uint256) {\n", + "id": "1", + "line": 8, + "name": "mutants/1/Ops/EVR/EVR.sol", + "op": "EVR", + "orig": "a + b", + "original": "Ops/EVR/EVR.sol", + "repl": "0" + }, + { + "col": 16, + "description": "ExpressionValueReplacement", + "diff": "--- original\n+++ mutant\n@@ -4,8 +4,9 @@\n \n // This contract provides test functions for relational operator replacement (ROR)\n contract EVR {\n+ /// ExpressionValueReplacement(`a + b` |==> `1`) of: `return a + b;`\n function add(uint256 a, uint256 b) public pure returns (uint256) {\n- return a + b;\n+ return 1;\n }\n \n function evr_test_1(uint256 a, uint256 b) public pure returns (uint256) {\n", + "id": "2", + "line": 8, + "name": "mutants/2/Ops/EVR/EVR.sol", + "op": "EVR", + "orig": "a + b", + "original": "Ops/EVR/EVR.sol", + "repl": "1" + }, + { + "col": 26, + "description": "ExpressionValueReplacement", + "diff": "--- original\n+++ mutant\n@@ -8,8 +8,9 @@\n return a + b;\n }\n \n+ /// ExpressionValueReplacement(`add(a, b)` |==> `0`) of: `uint256 result = add(a, b);`\n function evr_test_1(uint256 a, uint256 b) public pure returns (uint256) {\n- uint256 result = add(a, b);\n+ uint256 result = 0;\n return result;\n }\n \n", + "id": "3", + "line": 12, + "name": "mutants/3/Ops/EVR/EVR.sol", + "op": "EVR", + "orig": "add(a, b)", + "original": "Ops/EVR/EVR.sol", + "repl": "0" + }, + { + "col": 26, + "description": "ExpressionValueReplacement", + "diff": "--- original\n+++ mutant\n@@ -8,8 +8,9 @@\n return a + b;\n }\n \n+ /// ExpressionValueReplacement(`add(a, b)` |==> `1`) of: `uint256 result = add(a, b);`\n function evr_test_1(uint256 a, uint256 b) public pure returns (uint256) {\n- uint256 result = add(a, b);\n+ uint256 result = 1;\n return result;\n }\n \n", + "id": "4", + "line": 12, + "name": "mutants/4/Ops/EVR/EVR.sol", + "op": "EVR", + "orig": "add(a, b)", + "original": "Ops/EVR/EVR.sol", + "repl": "1" + }, + { + "col": 16, + "description": "ExpressionValueReplacement", + "diff": "--- original\n+++ mutant\n@@ -9,8 +9,9 @@\n }\n \n function evr_test_1(uint256 a, uint256 b) public pure returns (uint256) {\n+ /// ExpressionValueReplacement(`result` |==> `0`) of: `return result;`\n uint256 result = add(a, b);\n- return result;\n+ return 0;\n }\n \n function evr_test_2(uint256 a, uint256 b) public pure returns (uint256) {\n", + "id": "5", + "line": 13, + "name": "mutants/5/Ops/EVR/EVR.sol", + "op": "EVR", + "orig": "result", + "original": "Ops/EVR/EVR.sol", + "repl": "0" + }, + { + "col": 16, + "description": "ExpressionValueReplacement", + "diff": "--- original\n+++ mutant\n@@ -9,8 +9,9 @@\n }\n \n function evr_test_1(uint256 a, uint256 b) public pure returns (uint256) {\n+ /// ExpressionValueReplacement(`result` |==> `1`) of: `return result;`\n uint256 result = add(a, b);\n- return result;\n+ return 1;\n }\n \n function evr_test_2(uint256 a, uint256 b) public pure returns (uint256) {\n", + "id": "6", + "line": 13, + "name": "mutants/6/Ops/EVR/EVR.sol", + "op": "EVR", + "orig": "result", + "original": "Ops/EVR/EVR.sol", + "repl": "1" + }, + { + "col": 18, + "description": "ExpressionValueReplacement", + "diff": "--- original\n+++ mutant\n@@ -13,8 +13,9 @@\n return result;\n }\n \n+ /// ExpressionValueReplacement(`a < b` |==> `true`) of: `bool c = a < b;`\n function evr_test_2(uint256 a, uint256 b) public pure returns (uint256) {\n- bool c = a < b;\n+ bool c = true;\n while (c) {\n b = b - a;\n c = a < b;\n", + "id": "7", + "line": 17, + "name": "mutants/7/Ops/EVR/EVR.sol", + "op": "EVR", + "orig": "a < b", + "original": "Ops/EVR/EVR.sol", + "repl": "true" + }, + { + "col": 18, + "description": "ExpressionValueReplacement", + "diff": "--- original\n+++ mutant\n@@ -13,8 +13,9 @@\n return result;\n }\n \n+ /// ExpressionValueReplacement(`a < b` |==> `false`) of: `bool c = a < b;`\n function evr_test_2(uint256 a, uint256 b) public pure returns (uint256) {\n- bool c = a < b;\n+ bool c = false;\n while (c) {\n b = b - a;\n c = a < b;\n", + "id": "8", + "line": 17, + "name": "mutants/8/Ops/EVR/EVR.sol", + "op": "EVR", + "orig": "a < b", + "original": "Ops/EVR/EVR.sol", + "repl": "false" + }, + { + "col": 16, + "description": "ExpressionValueReplacement", + "diff": "--- original\n+++ mutant\n@@ -14,8 +14,9 @@\n }\n \n function evr_test_2(uint256 a, uint256 b) public pure returns (uint256) {\n+ /// ExpressionValueReplacement(`c` |==> `true`) of: `while (c) {`\n bool c = a < b;\n- while (c) {\n+ while (true) {\n b = b - a;\n c = a < b;\n }\n", + "id": "9", + "line": 18, + "name": "mutants/9/Ops/EVR/EVR.sol", + "op": "EVR", + "orig": "c", + "original": "Ops/EVR/EVR.sol", + "repl": "true" + }, + { + "col": 16, + "description": "ExpressionValueReplacement", + "diff": "--- original\n+++ mutant\n@@ -14,8 +14,9 @@\n }\n \n function evr_test_2(uint256 a, uint256 b) public pure returns (uint256) {\n+ /// ExpressionValueReplacement(`c` |==> `false`) of: `while (c) {`\n bool c = a < b;\n- while (c) {\n+ while (false) {\n b = b - a;\n c = a < b;\n }\n", + "id": "10", + "line": 18, + "name": "mutants/10/Ops/EVR/EVR.sol", + "op": "EVR", + "orig": "c", + "original": "Ops/EVR/EVR.sol", + "repl": "false" + }, + { + "col": 17, + "description": "ExpressionValueReplacement", + "diff": "--- original\n+++ mutant\n@@ -15,8 +15,9 @@\n \n function evr_test_2(uint256 a, uint256 b) public pure returns (uint256) {\n bool c = a < b;\n+ /// ExpressionValueReplacement(`b - a` |==> `0`) of: `b = b - a;`\n while (c) {\n- b = b - a;\n+ b = 0;\n c = a < b;\n }\n return a - b;\n", + "id": "11", + "line": 19, + "name": "mutants/11/Ops/EVR/EVR.sol", + "op": "EVR", + "orig": "b - a", + "original": "Ops/EVR/EVR.sol", + "repl": "0" + }, + { + "col": 17, + "description": "ExpressionValueReplacement", + "diff": "--- original\n+++ mutant\n@@ -15,8 +15,9 @@\n \n function evr_test_2(uint256 a, uint256 b) public pure returns (uint256) {\n bool c = a < b;\n+ /// ExpressionValueReplacement(`b - a` |==> `1`) of: `b = b - a;`\n while (c) {\n- b = b - a;\n+ b = 1;\n c = a < b;\n }\n return a - b;\n", + "id": "12", + "line": 19, + "name": "mutants/12/Ops/EVR/EVR.sol", + "op": "EVR", + "orig": "b - a", + "original": "Ops/EVR/EVR.sol", + "repl": "1" + }, + { + "col": 17, + "description": "ExpressionValueReplacement", + "diff": "--- original\n+++ mutant\n@@ -16,8 +16,9 @@\n function evr_test_2(uint256 a, uint256 b) public pure returns (uint256) {\n bool c = a < b;\n while (c) {\n+ /// ExpressionValueReplacement(`a < b` |==> `true`) of: `c = a < b;`\n b = b - a;\n- c = a < b;\n+ c = true;\n }\n return a - b;\n }\n", + "id": "13", + "line": 20, + "name": "mutants/13/Ops/EVR/EVR.sol", + "op": "EVR", + "orig": "a < b", + "original": "Ops/EVR/EVR.sol", + "repl": "true" + }, + { + "col": 17, + "description": "ExpressionValueReplacement", + "diff": "--- original\n+++ mutant\n@@ -16,8 +16,9 @@\n function evr_test_2(uint256 a, uint256 b) public pure returns (uint256) {\n bool c = a < b;\n while (c) {\n+ /// ExpressionValueReplacement(`a < b` |==> `false`) of: `c = a < b;`\n b = b - a;\n- c = a < b;\n+ c = false;\n }\n return a - b;\n }\n", + "id": "14", + "line": 20, + "name": "mutants/14/Ops/EVR/EVR.sol", + "op": "EVR", + "orig": "a < b", + "original": "Ops/EVR/EVR.sol", + "repl": "false" + }, + { + "col": 16, + "description": "ExpressionValueReplacement", + "diff": "--- original\n+++ mutant\n@@ -18,7 +18,8 @@\n while (c) {\n b = b - a;\n c = a < b;\n+ /// ExpressionValueReplacement(`a - b` |==> `0`) of: `return a - b;`\n }\n- return a - b;\n+ return 0;\n }\n }\n", + "id": "15", + "line": 22, + "name": "mutants/15/Ops/EVR/EVR.sol", + "op": "EVR", + "orig": "a - b", + "original": "Ops/EVR/EVR.sol", + "repl": "0" + }, + { + "col": 16, + "description": "ExpressionValueReplacement", + "diff": "--- original\n+++ mutant\n@@ -18,7 +18,8 @@\n while (c) {\n b = b - a;\n c = a < b;\n+ /// ExpressionValueReplacement(`a - b` |==> `1`) of: `return a - b;`\n }\n- return a - b;\n+ return 1;\n }\n }\n", + "id": "16", + "line": 22, + "name": "mutants/16/Ops/EVR/EVR.sol", + "op": "EVR", + "orig": "a - b", + "original": "Ops/EVR/EVR.sol", + "repl": "1" + } +] \ No newline at end of file diff --git a/resources/regressions/evr.json/mutants.log b/resources/regressions/evr.json/mutants.log new file mode 100644 index 0000000..0d4e83c --- /dev/null +++ b/resources/regressions/evr.json/mutants.log @@ -0,0 +1,16 @@ +1,EVR,Ops/EVR/EVR.sol,8:16,a + b,0 +2,EVR,Ops/EVR/EVR.sol,8:16,a + b,1 +3,EVR,Ops/EVR/EVR.sol,12:26,"add(a, b)",0 +4,EVR,Ops/EVR/EVR.sol,12:26,"add(a, b)",1 +5,EVR,Ops/EVR/EVR.sol,13:16,result,0 +6,EVR,Ops/EVR/EVR.sol,13:16,result,1 +7,EVR,Ops/EVR/EVR.sol,17:18,a < b,true +8,EVR,Ops/EVR/EVR.sol,17:18,a < b,false +9,EVR,Ops/EVR/EVR.sol,18:16,c,true +10,EVR,Ops/EVR/EVR.sol,18:16,c,false +11,EVR,Ops/EVR/EVR.sol,19:17,b - a,0 +12,EVR,Ops/EVR/EVR.sol,19:17,b - a,1 +13,EVR,Ops/EVR/EVR.sol,20:17,a < b,true +14,EVR,Ops/EVR/EVR.sol,20:17,a < b,false +15,EVR,Ops/EVR/EVR.sol,22:16,a - b,0 +16,EVR,Ops/EVR/EVR.sol,22:16,a - b,1 diff --git a/resources/regressions/evr.json/mutants/1/Ops/EVR/EVR.sol b/resources/regressions/evr.json/mutants/1/Ops/EVR/EVR.sol new file mode 100644 index 0000000..1b02f6a --- /dev/null +++ b/resources/regressions/evr.json/mutants/1/Ops/EVR/EVR.sol @@ -0,0 +1,25 @@ +// SPDX-License-Identifier: GPL-3.0-only +pragma solidity >0.7.0; +pragma experimental ABIEncoderV2; + +// This contract provides test functions for relational operator replacement (ROR) +contract EVR { + /// ExpressionValueReplacement(`a + b` |==> `0`) of: `return a + b;` + function add(uint256 a, uint256 b) public pure returns (uint256) { + return 0; + } + + function evr_test_1(uint256 a, uint256 b) public pure returns (uint256) { + uint256 result = add(a, b); + return result; + } + + function evr_test_2(uint256 a, uint256 b) public pure returns (uint256) { + bool c = a < b; + while (c) { + b = b - a; + c = a < b; + } + return a - b; + } +} diff --git a/resources/regressions/evr.json/mutants/10/Ops/EVR/EVR.sol b/resources/regressions/evr.json/mutants/10/Ops/EVR/EVR.sol new file mode 100644 index 0000000..b8a6e6d --- /dev/null +++ b/resources/regressions/evr.json/mutants/10/Ops/EVR/EVR.sol @@ -0,0 +1,25 @@ +// SPDX-License-Identifier: GPL-3.0-only +pragma solidity >0.7.0; +pragma experimental ABIEncoderV2; + +// This contract provides test functions for relational operator replacement (ROR) +contract EVR { + function add(uint256 a, uint256 b) public pure returns (uint256) { + return a + b; + } + + function evr_test_1(uint256 a, uint256 b) public pure returns (uint256) { + uint256 result = add(a, b); + return result; + } + + function evr_test_2(uint256 a, uint256 b) public pure returns (uint256) { + /// ExpressionValueReplacement(`c` |==> `false`) of: `while (c) {` + bool c = a < b; + while (false) { + b = b - a; + c = a < b; + } + return a - b; + } +} diff --git a/resources/regressions/evr.json/mutants/11/Ops/EVR/EVR.sol b/resources/regressions/evr.json/mutants/11/Ops/EVR/EVR.sol new file mode 100644 index 0000000..c4d1047 --- /dev/null +++ b/resources/regressions/evr.json/mutants/11/Ops/EVR/EVR.sol @@ -0,0 +1,25 @@ +// SPDX-License-Identifier: GPL-3.0-only +pragma solidity >0.7.0; +pragma experimental ABIEncoderV2; + +// This contract provides test functions for relational operator replacement (ROR) +contract EVR { + function add(uint256 a, uint256 b) public pure returns (uint256) { + return a + b; + } + + function evr_test_1(uint256 a, uint256 b) public pure returns (uint256) { + uint256 result = add(a, b); + return result; + } + + function evr_test_2(uint256 a, uint256 b) public pure returns (uint256) { + bool c = a < b; + /// ExpressionValueReplacement(`b - a` |==> `0`) of: `b = b - a;` + while (c) { + b = 0; + c = a < b; + } + return a - b; + } +} diff --git a/resources/regressions/evr.json/mutants/12/Ops/EVR/EVR.sol b/resources/regressions/evr.json/mutants/12/Ops/EVR/EVR.sol new file mode 100644 index 0000000..ebe50b7 --- /dev/null +++ b/resources/regressions/evr.json/mutants/12/Ops/EVR/EVR.sol @@ -0,0 +1,25 @@ +// SPDX-License-Identifier: GPL-3.0-only +pragma solidity >0.7.0; +pragma experimental ABIEncoderV2; + +// This contract provides test functions for relational operator replacement (ROR) +contract EVR { + function add(uint256 a, uint256 b) public pure returns (uint256) { + return a + b; + } + + function evr_test_1(uint256 a, uint256 b) public pure returns (uint256) { + uint256 result = add(a, b); + return result; + } + + function evr_test_2(uint256 a, uint256 b) public pure returns (uint256) { + bool c = a < b; + /// ExpressionValueReplacement(`b - a` |==> `1`) of: `b = b - a;` + while (c) { + b = 1; + c = a < b; + } + return a - b; + } +} diff --git a/resources/regressions/evr.json/mutants/13/Ops/EVR/EVR.sol b/resources/regressions/evr.json/mutants/13/Ops/EVR/EVR.sol new file mode 100644 index 0000000..0ad3587 --- /dev/null +++ b/resources/regressions/evr.json/mutants/13/Ops/EVR/EVR.sol @@ -0,0 +1,25 @@ +// SPDX-License-Identifier: GPL-3.0-only +pragma solidity >0.7.0; +pragma experimental ABIEncoderV2; + +// This contract provides test functions for relational operator replacement (ROR) +contract EVR { + function add(uint256 a, uint256 b) public pure returns (uint256) { + return a + b; + } + + function evr_test_1(uint256 a, uint256 b) public pure returns (uint256) { + uint256 result = add(a, b); + return result; + } + + function evr_test_2(uint256 a, uint256 b) public pure returns (uint256) { + bool c = a < b; + while (c) { + /// ExpressionValueReplacement(`a < b` |==> `true`) of: `c = a < b;` + b = b - a; + c = true; + } + return a - b; + } +} diff --git a/resources/regressions/evr.json/mutants/14/Ops/EVR/EVR.sol b/resources/regressions/evr.json/mutants/14/Ops/EVR/EVR.sol new file mode 100644 index 0000000..82bacee --- /dev/null +++ b/resources/regressions/evr.json/mutants/14/Ops/EVR/EVR.sol @@ -0,0 +1,25 @@ +// SPDX-License-Identifier: GPL-3.0-only +pragma solidity >0.7.0; +pragma experimental ABIEncoderV2; + +// This contract provides test functions for relational operator replacement (ROR) +contract EVR { + function add(uint256 a, uint256 b) public pure returns (uint256) { + return a + b; + } + + function evr_test_1(uint256 a, uint256 b) public pure returns (uint256) { + uint256 result = add(a, b); + return result; + } + + function evr_test_2(uint256 a, uint256 b) public pure returns (uint256) { + bool c = a < b; + while (c) { + /// ExpressionValueReplacement(`a < b` |==> `false`) of: `c = a < b;` + b = b - a; + c = false; + } + return a - b; + } +} diff --git a/resources/regressions/evr.json/mutants/15/Ops/EVR/EVR.sol b/resources/regressions/evr.json/mutants/15/Ops/EVR/EVR.sol new file mode 100644 index 0000000..8518990 --- /dev/null +++ b/resources/regressions/evr.json/mutants/15/Ops/EVR/EVR.sol @@ -0,0 +1,25 @@ +// SPDX-License-Identifier: GPL-3.0-only +pragma solidity >0.7.0; +pragma experimental ABIEncoderV2; + +// This contract provides test functions for relational operator replacement (ROR) +contract EVR { + function add(uint256 a, uint256 b) public pure returns (uint256) { + return a + b; + } + + function evr_test_1(uint256 a, uint256 b) public pure returns (uint256) { + uint256 result = add(a, b); + return result; + } + + function evr_test_2(uint256 a, uint256 b) public pure returns (uint256) { + bool c = a < b; + while (c) { + b = b - a; + c = a < b; + /// ExpressionValueReplacement(`a - b` |==> `0`) of: `return a - b;` + } + return 0; + } +} diff --git a/resources/regressions/evr.json/mutants/16/Ops/EVR/EVR.sol b/resources/regressions/evr.json/mutants/16/Ops/EVR/EVR.sol new file mode 100644 index 0000000..940f678 --- /dev/null +++ b/resources/regressions/evr.json/mutants/16/Ops/EVR/EVR.sol @@ -0,0 +1,25 @@ +// SPDX-License-Identifier: GPL-3.0-only +pragma solidity >0.7.0; +pragma experimental ABIEncoderV2; + +// This contract provides test functions for relational operator replacement (ROR) +contract EVR { + function add(uint256 a, uint256 b) public pure returns (uint256) { + return a + b; + } + + function evr_test_1(uint256 a, uint256 b) public pure returns (uint256) { + uint256 result = add(a, b); + return result; + } + + function evr_test_2(uint256 a, uint256 b) public pure returns (uint256) { + bool c = a < b; + while (c) { + b = b - a; + c = a < b; + /// ExpressionValueReplacement(`a - b` |==> `1`) of: `return a - b;` + } + return 1; + } +} diff --git a/resources/regressions/evr.json/mutants/2/Ops/EVR/EVR.sol b/resources/regressions/evr.json/mutants/2/Ops/EVR/EVR.sol new file mode 100644 index 0000000..414bc91 --- /dev/null +++ b/resources/regressions/evr.json/mutants/2/Ops/EVR/EVR.sol @@ -0,0 +1,25 @@ +// SPDX-License-Identifier: GPL-3.0-only +pragma solidity >0.7.0; +pragma experimental ABIEncoderV2; + +// This contract provides test functions for relational operator replacement (ROR) +contract EVR { + /// ExpressionValueReplacement(`a + b` |==> `1`) of: `return a + b;` + function add(uint256 a, uint256 b) public pure returns (uint256) { + return 1; + } + + function evr_test_1(uint256 a, uint256 b) public pure returns (uint256) { + uint256 result = add(a, b); + return result; + } + + function evr_test_2(uint256 a, uint256 b) public pure returns (uint256) { + bool c = a < b; + while (c) { + b = b - a; + c = a < b; + } + return a - b; + } +} diff --git a/resources/regressions/evr.json/mutants/3/Ops/EVR/EVR.sol b/resources/regressions/evr.json/mutants/3/Ops/EVR/EVR.sol new file mode 100644 index 0000000..164554a --- /dev/null +++ b/resources/regressions/evr.json/mutants/3/Ops/EVR/EVR.sol @@ -0,0 +1,25 @@ +// SPDX-License-Identifier: GPL-3.0-only +pragma solidity >0.7.0; +pragma experimental ABIEncoderV2; + +// This contract provides test functions for relational operator replacement (ROR) +contract EVR { + function add(uint256 a, uint256 b) public pure returns (uint256) { + return a + b; + } + + /// ExpressionValueReplacement(`add(a, b)` |==> `0`) of: `uint256 result = add(a, b);` + function evr_test_1(uint256 a, uint256 b) public pure returns (uint256) { + uint256 result = 0; + return result; + } + + function evr_test_2(uint256 a, uint256 b) public pure returns (uint256) { + bool c = a < b; + while (c) { + b = b - a; + c = a < b; + } + return a - b; + } +} diff --git a/resources/regressions/evr.json/mutants/4/Ops/EVR/EVR.sol b/resources/regressions/evr.json/mutants/4/Ops/EVR/EVR.sol new file mode 100644 index 0000000..4799dc9 --- /dev/null +++ b/resources/regressions/evr.json/mutants/4/Ops/EVR/EVR.sol @@ -0,0 +1,25 @@ +// SPDX-License-Identifier: GPL-3.0-only +pragma solidity >0.7.0; +pragma experimental ABIEncoderV2; + +// This contract provides test functions for relational operator replacement (ROR) +contract EVR { + function add(uint256 a, uint256 b) public pure returns (uint256) { + return a + b; + } + + /// ExpressionValueReplacement(`add(a, b)` |==> `1`) of: `uint256 result = add(a, b);` + function evr_test_1(uint256 a, uint256 b) public pure returns (uint256) { + uint256 result = 1; + return result; + } + + function evr_test_2(uint256 a, uint256 b) public pure returns (uint256) { + bool c = a < b; + while (c) { + b = b - a; + c = a < b; + } + return a - b; + } +} diff --git a/resources/regressions/evr.json/mutants/5/Ops/EVR/EVR.sol b/resources/regressions/evr.json/mutants/5/Ops/EVR/EVR.sol new file mode 100644 index 0000000..f9ec895 --- /dev/null +++ b/resources/regressions/evr.json/mutants/5/Ops/EVR/EVR.sol @@ -0,0 +1,25 @@ +// SPDX-License-Identifier: GPL-3.0-only +pragma solidity >0.7.0; +pragma experimental ABIEncoderV2; + +// This contract provides test functions for relational operator replacement (ROR) +contract EVR { + function add(uint256 a, uint256 b) public pure returns (uint256) { + return a + b; + } + + function evr_test_1(uint256 a, uint256 b) public pure returns (uint256) { + /// ExpressionValueReplacement(`result` |==> `0`) of: `return result;` + uint256 result = add(a, b); + return 0; + } + + function evr_test_2(uint256 a, uint256 b) public pure returns (uint256) { + bool c = a < b; + while (c) { + b = b - a; + c = a < b; + } + return a - b; + } +} diff --git a/resources/regressions/evr.json/mutants/6/Ops/EVR/EVR.sol b/resources/regressions/evr.json/mutants/6/Ops/EVR/EVR.sol new file mode 100644 index 0000000..9bd1c21 --- /dev/null +++ b/resources/regressions/evr.json/mutants/6/Ops/EVR/EVR.sol @@ -0,0 +1,25 @@ +// SPDX-License-Identifier: GPL-3.0-only +pragma solidity >0.7.0; +pragma experimental ABIEncoderV2; + +// This contract provides test functions for relational operator replacement (ROR) +contract EVR { + function add(uint256 a, uint256 b) public pure returns (uint256) { + return a + b; + } + + function evr_test_1(uint256 a, uint256 b) public pure returns (uint256) { + /// ExpressionValueReplacement(`result` |==> `1`) of: `return result;` + uint256 result = add(a, b); + return 1; + } + + function evr_test_2(uint256 a, uint256 b) public pure returns (uint256) { + bool c = a < b; + while (c) { + b = b - a; + c = a < b; + } + return a - b; + } +} diff --git a/resources/regressions/evr.json/mutants/7/Ops/EVR/EVR.sol b/resources/regressions/evr.json/mutants/7/Ops/EVR/EVR.sol new file mode 100644 index 0000000..6905591 --- /dev/null +++ b/resources/regressions/evr.json/mutants/7/Ops/EVR/EVR.sol @@ -0,0 +1,25 @@ +// SPDX-License-Identifier: GPL-3.0-only +pragma solidity >0.7.0; +pragma experimental ABIEncoderV2; + +// This contract provides test functions for relational operator replacement (ROR) +contract EVR { + function add(uint256 a, uint256 b) public pure returns (uint256) { + return a + b; + } + + function evr_test_1(uint256 a, uint256 b) public pure returns (uint256) { + uint256 result = add(a, b); + return result; + } + + /// ExpressionValueReplacement(`a < b` |==> `true`) of: `bool c = a < b;` + function evr_test_2(uint256 a, uint256 b) public pure returns (uint256) { + bool c = true; + while (c) { + b = b - a; + c = a < b; + } + return a - b; + } +} diff --git a/resources/regressions/evr.json/mutants/8/Ops/EVR/EVR.sol b/resources/regressions/evr.json/mutants/8/Ops/EVR/EVR.sol new file mode 100644 index 0000000..88b7d5e --- /dev/null +++ b/resources/regressions/evr.json/mutants/8/Ops/EVR/EVR.sol @@ -0,0 +1,25 @@ +// SPDX-License-Identifier: GPL-3.0-only +pragma solidity >0.7.0; +pragma experimental ABIEncoderV2; + +// This contract provides test functions for relational operator replacement (ROR) +contract EVR { + function add(uint256 a, uint256 b) public pure returns (uint256) { + return a + b; + } + + function evr_test_1(uint256 a, uint256 b) public pure returns (uint256) { + uint256 result = add(a, b); + return result; + } + + /// ExpressionValueReplacement(`a < b` |==> `false`) of: `bool c = a < b;` + function evr_test_2(uint256 a, uint256 b) public pure returns (uint256) { + bool c = false; + while (c) { + b = b - a; + c = a < b; + } + return a - b; + } +} diff --git a/resources/regressions/evr.json/mutants/9/Ops/EVR/EVR.sol b/resources/regressions/evr.json/mutants/9/Ops/EVR/EVR.sol new file mode 100644 index 0000000..bf2cfc8 --- /dev/null +++ b/resources/regressions/evr.json/mutants/9/Ops/EVR/EVR.sol @@ -0,0 +1,25 @@ +// SPDX-License-Identifier: GPL-3.0-only +pragma solidity >0.7.0; +pragma experimental ABIEncoderV2; + +// This contract provides test functions for relational operator replacement (ROR) +contract EVR { + function add(uint256 a, uint256 b) public pure returns (uint256) { + return a + b; + } + + function evr_test_1(uint256 a, uint256 b) public pure returns (uint256) { + uint256 result = add(a, b); + return result; + } + + function evr_test_2(uint256 a, uint256 b) public pure returns (uint256) { + /// ExpressionValueReplacement(`c` |==> `true`) of: `while (c) {` + bool c = a < b; + while (true) { + b = b - a; + c = a < b; + } + return a - b; + } +} diff --git a/resources/regressions/lor.json/gambit_results.json b/resources/regressions/lor.json/gambit_results.json new file mode 100644 index 0000000..0dfcd9b --- /dev/null +++ b/resources/regressions/lor.json/gambit_results.json @@ -0,0 +1,134 @@ +[ + { + "col": 16, + "description": "LogicalOperatorReplacement", + "diff": "--- original\n+++ mutant\n@@ -5,8 +5,9 @@\n // This contract provides test functions for relational operator replacement (ROR)\n contract LOR {\n // Expect three mutants: a, b, false\n+ /// LogicalOperatorReplacement(`a && b` |==> `a`) of: `return a && b;`\n function and(bool a, bool b) public pure returns (bool) {\n- return a && b;\n+ return a;\n }\n \n // Expect three mutants: a, b, true\n", + "id": "1", + "line": 9, + "name": "mutants/1/Ops/LOR/LOR.sol", + "op": "LOR", + "orig": "a && b", + "original": "Ops/LOR/LOR.sol", + "repl": "a" + }, + { + "col": 16, + "description": "LogicalOperatorReplacement", + "diff": "--- original\n+++ mutant\n@@ -5,8 +5,9 @@\n // This contract provides test functions for relational operator replacement (ROR)\n contract LOR {\n // Expect three mutants: a, b, false\n+ /// LogicalOperatorReplacement(`a && b` |==> `b`) of: `return a && b;`\n function and(bool a, bool b) public pure returns (bool) {\n- return a && b;\n+ return b;\n }\n \n // Expect three mutants: a, b, true\n", + "id": "2", + "line": 9, + "name": "mutants/2/Ops/LOR/LOR.sol", + "op": "LOR", + "orig": "a && b", + "original": "Ops/LOR/LOR.sol", + "repl": "b" + }, + { + "col": 16, + "description": "LogicalOperatorReplacement", + "diff": "--- original\n+++ mutant\n@@ -5,8 +5,9 @@\n // This contract provides test functions for relational operator replacement (ROR)\n contract LOR {\n // Expect three mutants: a, b, false\n+ /// LogicalOperatorReplacement(`a && b` |==> `false`) of: `return a && b;`\n function and(bool a, bool b) public pure returns (bool) {\n- return a && b;\n+ return false;\n }\n \n // Expect three mutants: a, b, true\n", + "id": "3", + "line": 9, + "name": "mutants/3/Ops/LOR/LOR.sol", + "op": "LOR", + "orig": "a && b", + "original": "Ops/LOR/LOR.sol", + "repl": "false" + }, + { + "col": 16, + "description": "LogicalOperatorReplacement", + "diff": "--- original\n+++ mutant\n@@ -10,8 +10,9 @@\n }\n \n // Expect three mutants: a, b, true\n+ /// LogicalOperatorReplacement(`a || b` |==> `a`) of: `return a || b;`\n function or(bool a, bool b) public pure returns (bool) {\n- return a || b;\n+ return a;\n }\n \n // Expect three mutants, x < y, a != (x >= y), true\n", + "id": "4", + "line": 14, + "name": "mutants/4/Ops/LOR/LOR.sol", + "op": "LOR", + "orig": "a || b", + "original": "Ops/LOR/LOR.sol", + "repl": "a" + }, + { + "col": 16, + "description": "LogicalOperatorReplacement", + "diff": "--- original\n+++ mutant\n@@ -10,8 +10,9 @@\n }\n \n // Expect three mutants: a, b, true\n+ /// LogicalOperatorReplacement(`a || b` |==> `b`) of: `return a || b;`\n function or(bool a, bool b) public pure returns (bool) {\n- return a || b;\n+ return b;\n }\n \n // Expect three mutants, x < y, a != (x >= y), true\n", + "id": "5", + "line": 14, + "name": "mutants/5/Ops/LOR/LOR.sol", + "op": "LOR", + "orig": "a || b", + "original": "Ops/LOR/LOR.sol", + "repl": "b" + }, + { + "col": 16, + "description": "LogicalOperatorReplacement", + "diff": "--- original\n+++ mutant\n@@ -10,8 +10,9 @@\n }\n \n // Expect three mutants: a, b, true\n+ /// LogicalOperatorReplacement(`a || b` |==> `true`) of: `return a || b;`\n function or(bool a, bool b) public pure returns (bool) {\n- return a || b;\n+ return true;\n }\n \n // Expect three mutants, x < y, a != (x >= y), true\n", + "id": "6", + "line": 14, + "name": "mutants/6/Ops/LOR/LOR.sol", + "op": "LOR", + "orig": "a || b", + "original": "Ops/LOR/LOR.sol", + "repl": "true" + }, + { + "col": 16, + "description": "LogicalOperatorReplacement", + "diff": "--- original\n+++ mutant\n@@ -15,8 +15,9 @@\n }\n \n // Expect three mutants, x < y, a != (x >= y), true\n+ /// LogicalOperatorReplacement(`(x < y) || (a != (x >= y))` |==> `x < y`) of: `return (x < y) || (a != (x >= y));`\n function more_or(bool a, int x, int y) public pure returns (bool) {\n- return (x < y) || (a != (x >= y));\n+ return x < y;\n }\n \n function not(bool a) public pure returns (bool) {\n", + "id": "7", + "line": 19, + "name": "mutants/7/Ops/LOR/LOR.sol", + "op": "LOR", + "orig": "(x < y) || (a != (x >= y))", + "original": "Ops/LOR/LOR.sol", + "repl": "x < y" + }, + { + "col": 16, + "description": "LogicalOperatorReplacement", + "diff": "--- original\n+++ mutant\n@@ -15,8 +15,9 @@\n }\n \n // Expect three mutants, x < y, a != (x >= y), true\n+ /// LogicalOperatorReplacement(`(x < y) || (a != (x >= y))` |==> `a != (x >= y)`) of: `return (x < y) || (a != (x >= y));`\n function more_or(bool a, int x, int y) public pure returns (bool) {\n- return (x < y) || (a != (x >= y));\n+ return a != (x >= y);\n }\n \n function not(bool a) public pure returns (bool) {\n", + "id": "8", + "line": 19, + "name": "mutants/8/Ops/LOR/LOR.sol", + "op": "LOR", + "orig": "(x < y) || (a != (x >= y))", + "original": "Ops/LOR/LOR.sol", + "repl": "a != (x >= y)" + }, + { + "col": 16, + "description": "LogicalOperatorReplacement", + "diff": "--- original\n+++ mutant\n@@ -15,8 +15,9 @@\n }\n \n // Expect three mutants, x < y, a != (x >= y), true\n+ /// LogicalOperatorReplacement(`(x < y) || (a != (x >= y))` |==> `true`) of: `return (x < y) || (a != (x >= y));`\n function more_or(bool a, int x, int y) public pure returns (bool) {\n- return (x < y) || (a != (x >= y));\n+ return true;\n }\n \n function not(bool a) public pure returns (bool) {\n", + "id": "9", + "line": 19, + "name": "mutants/9/Ops/LOR/LOR.sol", + "op": "LOR", + "orig": "(x < y) || (a != (x >= y))", + "original": "Ops/LOR/LOR.sol", + "repl": "true" + }, + { + "col": 16, + "description": "LogicalOperatorReplacement", + "diff": "--- original\n+++ mutant\n@@ -19,7 +19,8 @@\n return (x < y) || (a != (x >= y));\n }\n \n+ /// LogicalOperatorReplacement(`!a` |==> `true`) of: `return !a;`\n function not(bool a) public pure returns (bool) {\n- return !a;\n+ return true;\n }\n }\n", + "id": "10", + "line": 23, + "name": "mutants/10/Ops/LOR/LOR.sol", + "op": "LOR", + "orig": "!a", + "original": "Ops/LOR/LOR.sol", + "repl": "true" + }, + { + "col": 16, + "description": "LogicalOperatorReplacement", + "diff": "--- original\n+++ mutant\n@@ -19,7 +19,8 @@\n return (x < y) || (a != (x >= y));\n }\n \n+ /// LogicalOperatorReplacement(`!a` |==> `false`) of: `return !a;`\n function not(bool a) public pure returns (bool) {\n- return !a;\n+ return false;\n }\n }\n", + "id": "11", + "line": 23, + "name": "mutants/11/Ops/LOR/LOR.sol", + "op": "LOR", + "orig": "!a", + "original": "Ops/LOR/LOR.sol", + "repl": "false" + } +] \ No newline at end of file diff --git a/resources/regressions/lor.json/mutants.log b/resources/regressions/lor.json/mutants.log new file mode 100644 index 0000000..2df5c9a --- /dev/null +++ b/resources/regressions/lor.json/mutants.log @@ -0,0 +1,11 @@ +1,LOR,Ops/LOR/LOR.sol,9:16,a && b,a +2,LOR,Ops/LOR/LOR.sol,9:16,a && b,b +3,LOR,Ops/LOR/LOR.sol,9:16,a && b,false +4,LOR,Ops/LOR/LOR.sol,14:16,a || b,a +5,LOR,Ops/LOR/LOR.sol,14:16,a || b,b +6,LOR,Ops/LOR/LOR.sol,14:16,a || b,true +7,LOR,Ops/LOR/LOR.sol,19:16,(x < y) || (a != (x >= y)),x < y +8,LOR,Ops/LOR/LOR.sol,19:16,(x < y) || (a != (x >= y)),a != (x >= y) +9,LOR,Ops/LOR/LOR.sol,19:16,(x < y) || (a != (x >= y)),true +10,LOR,Ops/LOR/LOR.sol,23:16,!a,true +11,LOR,Ops/LOR/LOR.sol,23:16,!a,false diff --git a/resources/regressions/lor.json/mutants/1/Ops/LOR/LOR.sol b/resources/regressions/lor.json/mutants/1/Ops/LOR/LOR.sol new file mode 100644 index 0000000..01536cd --- /dev/null +++ b/resources/regressions/lor.json/mutants/1/Ops/LOR/LOR.sol @@ -0,0 +1,26 @@ +// SPDX-License-Identifier: GPL-3.0-only +pragma solidity >0.7.0; +pragma experimental ABIEncoderV2; + +// This contract provides test functions for relational operator replacement (ROR) +contract LOR { + // Expect three mutants: a, b, false + /// LogicalOperatorReplacement(`a && b` |==> `a`) of: `return a && b;` + function and(bool a, bool b) public pure returns (bool) { + return a; + } + + // Expect three mutants: a, b, true + function or(bool a, bool b) public pure returns (bool) { + return a || b; + } + + // Expect three mutants, x < y, a != (x >= y), true + function more_or(bool a, int x, int y) public pure returns (bool) { + return (x < y) || (a != (x >= y)); + } + + function not(bool a) public pure returns (bool) { + return !a; + } +} diff --git a/resources/regressions/lor.json/mutants/10/Ops/LOR/LOR.sol b/resources/regressions/lor.json/mutants/10/Ops/LOR/LOR.sol new file mode 100644 index 0000000..be0e75f --- /dev/null +++ b/resources/regressions/lor.json/mutants/10/Ops/LOR/LOR.sol @@ -0,0 +1,26 @@ +// SPDX-License-Identifier: GPL-3.0-only +pragma solidity >0.7.0; +pragma experimental ABIEncoderV2; + +// This contract provides test functions for relational operator replacement (ROR) +contract LOR { + // Expect three mutants: a, b, false + function and(bool a, bool b) public pure returns (bool) { + return a && b; + } + + // Expect three mutants: a, b, true + function or(bool a, bool b) public pure returns (bool) { + return a || b; + } + + // Expect three mutants, x < y, a != (x >= y), true + function more_or(bool a, int x, int y) public pure returns (bool) { + return (x < y) || (a != (x >= y)); + } + + /// LogicalOperatorReplacement(`!a` |==> `true`) of: `return !a;` + function not(bool a) public pure returns (bool) { + return true; + } +} diff --git a/resources/regressions/lor.json/mutants/11/Ops/LOR/LOR.sol b/resources/regressions/lor.json/mutants/11/Ops/LOR/LOR.sol new file mode 100644 index 0000000..35ee575 --- /dev/null +++ b/resources/regressions/lor.json/mutants/11/Ops/LOR/LOR.sol @@ -0,0 +1,26 @@ +// SPDX-License-Identifier: GPL-3.0-only +pragma solidity >0.7.0; +pragma experimental ABIEncoderV2; + +// This contract provides test functions for relational operator replacement (ROR) +contract LOR { + // Expect three mutants: a, b, false + function and(bool a, bool b) public pure returns (bool) { + return a && b; + } + + // Expect three mutants: a, b, true + function or(bool a, bool b) public pure returns (bool) { + return a || b; + } + + // Expect three mutants, x < y, a != (x >= y), true + function more_or(bool a, int x, int y) public pure returns (bool) { + return (x < y) || (a != (x >= y)); + } + + /// LogicalOperatorReplacement(`!a` |==> `false`) of: `return !a;` + function not(bool a) public pure returns (bool) { + return false; + } +} diff --git a/resources/regressions/lor.json/mutants/2/Ops/LOR/LOR.sol b/resources/regressions/lor.json/mutants/2/Ops/LOR/LOR.sol new file mode 100644 index 0000000..c97e867 --- /dev/null +++ b/resources/regressions/lor.json/mutants/2/Ops/LOR/LOR.sol @@ -0,0 +1,26 @@ +// SPDX-License-Identifier: GPL-3.0-only +pragma solidity >0.7.0; +pragma experimental ABIEncoderV2; + +// This contract provides test functions for relational operator replacement (ROR) +contract LOR { + // Expect three mutants: a, b, false + /// LogicalOperatorReplacement(`a && b` |==> `b`) of: `return a && b;` + function and(bool a, bool b) public pure returns (bool) { + return b; + } + + // Expect three mutants: a, b, true + function or(bool a, bool b) public pure returns (bool) { + return a || b; + } + + // Expect three mutants, x < y, a != (x >= y), true + function more_or(bool a, int x, int y) public pure returns (bool) { + return (x < y) || (a != (x >= y)); + } + + function not(bool a) public pure returns (bool) { + return !a; + } +} diff --git a/resources/regressions/lor.json/mutants/3/Ops/LOR/LOR.sol b/resources/regressions/lor.json/mutants/3/Ops/LOR/LOR.sol new file mode 100644 index 0000000..492dc45 --- /dev/null +++ b/resources/regressions/lor.json/mutants/3/Ops/LOR/LOR.sol @@ -0,0 +1,26 @@ +// SPDX-License-Identifier: GPL-3.0-only +pragma solidity >0.7.0; +pragma experimental ABIEncoderV2; + +// This contract provides test functions for relational operator replacement (ROR) +contract LOR { + // Expect three mutants: a, b, false + /// LogicalOperatorReplacement(`a && b` |==> `false`) of: `return a && b;` + function and(bool a, bool b) public pure returns (bool) { + return false; + } + + // Expect three mutants: a, b, true + function or(bool a, bool b) public pure returns (bool) { + return a || b; + } + + // Expect three mutants, x < y, a != (x >= y), true + function more_or(bool a, int x, int y) public pure returns (bool) { + return (x < y) || (a != (x >= y)); + } + + function not(bool a) public pure returns (bool) { + return !a; + } +} diff --git a/resources/regressions/lor.json/mutants/4/Ops/LOR/LOR.sol b/resources/regressions/lor.json/mutants/4/Ops/LOR/LOR.sol new file mode 100644 index 0000000..7f62ba0 --- /dev/null +++ b/resources/regressions/lor.json/mutants/4/Ops/LOR/LOR.sol @@ -0,0 +1,26 @@ +// SPDX-License-Identifier: GPL-3.0-only +pragma solidity >0.7.0; +pragma experimental ABIEncoderV2; + +// This contract provides test functions for relational operator replacement (ROR) +contract LOR { + // Expect three mutants: a, b, false + function and(bool a, bool b) public pure returns (bool) { + return a && b; + } + + // Expect three mutants: a, b, true + /// LogicalOperatorReplacement(`a || b` |==> `a`) of: `return a || b;` + function or(bool a, bool b) public pure returns (bool) { + return a; + } + + // Expect three mutants, x < y, a != (x >= y), true + function more_or(bool a, int x, int y) public pure returns (bool) { + return (x < y) || (a != (x >= y)); + } + + function not(bool a) public pure returns (bool) { + return !a; + } +} diff --git a/resources/regressions/lor.json/mutants/5/Ops/LOR/LOR.sol b/resources/regressions/lor.json/mutants/5/Ops/LOR/LOR.sol new file mode 100644 index 0000000..efb5d5a --- /dev/null +++ b/resources/regressions/lor.json/mutants/5/Ops/LOR/LOR.sol @@ -0,0 +1,26 @@ +// SPDX-License-Identifier: GPL-3.0-only +pragma solidity >0.7.0; +pragma experimental ABIEncoderV2; + +// This contract provides test functions for relational operator replacement (ROR) +contract LOR { + // Expect three mutants: a, b, false + function and(bool a, bool b) public pure returns (bool) { + return a && b; + } + + // Expect three mutants: a, b, true + /// LogicalOperatorReplacement(`a || b` |==> `b`) of: `return a || b;` + function or(bool a, bool b) public pure returns (bool) { + return b; + } + + // Expect three mutants, x < y, a != (x >= y), true + function more_or(bool a, int x, int y) public pure returns (bool) { + return (x < y) || (a != (x >= y)); + } + + function not(bool a) public pure returns (bool) { + return !a; + } +} diff --git a/resources/regressions/lor.json/mutants/6/Ops/LOR/LOR.sol b/resources/regressions/lor.json/mutants/6/Ops/LOR/LOR.sol new file mode 100644 index 0000000..7d3c811 --- /dev/null +++ b/resources/regressions/lor.json/mutants/6/Ops/LOR/LOR.sol @@ -0,0 +1,26 @@ +// SPDX-License-Identifier: GPL-3.0-only +pragma solidity >0.7.0; +pragma experimental ABIEncoderV2; + +// This contract provides test functions for relational operator replacement (ROR) +contract LOR { + // Expect three mutants: a, b, false + function and(bool a, bool b) public pure returns (bool) { + return a && b; + } + + // Expect three mutants: a, b, true + /// LogicalOperatorReplacement(`a || b` |==> `true`) of: `return a || b;` + function or(bool a, bool b) public pure returns (bool) { + return true; + } + + // Expect three mutants, x < y, a != (x >= y), true + function more_or(bool a, int x, int y) public pure returns (bool) { + return (x < y) || (a != (x >= y)); + } + + function not(bool a) public pure returns (bool) { + return !a; + } +} diff --git a/resources/regressions/lor.json/mutants/7/Ops/LOR/LOR.sol b/resources/regressions/lor.json/mutants/7/Ops/LOR/LOR.sol new file mode 100644 index 0000000..4ceda90 --- /dev/null +++ b/resources/regressions/lor.json/mutants/7/Ops/LOR/LOR.sol @@ -0,0 +1,26 @@ +// SPDX-License-Identifier: GPL-3.0-only +pragma solidity >0.7.0; +pragma experimental ABIEncoderV2; + +// This contract provides test functions for relational operator replacement (ROR) +contract LOR { + // Expect three mutants: a, b, false + function and(bool a, bool b) public pure returns (bool) { + return a && b; + } + + // Expect three mutants: a, b, true + function or(bool a, bool b) public pure returns (bool) { + return a || b; + } + + // Expect three mutants, x < y, a != (x >= y), true + /// LogicalOperatorReplacement(`(x < y) || (a != (x >= y))` |==> `x < y`) of: `return (x < y) || (a != (x >= y));` + function more_or(bool a, int x, int y) public pure returns (bool) { + return x < y; + } + + function not(bool a) public pure returns (bool) { + return !a; + } +} diff --git a/resources/regressions/lor.json/mutants/8/Ops/LOR/LOR.sol b/resources/regressions/lor.json/mutants/8/Ops/LOR/LOR.sol new file mode 100644 index 0000000..690fae8 --- /dev/null +++ b/resources/regressions/lor.json/mutants/8/Ops/LOR/LOR.sol @@ -0,0 +1,26 @@ +// SPDX-License-Identifier: GPL-3.0-only +pragma solidity >0.7.0; +pragma experimental ABIEncoderV2; + +// This contract provides test functions for relational operator replacement (ROR) +contract LOR { + // Expect three mutants: a, b, false + function and(bool a, bool b) public pure returns (bool) { + return a && b; + } + + // Expect three mutants: a, b, true + function or(bool a, bool b) public pure returns (bool) { + return a || b; + } + + // Expect three mutants, x < y, a != (x >= y), true + /// LogicalOperatorReplacement(`(x < y) || (a != (x >= y))` |==> `a != (x >= y)`) of: `return (x < y) || (a != (x >= y));` + function more_or(bool a, int x, int y) public pure returns (bool) { + return a != (x >= y); + } + + function not(bool a) public pure returns (bool) { + return !a; + } +} diff --git a/resources/regressions/lor.json/mutants/9/Ops/LOR/LOR.sol b/resources/regressions/lor.json/mutants/9/Ops/LOR/LOR.sol new file mode 100644 index 0000000..2ef1564 --- /dev/null +++ b/resources/regressions/lor.json/mutants/9/Ops/LOR/LOR.sol @@ -0,0 +1,26 @@ +// SPDX-License-Identifier: GPL-3.0-only +pragma solidity >0.7.0; +pragma experimental ABIEncoderV2; + +// This contract provides test functions for relational operator replacement (ROR) +contract LOR { + // Expect three mutants: a, b, false + function and(bool a, bool b) public pure returns (bool) { + return a && b; + } + + // Expect three mutants: a, b, true + function or(bool a, bool b) public pure returns (bool) { + return a || b; + } + + // Expect three mutants, x < y, a != (x >= y), true + /// LogicalOperatorReplacement(`(x < y) || (a != (x >= y))` |==> `true`) of: `return (x < y) || (a != (x >= y));` + function more_or(bool a, int x, int y) public pure returns (bool) { + return true; + } + + function not(bool a) public pure returns (bool) { + return !a; + } +} diff --git a/resources/regressions/lvr.json/gambit_results.json b/resources/regressions/lvr.json/gambit_results.json new file mode 100644 index 0000000..bac77ff --- /dev/null +++ b/resources/regressions/lvr.json/gambit_results.json @@ -0,0 +1,134 @@ +[ + { + "col": 24, + "description": "LiteralValueReplacement", + "diff": "--- original\n+++ mutant\n@@ -11,8 +11,9 @@\n int256 zero_s = 0;\n \n // Expect 1 mutant: 1\n+ /// LiteralValueReplacement(`0` |==> `1`) of: `uint256 zero = 0;`\n function unsigned_zero() public pure returns (uint256) {\n- uint256 zero = 0;\n+ uint256 zero = 1;\n return zero;\n }\n \n", + "id": "1", + "line": 15, + "name": "mutants/1/Ops/LVR/LVR.sol", + "op": "LVR", + "orig": "0", + "original": "Ops/LVR/LVR.sol", + "repl": "1" + }, + { + "col": 23, + "description": "LiteralValueReplacement", + "diff": "--- original\n+++ mutant\n@@ -17,8 +17,9 @@\n }\n \n // Expect 2 mutant: 0, 2\n+ /// LiteralValueReplacement(`1` |==> `0`) of: `uint256 one = 1;`\n function unsigned_one() public pure returns (uint256) {\n- uint256 one = 1;\n+ uint256 one = 0;\n return one;\n }\n \n", + "id": "2", + "line": 21, + "name": "mutants/2/Ops/LVR/LVR.sol", + "op": "LVR", + "orig": "1", + "original": "Ops/LVR/LVR.sol", + "repl": "0" + }, + { + "col": 23, + "description": "LiteralValueReplacement", + "diff": "--- original\n+++ mutant\n@@ -17,8 +17,9 @@\n }\n \n // Expect 2 mutant: 0, 2\n+ /// LiteralValueReplacement(`1` |==> `2`) of: `uint256 one = 1;`\n function unsigned_one() public pure returns (uint256) {\n- uint256 one = 1;\n+ uint256 one = 2;\n return one;\n }\n \n", + "id": "3", + "line": 21, + "name": "mutants/3/Ops/LVR/LVR.sol", + "op": "LVR", + "orig": "1", + "original": "Ops/LVR/LVR.sol", + "repl": "2" + }, + { + "col": 26, + "description": "LiteralValueReplacement", + "diff": "--- original\n+++ mutant\n@@ -23,8 +23,9 @@\n }\n \n // Expect 2 mutants: 0, 1\n+ /// LiteralValueReplacement(`-1` |==> `0`) of: `int256 neg_one = -1;`\n function signed_neg_one() public pure returns (int256) {\n- int256 neg_one = -1;\n+ int256 neg_one = 0;\n return neg_one;\n }\n \n", + "id": "4", + "line": 27, + "name": "mutants/4/Ops/LVR/LVR.sol", + "op": "LVR", + "orig": "-1", + "original": "Ops/LVR/LVR.sol", + "repl": "0" + }, + { + "col": 26, + "description": "LiteralValueReplacement", + "diff": "--- original\n+++ mutant\n@@ -23,8 +23,9 @@\n }\n \n // Expect 2 mutants: 0, 1\n+ /// LiteralValueReplacement(`-1` |==> `1`) of: `int256 neg_one = -1;`\n function signed_neg_one() public pure returns (int256) {\n- int256 neg_one = -1;\n+ int256 neg_one = 1;\n return neg_one;\n }\n \n", + "id": "5", + "line": 27, + "name": "mutants/5/Ops/LVR/LVR.sol", + "op": "LVR", + "orig": "-1", + "original": "Ops/LVR/LVR.sol", + "repl": "1" + }, + { + "col": 26, + "description": "LiteralValueReplacement", + "diff": "--- original\n+++ mutant\n@@ -23,8 +23,9 @@\n }\n \n // Expect 2 mutants: 0, 1\n+ /// LiteralValueReplacement(`-1` |==> `-2`) of: `int256 neg_one = -1;`\n function signed_neg_one() public pure returns (int256) {\n- int256 neg_one = -1;\n+ int256 neg_one = -2;\n return neg_one;\n }\n \n", + "id": "6", + "line": 27, + "name": "mutants/6/Ops/LVR/LVR.sol", + "op": "LVR", + "orig": "-1", + "original": "Ops/LVR/LVR.sol", + "repl": "-2" + }, + { + "col": 26, + "description": "LiteralValueReplacement", + "diff": "--- original\n+++ mutant\n@@ -29,8 +29,9 @@\n }\n \n // Expect 2 mutants: -1, 0\n+ /// LiteralValueReplacement(`1` |==> `0`) of: `int256 pos_one = 1;`\n function signed_pos_one() public pure returns (int256) {\n- int256 pos_one = 1;\n+ int256 pos_one = 0;\n return pos_one;\n }\n \n", + "id": "7", + "line": 33, + "name": "mutants/7/Ops/LVR/LVR.sol", + "op": "LVR", + "orig": "1", + "original": "Ops/LVR/LVR.sol", + "repl": "0" + }, + { + "col": 26, + "description": "LiteralValueReplacement", + "diff": "--- original\n+++ mutant\n@@ -29,8 +29,9 @@\n }\n \n // Expect 2 mutants: -1, 0\n+ /// LiteralValueReplacement(`1` |==> `-1`) of: `int256 pos_one = 1;`\n function signed_pos_one() public pure returns (int256) {\n- int256 pos_one = 1;\n+ int256 pos_one = -1;\n return pos_one;\n }\n \n", + "id": "8", + "line": 33, + "name": "mutants/8/Ops/LVR/LVR.sol", + "op": "LVR", + "orig": "1", + "original": "Ops/LVR/LVR.sol", + "repl": "-1" + }, + { + "col": 26, + "description": "LiteralValueReplacement", + "diff": "--- original\n+++ mutant\n@@ -29,8 +29,9 @@\n }\n \n // Expect 2 mutants: -1, 0\n+ /// LiteralValueReplacement(`1` |==> `2`) of: `int256 pos_one = 1;`\n function signed_pos_one() public pure returns (int256) {\n- int256 pos_one = 1;\n+ int256 pos_one = 2;\n return pos_one;\n }\n \n", + "id": "9", + "line": 33, + "name": "mutants/9/Ops/LVR/LVR.sol", + "op": "LVR", + "orig": "1", + "original": "Ops/LVR/LVR.sol", + "repl": "2" + }, + { + "col": 23, + "description": "LiteralValueReplacement", + "diff": "--- original\n+++ mutant\n@@ -35,8 +35,9 @@\n }\n \n // Expect 2 mutants: -1, 1\n+ /// LiteralValueReplacement(`0` |==> `-1`) of: `int256 zero = 0;`\n function signed_zero() public pure returns (int256) {\n- int256 zero = 0;\n+ int256 zero = -1;\n return zero;\n }\n }\n", + "id": "10", + "line": 39, + "name": "mutants/10/Ops/LVR/LVR.sol", + "op": "LVR", + "orig": "0", + "original": "Ops/LVR/LVR.sol", + "repl": "-1" + }, + { + "col": 23, + "description": "LiteralValueReplacement", + "diff": "--- original\n+++ mutant\n@@ -35,8 +35,9 @@\n }\n \n // Expect 2 mutants: -1, 1\n+ /// LiteralValueReplacement(`0` |==> `1`) of: `int256 zero = 0;`\n function signed_zero() public pure returns (int256) {\n- int256 zero = 0;\n+ int256 zero = 1;\n return zero;\n }\n }\n", + "id": "11", + "line": 39, + "name": "mutants/11/Ops/LVR/LVR.sol", + "op": "LVR", + "orig": "0", + "original": "Ops/LVR/LVR.sol", + "repl": "1" + } +] \ No newline at end of file diff --git a/resources/regressions/lvr.json/mutants.log b/resources/regressions/lvr.json/mutants.log new file mode 100644 index 0000000..e0b04fe --- /dev/null +++ b/resources/regressions/lvr.json/mutants.log @@ -0,0 +1,11 @@ +1,LVR,Ops/LVR/LVR.sol,15:24,0,1 +2,LVR,Ops/LVR/LVR.sol,21:23,1,0 +3,LVR,Ops/LVR/LVR.sol,21:23,1,2 +4,LVR,Ops/LVR/LVR.sol,27:26,-1,0 +5,LVR,Ops/LVR/LVR.sol,27:26,-1,1 +6,LVR,Ops/LVR/LVR.sol,27:26,-1,-2 +7,LVR,Ops/LVR/LVR.sol,33:26,1,0 +8,LVR,Ops/LVR/LVR.sol,33:26,1,-1 +9,LVR,Ops/LVR/LVR.sol,33:26,1,2 +10,LVR,Ops/LVR/LVR.sol,39:23,0,-1 +11,LVR,Ops/LVR/LVR.sol,39:23,0,1 diff --git a/resources/regressions/lvr.json/mutants/1/Ops/LVR/LVR.sol b/resources/regressions/lvr.json/mutants/1/Ops/LVR/LVR.sol new file mode 100644 index 0000000..e06271e --- /dev/null +++ b/resources/regressions/lvr.json/mutants/1/Ops/LVR/LVR.sol @@ -0,0 +1,43 @@ +// SPDX-License-Identifier: GPL-3.0-only +pragma solidity >0.7.0; +pragma experimental ABIEncoderV2; + +// This contract provides test functions for relational operator replacement (ROR) +contract LVR { + uint256 one_u = 1; + uint256 zero_u = 0; + int256 n_one_s = -1; + int256 one_s = 1; + int256 zero_s = 0; + + // Expect 1 mutant: 1 + /// LiteralValueReplacement(`0` |==> `1`) of: `uint256 zero = 0;` + function unsigned_zero() public pure returns (uint256) { + uint256 zero = 1; + return zero; + } + + // Expect 2 mutant: 0, 2 + function unsigned_one() public pure returns (uint256) { + uint256 one = 1; + return one; + } + + // Expect 2 mutants: 0, 1 + function signed_neg_one() public pure returns (int256) { + int256 neg_one = -1; + return neg_one; + } + + // Expect 2 mutants: -1, 0 + function signed_pos_one() public pure returns (int256) { + int256 pos_one = 1; + return pos_one; + } + + // Expect 2 mutants: -1, 1 + function signed_zero() public pure returns (int256) { + int256 zero = 0; + return zero; + } +} diff --git a/resources/regressions/lvr.json/mutants/10/Ops/LVR/LVR.sol b/resources/regressions/lvr.json/mutants/10/Ops/LVR/LVR.sol new file mode 100644 index 0000000..22af418 --- /dev/null +++ b/resources/regressions/lvr.json/mutants/10/Ops/LVR/LVR.sol @@ -0,0 +1,43 @@ +// SPDX-License-Identifier: GPL-3.0-only +pragma solidity >0.7.0; +pragma experimental ABIEncoderV2; + +// This contract provides test functions for relational operator replacement (ROR) +contract LVR { + uint256 one_u = 1; + uint256 zero_u = 0; + int256 n_one_s = -1; + int256 one_s = 1; + int256 zero_s = 0; + + // Expect 1 mutant: 1 + function unsigned_zero() public pure returns (uint256) { + uint256 zero = 0; + return zero; + } + + // Expect 2 mutant: 0, 2 + function unsigned_one() public pure returns (uint256) { + uint256 one = 1; + return one; + } + + // Expect 2 mutants: 0, 1 + function signed_neg_one() public pure returns (int256) { + int256 neg_one = -1; + return neg_one; + } + + // Expect 2 mutants: -1, 0 + function signed_pos_one() public pure returns (int256) { + int256 pos_one = 1; + return pos_one; + } + + // Expect 2 mutants: -1, 1 + /// LiteralValueReplacement(`0` |==> `-1`) of: `int256 zero = 0;` + function signed_zero() public pure returns (int256) { + int256 zero = -1; + return zero; + } +} diff --git a/resources/regressions/lvr.json/mutants/11/Ops/LVR/LVR.sol b/resources/regressions/lvr.json/mutants/11/Ops/LVR/LVR.sol new file mode 100644 index 0000000..e241973 --- /dev/null +++ b/resources/regressions/lvr.json/mutants/11/Ops/LVR/LVR.sol @@ -0,0 +1,43 @@ +// SPDX-License-Identifier: GPL-3.0-only +pragma solidity >0.7.0; +pragma experimental ABIEncoderV2; + +// This contract provides test functions for relational operator replacement (ROR) +contract LVR { + uint256 one_u = 1; + uint256 zero_u = 0; + int256 n_one_s = -1; + int256 one_s = 1; + int256 zero_s = 0; + + // Expect 1 mutant: 1 + function unsigned_zero() public pure returns (uint256) { + uint256 zero = 0; + return zero; + } + + // Expect 2 mutant: 0, 2 + function unsigned_one() public pure returns (uint256) { + uint256 one = 1; + return one; + } + + // Expect 2 mutants: 0, 1 + function signed_neg_one() public pure returns (int256) { + int256 neg_one = -1; + return neg_one; + } + + // Expect 2 mutants: -1, 0 + function signed_pos_one() public pure returns (int256) { + int256 pos_one = 1; + return pos_one; + } + + // Expect 2 mutants: -1, 1 + /// LiteralValueReplacement(`0` |==> `1`) of: `int256 zero = 0;` + function signed_zero() public pure returns (int256) { + int256 zero = 1; + return zero; + } +} diff --git a/resources/regressions/lvr.json/mutants/2/Ops/LVR/LVR.sol b/resources/regressions/lvr.json/mutants/2/Ops/LVR/LVR.sol new file mode 100644 index 0000000..f2cb829 --- /dev/null +++ b/resources/regressions/lvr.json/mutants/2/Ops/LVR/LVR.sol @@ -0,0 +1,43 @@ +// SPDX-License-Identifier: GPL-3.0-only +pragma solidity >0.7.0; +pragma experimental ABIEncoderV2; + +// This contract provides test functions for relational operator replacement (ROR) +contract LVR { + uint256 one_u = 1; + uint256 zero_u = 0; + int256 n_one_s = -1; + int256 one_s = 1; + int256 zero_s = 0; + + // Expect 1 mutant: 1 + function unsigned_zero() public pure returns (uint256) { + uint256 zero = 0; + return zero; + } + + // Expect 2 mutant: 0, 2 + /// LiteralValueReplacement(`1` |==> `0`) of: `uint256 one = 1;` + function unsigned_one() public pure returns (uint256) { + uint256 one = 0; + return one; + } + + // Expect 2 mutants: 0, 1 + function signed_neg_one() public pure returns (int256) { + int256 neg_one = -1; + return neg_one; + } + + // Expect 2 mutants: -1, 0 + function signed_pos_one() public pure returns (int256) { + int256 pos_one = 1; + return pos_one; + } + + // Expect 2 mutants: -1, 1 + function signed_zero() public pure returns (int256) { + int256 zero = 0; + return zero; + } +} diff --git a/resources/regressions/lvr.json/mutants/3/Ops/LVR/LVR.sol b/resources/regressions/lvr.json/mutants/3/Ops/LVR/LVR.sol new file mode 100644 index 0000000..d18c6c4 --- /dev/null +++ b/resources/regressions/lvr.json/mutants/3/Ops/LVR/LVR.sol @@ -0,0 +1,43 @@ +// SPDX-License-Identifier: GPL-3.0-only +pragma solidity >0.7.0; +pragma experimental ABIEncoderV2; + +// This contract provides test functions for relational operator replacement (ROR) +contract LVR { + uint256 one_u = 1; + uint256 zero_u = 0; + int256 n_one_s = -1; + int256 one_s = 1; + int256 zero_s = 0; + + // Expect 1 mutant: 1 + function unsigned_zero() public pure returns (uint256) { + uint256 zero = 0; + return zero; + } + + // Expect 2 mutant: 0, 2 + /// LiteralValueReplacement(`1` |==> `2`) of: `uint256 one = 1;` + function unsigned_one() public pure returns (uint256) { + uint256 one = 2; + return one; + } + + // Expect 2 mutants: 0, 1 + function signed_neg_one() public pure returns (int256) { + int256 neg_one = -1; + return neg_one; + } + + // Expect 2 mutants: -1, 0 + function signed_pos_one() public pure returns (int256) { + int256 pos_one = 1; + return pos_one; + } + + // Expect 2 mutants: -1, 1 + function signed_zero() public pure returns (int256) { + int256 zero = 0; + return zero; + } +} diff --git a/resources/regressions/lvr.json/mutants/4/Ops/LVR/LVR.sol b/resources/regressions/lvr.json/mutants/4/Ops/LVR/LVR.sol new file mode 100644 index 0000000..173dc54 --- /dev/null +++ b/resources/regressions/lvr.json/mutants/4/Ops/LVR/LVR.sol @@ -0,0 +1,43 @@ +// SPDX-License-Identifier: GPL-3.0-only +pragma solidity >0.7.0; +pragma experimental ABIEncoderV2; + +// This contract provides test functions for relational operator replacement (ROR) +contract LVR { + uint256 one_u = 1; + uint256 zero_u = 0; + int256 n_one_s = -1; + int256 one_s = 1; + int256 zero_s = 0; + + // Expect 1 mutant: 1 + function unsigned_zero() public pure returns (uint256) { + uint256 zero = 0; + return zero; + } + + // Expect 2 mutant: 0, 2 + function unsigned_one() public pure returns (uint256) { + uint256 one = 1; + return one; + } + + // Expect 2 mutants: 0, 1 + /// LiteralValueReplacement(`-1` |==> `0`) of: `int256 neg_one = -1;` + function signed_neg_one() public pure returns (int256) { + int256 neg_one = 0; + return neg_one; + } + + // Expect 2 mutants: -1, 0 + function signed_pos_one() public pure returns (int256) { + int256 pos_one = 1; + return pos_one; + } + + // Expect 2 mutants: -1, 1 + function signed_zero() public pure returns (int256) { + int256 zero = 0; + return zero; + } +} diff --git a/resources/regressions/lvr.json/mutants/5/Ops/LVR/LVR.sol b/resources/regressions/lvr.json/mutants/5/Ops/LVR/LVR.sol new file mode 100644 index 0000000..72ffaed --- /dev/null +++ b/resources/regressions/lvr.json/mutants/5/Ops/LVR/LVR.sol @@ -0,0 +1,43 @@ +// SPDX-License-Identifier: GPL-3.0-only +pragma solidity >0.7.0; +pragma experimental ABIEncoderV2; + +// This contract provides test functions for relational operator replacement (ROR) +contract LVR { + uint256 one_u = 1; + uint256 zero_u = 0; + int256 n_one_s = -1; + int256 one_s = 1; + int256 zero_s = 0; + + // Expect 1 mutant: 1 + function unsigned_zero() public pure returns (uint256) { + uint256 zero = 0; + return zero; + } + + // Expect 2 mutant: 0, 2 + function unsigned_one() public pure returns (uint256) { + uint256 one = 1; + return one; + } + + // Expect 2 mutants: 0, 1 + /// LiteralValueReplacement(`-1` |==> `1`) of: `int256 neg_one = -1;` + function signed_neg_one() public pure returns (int256) { + int256 neg_one = 1; + return neg_one; + } + + // Expect 2 mutants: -1, 0 + function signed_pos_one() public pure returns (int256) { + int256 pos_one = 1; + return pos_one; + } + + // Expect 2 mutants: -1, 1 + function signed_zero() public pure returns (int256) { + int256 zero = 0; + return zero; + } +} diff --git a/resources/regressions/lvr.json/mutants/6/Ops/LVR/LVR.sol b/resources/regressions/lvr.json/mutants/6/Ops/LVR/LVR.sol new file mode 100644 index 0000000..1e24417 --- /dev/null +++ b/resources/regressions/lvr.json/mutants/6/Ops/LVR/LVR.sol @@ -0,0 +1,43 @@ +// SPDX-License-Identifier: GPL-3.0-only +pragma solidity >0.7.0; +pragma experimental ABIEncoderV2; + +// This contract provides test functions for relational operator replacement (ROR) +contract LVR { + uint256 one_u = 1; + uint256 zero_u = 0; + int256 n_one_s = -1; + int256 one_s = 1; + int256 zero_s = 0; + + // Expect 1 mutant: 1 + function unsigned_zero() public pure returns (uint256) { + uint256 zero = 0; + return zero; + } + + // Expect 2 mutant: 0, 2 + function unsigned_one() public pure returns (uint256) { + uint256 one = 1; + return one; + } + + // Expect 2 mutants: 0, 1 + /// LiteralValueReplacement(`-1` |==> `-2`) of: `int256 neg_one = -1;` + function signed_neg_one() public pure returns (int256) { + int256 neg_one = -2; + return neg_one; + } + + // Expect 2 mutants: -1, 0 + function signed_pos_one() public pure returns (int256) { + int256 pos_one = 1; + return pos_one; + } + + // Expect 2 mutants: -1, 1 + function signed_zero() public pure returns (int256) { + int256 zero = 0; + return zero; + } +} diff --git a/resources/regressions/lvr.json/mutants/7/Ops/LVR/LVR.sol b/resources/regressions/lvr.json/mutants/7/Ops/LVR/LVR.sol new file mode 100644 index 0000000..e088a4e --- /dev/null +++ b/resources/regressions/lvr.json/mutants/7/Ops/LVR/LVR.sol @@ -0,0 +1,43 @@ +// SPDX-License-Identifier: GPL-3.0-only +pragma solidity >0.7.0; +pragma experimental ABIEncoderV2; + +// This contract provides test functions for relational operator replacement (ROR) +contract LVR { + uint256 one_u = 1; + uint256 zero_u = 0; + int256 n_one_s = -1; + int256 one_s = 1; + int256 zero_s = 0; + + // Expect 1 mutant: 1 + function unsigned_zero() public pure returns (uint256) { + uint256 zero = 0; + return zero; + } + + // Expect 2 mutant: 0, 2 + function unsigned_one() public pure returns (uint256) { + uint256 one = 1; + return one; + } + + // Expect 2 mutants: 0, 1 + function signed_neg_one() public pure returns (int256) { + int256 neg_one = -1; + return neg_one; + } + + // Expect 2 mutants: -1, 0 + /// LiteralValueReplacement(`1` |==> `0`) of: `int256 pos_one = 1;` + function signed_pos_one() public pure returns (int256) { + int256 pos_one = 0; + return pos_one; + } + + // Expect 2 mutants: -1, 1 + function signed_zero() public pure returns (int256) { + int256 zero = 0; + return zero; + } +} diff --git a/resources/regressions/lvr.json/mutants/8/Ops/LVR/LVR.sol b/resources/regressions/lvr.json/mutants/8/Ops/LVR/LVR.sol new file mode 100644 index 0000000..2407079 --- /dev/null +++ b/resources/regressions/lvr.json/mutants/8/Ops/LVR/LVR.sol @@ -0,0 +1,43 @@ +// SPDX-License-Identifier: GPL-3.0-only +pragma solidity >0.7.0; +pragma experimental ABIEncoderV2; + +// This contract provides test functions for relational operator replacement (ROR) +contract LVR { + uint256 one_u = 1; + uint256 zero_u = 0; + int256 n_one_s = -1; + int256 one_s = 1; + int256 zero_s = 0; + + // Expect 1 mutant: 1 + function unsigned_zero() public pure returns (uint256) { + uint256 zero = 0; + return zero; + } + + // Expect 2 mutant: 0, 2 + function unsigned_one() public pure returns (uint256) { + uint256 one = 1; + return one; + } + + // Expect 2 mutants: 0, 1 + function signed_neg_one() public pure returns (int256) { + int256 neg_one = -1; + return neg_one; + } + + // Expect 2 mutants: -1, 0 + /// LiteralValueReplacement(`1` |==> `-1`) of: `int256 pos_one = 1;` + function signed_pos_one() public pure returns (int256) { + int256 pos_one = -1; + return pos_one; + } + + // Expect 2 mutants: -1, 1 + function signed_zero() public pure returns (int256) { + int256 zero = 0; + return zero; + } +} diff --git a/resources/regressions/lvr.json/mutants/9/Ops/LVR/LVR.sol b/resources/regressions/lvr.json/mutants/9/Ops/LVR/LVR.sol new file mode 100644 index 0000000..a5082f3 --- /dev/null +++ b/resources/regressions/lvr.json/mutants/9/Ops/LVR/LVR.sol @@ -0,0 +1,43 @@ +// SPDX-License-Identifier: GPL-3.0-only +pragma solidity >0.7.0; +pragma experimental ABIEncoderV2; + +// This contract provides test functions for relational operator replacement (ROR) +contract LVR { + uint256 one_u = 1; + uint256 zero_u = 0; + int256 n_one_s = -1; + int256 one_s = 1; + int256 zero_s = 0; + + // Expect 1 mutant: 1 + function unsigned_zero() public pure returns (uint256) { + uint256 zero = 0; + return zero; + } + + // Expect 2 mutant: 0, 2 + function unsigned_one() public pure returns (uint256) { + uint256 one = 1; + return one; + } + + // Expect 2 mutants: 0, 1 + function signed_neg_one() public pure returns (int256) { + int256 neg_one = -1; + return neg_one; + } + + // Expect 2 mutants: -1, 0 + /// LiteralValueReplacement(`1` |==> `2`) of: `int256 pos_one = 1;` + function signed_pos_one() public pure returns (int256) { + int256 pos_one = 2; + return pos_one; + } + + // Expect 2 mutants: -1, 1 + function signed_zero() public pure returns (int256) { + int256 zero = 0; + return zero; + } +} diff --git a/resources/regressions/multiple-contracts-1.json/gambit_results.json b/resources/regressions/multiple-contracts-1.json/gambit_results.json deleted file mode 100644 index d6efe39..0000000 --- a/resources/regressions/multiple-contracts-1.json/gambit_results.json +++ /dev/null @@ -1,58 +0,0 @@ -[ - { - "description": "DeleteExpressionMutation", - "diff": "--- original\n+++ mutant\n@@ -4,7 +4,8 @@\n \n library Utils {\n function getarray(address[] memory c, address e) internal pure {\n- assert(c[0] == e);\n+ /// DeleteExpressionMutation(`assert(c[0] == e)` |==> `assert(true)`) of: `assert(c[0] == e);`\n+ assert(true);\n }\n \n function add(int8 a, int8 b) public pure returns (int8) {\n", - "id": "1", - "name": "mutants/1/MultipleContracts/C.sol", - "original": "MultipleContracts/C.sol", - }, - { - "description": "BinaryOpMutation", - "diff": "--- original\n+++ mutant\n@@ -21,7 +21,8 @@\n \n function get10PowerDecimals(uint8 decimals) public pure returns (uint256) {\n uint256 a = 10;\n- uint256 res = a ** decimals;\n+ /// BinaryOpMutation(`**` |==> `+`) of: `uint256 res = a ** decimals;`\n+ uint256 res = a+decimals;\n return res;\n }\n \n", - "id": "2", - "name": "mutants/2/MultipleContracts/C.sol", - "original": "MultipleContracts/C.sol", - }, - { - "description": "BinaryOpMutation", - "diff": "--- original\n+++ mutant\n@@ -21,7 +21,8 @@\n \n function get10PowerDecimals(uint8 decimals) public pure returns (uint256) {\n uint256 a = 10;\n- uint256 res = a ** decimals;\n+ /// BinaryOpMutation(`**` |==> `-`) of: `uint256 res = a ** decimals;`\n+ uint256 res = a-decimals;\n return res;\n }\n \n", - "id": "3", - "name": "mutants/3/MultipleContracts/C.sol", - "original": "MultipleContracts/C.sol", - }, - { - "description": "BinaryOpMutation", - "diff": "--- original\n+++ mutant\n@@ -21,7 +21,8 @@\n \n function get10PowerDecimals(uint8 decimals) public pure returns (uint256) {\n uint256 a = 10;\n- uint256 res = a ** decimals;\n+ /// BinaryOpMutation(`**` |==> `*`) of: `uint256 res = a ** decimals;`\n+ uint256 res = a*decimals;\n return res;\n }\n \n", - "id": "4", - "name": "mutants/4/MultipleContracts/C.sol", - "original": "MultipleContracts/C.sol", - }, - { - "description": "BinaryOpMutation", - "diff": "--- original\n+++ mutant\n@@ -21,7 +21,8 @@\n \n function get10PowerDecimals(uint8 decimals) public pure returns (uint256) {\n uint256 a = 10;\n- uint256 res = a ** decimals;\n+ /// BinaryOpMutation(`**` |==> `/`) of: `uint256 res = a ** decimals;`\n+ uint256 res = a/decimals;\n return res;\n }\n \n", - "id": "5", - "name": "mutants/5/MultipleContracts/C.sol", - "original": "MultipleContracts/C.sol", - }, - { - "description": "BinaryOpMutation", - "diff": "--- original\n+++ mutant\n@@ -21,7 +21,8 @@\n \n function get10PowerDecimals(uint8 decimals) public pure returns (uint256) {\n uint256 a = 10;\n- uint256 res = a ** decimals;\n+ /// BinaryOpMutation(`**` |==> `%`) of: `uint256 res = a ** decimals;`\n+ uint256 res = a%decimals;\n return res;\n }\n \n", - "id": "6", - "name": "mutants/6/MultipleContracts/C.sol", - "original": "MultipleContracts/C.sol", - }, - { - "description": "SwapArgumentsOperatorMutation", - "diff": "--- original\n+++ mutant\n@@ -21,7 +21,8 @@\n \n function get10PowerDecimals(uint8 decimals) public pure returns (uint256) {\n uint256 a = 10;\n- uint256 res = a ** decimals;\n+ /// SwapArgumentsOperatorMutation(`a ** decimals` |==> `decimals ** a`) of: `uint256 res = a ** decimals;`\n+ uint256 res = decimals ** a;\n return res;\n }\n \n", - "id": "7", - "name": "mutants/7/MultipleContracts/C.sol", - "original": "MultipleContracts/C.sol", - }, - { - "description": "DeleteExpressionMutation", - "diff": "--- original\n+++ mutant\n@@ -26,7 +26,8 @@\n }\n \n function getarray(address[] memory c, address e) public pure {\n- assert(c[0] == e);\n+ /// DeleteExpressionMutation(`assert(c[0] == e)` |==> `assert(true)`) of: `assert(c[0] == e);`\n+ assert(true);\n }\n \n function callmyself() external view {\n", - "id": "8", - "name": "mutants/8/MultipleContracts/C.sol", - "original": "MultipleContracts/C.sol", - } -] \ No newline at end of file diff --git a/resources/regressions/multiple-contracts-1.json/input_json/C.sol_json.ast b/resources/regressions/multiple-contracts-1.json/input_json/C.sol_json.ast deleted file mode 100644 index a3306b6..0000000 --- a/resources/regressions/multiple-contracts-1.json/input_json/C.sol_json.ast +++ /dev/null @@ -1,1828 +0,0 @@ -{ - "absolutePath": "benchmarks/MultipleContracts/C.sol", - "exportedSymbols": - { - "C": - [ - 135 - ], - "Utils": - [ - 33 - ] - }, - "id": 136, - "license": "GPL-3.0-only", - "nodeType": "SourceUnit", - "nodes": - [ - { - "id": 1, - "literals": - [ - "solidity", - "^", - "0.8", - ".13" - ], - "nodeType": "PragmaDirective", - "src": "42:24:0" - }, - { - "abstract": false, - "baseContracts": [], - "canonicalName": "Utils", - "contractDependencies": [], - "contractKind": "library", - "fullyImplemented": true, - "id": 33, - "linearizedBaseContracts": - [ - 33 - ], - "name": "Utils", - "nameLocation": "76:5:0", - "nodeType": "ContractDefinition", - "nodes": - [ - { - "body": - { - "id": 17, - "nodeType": "Block", - "src": "151:34:0", - "statements": - [ - { - "expression": - { - "arguments": - [ - { - "commonType": - { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "id": 14, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": - { - "baseExpression": - { - "id": 10, - "name": "c", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4, - "src": "168:1:0", - "typeDescriptions": - { - "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", - "typeString": "address[] memory" - } - }, - "id": 12, - "indexExpression": - { - "hexValue": "30", - "id": 11, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "170:1:0", - "typeDescriptions": - { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - }, - "value": "0" - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "168:4:0", - "typeDescriptions": - { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "nodeType": "BinaryOperation", - "operator": "==", - "rightExpression": - { - "id": 13, - "name": "e", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 6, - "src": "176:1:0", - "typeDescriptions": - { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "src": "168:9:0", - "typeDescriptions": - { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - } - ], - "expression": - { - "argumentTypes": - [ - { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - ], - "id": 9, - "name": "assert", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": -3, - "src": "161:6:0", - "typeDescriptions": - { - "typeIdentifier": "t_function_assert_pure$_t_bool_$returns$__$", - "typeString": "function (bool) pure" - } - }, - "id": 15, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "161:17:0", - "tryCall": false, - "typeDescriptions": - { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 16, - "nodeType": "ExpressionStatement", - "src": "161:17:0" - } - ] - }, - "id": 18, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "getarray", - "nameLocation": "97:8:0", - "nodeType": "FunctionDefinition", - "parameters": - { - "id": 7, - "nodeType": "ParameterList", - "parameters": - [ - { - "constant": false, - "id": 4, - "mutability": "mutable", - "name": "c", - "nameLocation": "123:1:0", - "nodeType": "VariableDeclaration", - "scope": 18, - "src": "106:18:0", - "stateVariable": false, - "storageLocation": "memory", - "typeDescriptions": - { - "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", - "typeString": "address[]" - }, - "typeName": - { - "baseType": - { - "id": 2, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "106:7:0", - "stateMutability": "nonpayable", - "typeDescriptions": - { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "id": 3, - "nodeType": "ArrayTypeName", - "src": "106:9:0", - "typeDescriptions": - { - "typeIdentifier": "t_array$_t_address_$dyn_storage_ptr", - "typeString": "address[]" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 6, - "mutability": "mutable", - "name": "e", - "nameLocation": "134:1:0", - "nodeType": "VariableDeclaration", - "scope": 18, - "src": "126:9:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": - { - "id": 5, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "126:7:0", - "stateMutability": "nonpayable", - "typeDescriptions": - { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "visibility": "internal" - } - ], - "src": "105:31:0" - }, - "returnParameters": - { - "id": 8, - "nodeType": "ParameterList", - "parameters": [], - "src": "151:0:0" - }, - "scope": 33, - "src": "88:97:0", - "stateMutability": "pure", - "virtual": false, - "visibility": "internal" - }, - { - "body": - { - "id": 31, - "nodeType": "Block", - "src": "247:29:0", - "statements": - [ - { - "expression": - { - "commonType": - { - "typeIdentifier": "t_int8", - "typeString": "int8" - }, - "id": 29, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": - { - "id": 27, - "name": "a", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 20, - "src": "264:1:0", - "typeDescriptions": - { - "typeIdentifier": "t_int8", - "typeString": "int8" - } - }, - "nodeType": "BinaryOperation", - "operator": "+", - "rightExpression": - { - "id": 28, - "name": "b", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 22, - "src": "268:1:0", - "typeDescriptions": - { - "typeIdentifier": "t_int8", - "typeString": "int8" - } - }, - "src": "264:5:0", - "typeDescriptions": - { - "typeIdentifier": "t_int8", - "typeString": "int8" - } - }, - "functionReturnParameters": 26, - "id": 30, - "nodeType": "Return", - "src": "257:12:0" - } - ] - }, - "functionSelector": "e2666777", - "id": 32, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "add", - "nameLocation": "200:3:0", - "nodeType": "FunctionDefinition", - "parameters": - { - "id": 23, - "nodeType": "ParameterList", - "parameters": - [ - { - "constant": false, - "id": 20, - "mutability": "mutable", - "name": "a", - "nameLocation": "209:1:0", - "nodeType": "VariableDeclaration", - "scope": 32, - "src": "204:6:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_int8", - "typeString": "int8" - }, - "typeName": - { - "id": 19, - "name": "int8", - "nodeType": "ElementaryTypeName", - "src": "204:4:0", - "typeDescriptions": - { - "typeIdentifier": "t_int8", - "typeString": "int8" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 22, - "mutability": "mutable", - "name": "b", - "nameLocation": "217:1:0", - "nodeType": "VariableDeclaration", - "scope": 32, - "src": "212:6:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_int8", - "typeString": "int8" - }, - "typeName": - { - "id": 21, - "name": "int8", - "nodeType": "ElementaryTypeName", - "src": "212:4:0", - "typeDescriptions": - { - "typeIdentifier": "t_int8", - "typeString": "int8" - } - }, - "visibility": "internal" - } - ], - "src": "203:16:0" - }, - "returnParameters": - { - "id": 26, - "nodeType": "ParameterList", - "parameters": - [ - { - "constant": false, - "id": 25, - "mutability": "mutable", - "name": "", - "nameLocation": "-1:-1:-1", - "nodeType": "VariableDeclaration", - "scope": 32, - "src": "241:4:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_int8", - "typeString": "int8" - }, - "typeName": - { - "id": 24, - "name": "int8", - "nodeType": "ElementaryTypeName", - "src": "241:4:0", - "typeDescriptions": - { - "typeIdentifier": "t_int8", - "typeString": "int8" - } - }, - "visibility": "internal" - } - ], - "src": "240:6:0" - }, - "scope": 33, - "src": "191:85:0", - "stateMutability": "pure", - "virtual": false, - "visibility": "public" - } - ], - "scope": 136, - "src": "68:210:0", - "usedErrors": [] - }, - { - "abstract": false, - "baseContracts": [], - "canonicalName": "C", - "contractDependencies": [], - "contractKind": "contract", - "fullyImplemented": true, - "id": 135, - "linearizedBaseContracts": - [ - 135 - ], - "name": "C", - "nameLocation": "289:1:0", - "nodeType": "ContractDefinition", - "nodes": - [ - { - "body": - { - "id": 59, - "nodeType": "Block", - "src": "353:99:0", - "statements": - [ - { - "assignments": - [ - 43 - ], - "declarations": - [ - { - "constant": false, - "id": 43, - "mutability": "mutable", - "name": "a", - "nameLocation": "380:1:0", - "nodeType": "VariableDeclaration", - "scope": 59, - "src": "363:18:0", - "stateVariable": false, - "storageLocation": "memory", - "typeDescriptions": - { - "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", - "typeString": "address[]" - }, - "typeName": - { - "baseType": - { - "id": 41, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "363:7:0", - "typeDescriptions": - { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "id": 42, - "nodeType": "ArrayTypeName", - "src": "363:9:0", - "typeDescriptions": - { - "typeIdentifier": "t_array$_t_address_$dyn_storage_ptr", - "typeString": "address[]" - } - }, - "visibility": "internal" - } - ], - "id": 49, - "initialValue": - { - "arguments": - [ - { - "hexValue": "31", - "id": 47, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "398:1:0", - "typeDescriptions": - { - "typeIdentifier": "t_rational_1_by_1", - "typeString": "int_const 1" - }, - "value": "1" - } - ], - "expression": - { - "argumentTypes": - [ - { - "typeIdentifier": "t_rational_1_by_1", - "typeString": "int_const 1" - } - ], - "id": 46, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "nodeType": "NewExpression", - "src": "384:13:0", - "typeDescriptions": - { - "typeIdentifier": "t_function_objectcreation_pure$_t_uint256_$returns$_t_array$_t_address_$dyn_memory_ptr_$", - "typeString": "function (uint256) pure returns (address[] memory)" - }, - "typeName": - { - "baseType": - { - "id": 44, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "388:7:0", - "stateMutability": "nonpayable", - "typeDescriptions": - { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "id": 45, - "nodeType": "ArrayTypeName", - "src": "388:9:0", - "typeDescriptions": - { - "typeIdentifier": "t_array$_t_address_$dyn_storage_ptr", - "typeString": "address[]" - } - } - }, - "id": 48, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "384:16:0", - "tryCall": false, - "typeDescriptions": - { - "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", - "typeString": "address[] memory" - } - }, - "nodeType": "VariableDeclarationStatement", - "src": "363:37:0" - }, - { - "expression": - { - "id": 55, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": - { - "baseExpression": - { - "id": 50, - "name": "a", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 43, - "src": "410:1:0", - "typeDescriptions": - { - "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", - "typeString": "address[] memory" - } - }, - "id": 52, - "indexExpression": - { - "hexValue": "30", - "id": 51, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "412:1:0", - "typeDescriptions": - { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - }, - "value": "0" - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": true, - "nodeType": "IndexAccess", - "src": "410:4:0", - "typeDescriptions": - { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": - { - "expression": - { - "id": 53, - "name": "msg", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": -15, - "src": "417:3:0", - "typeDescriptions": - { - "typeIdentifier": "t_magic_message", - "typeString": "msg" - } - }, - "id": 54, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "sender", - "nodeType": "MemberAccess", - "src": "417:10:0", - "typeDescriptions": - { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "src": "410:17:0", - "typeDescriptions": - { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "id": 56, - "nodeType": "ExpressionStatement", - "src": "410:17:0" - }, - { - "expression": - { - "id": 57, - "name": "a", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 43, - "src": "444:1:0", - "typeDescriptions": - { - "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", - "typeString": "address[] memory" - } - }, - "functionReturnParameters": 38, - "id": 58, - "nodeType": "Return", - "src": "437:8:0" - } - ] - }, - "functionSelector": "c2985578", - "id": 60, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "foo", - "nameLocation": "306:3:0", - "nodeType": "FunctionDefinition", - "parameters": - { - "id": 34, - "nodeType": "ParameterList", - "parameters": [], - "src": "309:2:0" - }, - "returnParameters": - { - "id": 38, - "nodeType": "ParameterList", - "parameters": - [ - { - "constant": false, - "id": 37, - "mutability": "mutable", - "name": "", - "nameLocation": "-1:-1:-1", - "nodeType": "VariableDeclaration", - "scope": 60, - "src": "335:16:0", - "stateVariable": false, - "storageLocation": "memory", - "typeDescriptions": - { - "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", - "typeString": "address[]" - }, - "typeName": - { - "baseType": - { - "id": 35, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "335:7:0", - "stateMutability": "nonpayable", - "typeDescriptions": - { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "id": 36, - "nodeType": "ArrayTypeName", - "src": "335:9:0", - "typeDescriptions": - { - "typeIdentifier": "t_array$_t_address_$dyn_storage_ptr", - "typeString": "address[]" - } - }, - "visibility": "internal" - } - ], - "src": "334:18:0" - }, - "scope": 135, - "src": "297:155:0", - "stateMutability": "view", - "virtual": false, - "visibility": "external" - }, - { - "body": - { - "id": 79, - "nodeType": "Block", - "src": "532:88:0", - "statements": - [ - { - "assignments": - [ - 68 - ], - "declarations": - [ - { - "constant": false, - "id": 68, - "mutability": "mutable", - "name": "a", - "nameLocation": "550:1:0", - "nodeType": "VariableDeclaration", - "scope": 79, - "src": "542:9:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": - { - "id": 67, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "542:7:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - } - ], - "id": 70, - "initialValue": - { - "hexValue": "3130", - "id": 69, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "554:2:0", - "typeDescriptions": - { - "typeIdentifier": "t_rational_10_by_1", - "typeString": "int_const 10" - }, - "value": "10" - }, - "nodeType": "VariableDeclarationStatement", - "src": "542:14:0" - }, - { - "assignments": - [ - 72 - ], - "declarations": - [ - { - "constant": false, - "id": 72, - "mutability": "mutable", - "name": "res", - "nameLocation": "574:3:0", - "nodeType": "VariableDeclaration", - "scope": 79, - "src": "566:11:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": - { - "id": 71, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "566:7:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - } - ], - "id": 76, - "initialValue": - { - "commonType": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 75, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": - { - "id": 73, - "name": "a", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 68, - "src": "580:1:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "**", - "rightExpression": - { - "id": 74, - "name": "decimals", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 62, - "src": "585:8:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - } - }, - "src": "580:13:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "VariableDeclarationStatement", - "src": "566:27:0" - }, - { - "expression": - { - "id": 77, - "name": "res", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 72, - "src": "610:3:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "functionReturnParameters": 66, - "id": 78, - "nodeType": "Return", - "src": "603:10:0" - } - ] - }, - "functionSelector": "eb79f1be", - "id": 80, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "get10PowerDecimals", - "nameLocation": "467:18:0", - "nodeType": "FunctionDefinition", - "parameters": - { - "id": 63, - "nodeType": "ParameterList", - "parameters": - [ - { - "constant": false, - "id": 62, - "mutability": "mutable", - "name": "decimals", - "nameLocation": "492:8:0", - "nodeType": "VariableDeclaration", - "scope": 80, - "src": "486:14:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - }, - "typeName": - { - "id": 61, - "name": "uint8", - "nodeType": "ElementaryTypeName", - "src": "486:5:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - } - }, - "visibility": "internal" - } - ], - "src": "485:16:0" - }, - "returnParameters": - { - "id": 66, - "nodeType": "ParameterList", - "parameters": - [ - { - "constant": false, - "id": 65, - "mutability": "mutable", - "name": "", - "nameLocation": "-1:-1:-1", - "nodeType": "VariableDeclaration", - "scope": 80, - "src": "523:7:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": - { - "id": 64, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "523:7:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - } - ], - "src": "522:9:0" - }, - "scope": 135, - "src": "458:162:0", - "stateMutability": "pure", - "virtual": false, - "visibility": "public" - }, - { - "body": - { - "id": 96, - "nodeType": "Block", - "src": "687:34:0", - "statements": - [ - { - "expression": - { - "arguments": - [ - { - "commonType": - { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "id": 93, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": - { - "baseExpression": - { - "id": 89, - "name": "c", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 83, - "src": "704:1:0", - "typeDescriptions": - { - "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", - "typeString": "address[] memory" - } - }, - "id": 91, - "indexExpression": - { - "hexValue": "30", - "id": 90, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "706:1:0", - "typeDescriptions": - { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - }, - "value": "0" - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "704:4:0", - "typeDescriptions": - { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "nodeType": "BinaryOperation", - "operator": "==", - "rightExpression": - { - "id": 92, - "name": "e", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 85, - "src": "712:1:0", - "typeDescriptions": - { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "src": "704:9:0", - "typeDescriptions": - { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - } - ], - "expression": - { - "argumentTypes": - [ - { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - ], - "id": 88, - "name": "assert", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": -3, - "src": "697:6:0", - "typeDescriptions": - { - "typeIdentifier": "t_function_assert_pure$_t_bool_$returns$__$", - "typeString": "function (bool) pure" - } - }, - "id": 94, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "697:17:0", - "tryCall": false, - "typeDescriptions": - { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 95, - "nodeType": "ExpressionStatement", - "src": "697:17:0" - } - ] - }, - "functionSelector": "e5b2857b", - "id": 97, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "getarray", - "nameLocation": "635:8:0", - "nodeType": "FunctionDefinition", - "parameters": - { - "id": 86, - "nodeType": "ParameterList", - "parameters": - [ - { - "constant": false, - "id": 83, - "mutability": "mutable", - "name": "c", - "nameLocation": "661:1:0", - "nodeType": "VariableDeclaration", - "scope": 97, - "src": "644:18:0", - "stateVariable": false, - "storageLocation": "memory", - "typeDescriptions": - { - "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", - "typeString": "address[]" - }, - "typeName": - { - "baseType": - { - "id": 81, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "644:7:0", - "stateMutability": "nonpayable", - "typeDescriptions": - { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "id": 82, - "nodeType": "ArrayTypeName", - "src": "644:9:0", - "typeDescriptions": - { - "typeIdentifier": "t_array$_t_address_$dyn_storage_ptr", - "typeString": "address[]" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 85, - "mutability": "mutable", - "name": "e", - "nameLocation": "672:1:0", - "nodeType": "VariableDeclaration", - "scope": 97, - "src": "664:9:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": - { - "id": 84, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "664:7:0", - "stateMutability": "nonpayable", - "typeDescriptions": - { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "visibility": "internal" - } - ], - "src": "643:31:0" - }, - "returnParameters": - { - "id": 87, - "nodeType": "ParameterList", - "parameters": [], - "src": "687:0:0" - }, - "scope": 135, - "src": "626:95:0", - "stateMutability": "pure", - "virtual": false, - "visibility": "public" - }, - { - "body": - { - "id": 119, - "nodeType": "Block", - "src": "763:90:0", - "statements": - [ - { - "assignments": - [ - 104 - ], - "declarations": - [ - { - "constant": false, - "id": 104, - "mutability": "mutable", - "name": "b", - "nameLocation": "790:1:0", - "nodeType": "VariableDeclaration", - "scope": 119, - "src": "773:18:0", - "stateVariable": false, - "storageLocation": "memory", - "typeDescriptions": - { - "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", - "typeString": "address[]" - }, - "typeName": - { - "baseType": - { - "id": 102, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "773:7:0", - "typeDescriptions": - { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "id": 103, - "nodeType": "ArrayTypeName", - "src": "773:9:0", - "typeDescriptions": - { - "typeIdentifier": "t_array$_t_address_$dyn_storage_ptr", - "typeString": "address[]" - } - }, - "visibility": "internal" - } - ], - "id": 108, - "initialValue": - { - "arguments": [], - "expression": - { - "argumentTypes": [], - "expression": - { - "id": 105, - "name": "this", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": -28, - "src": "794:4:0", - "typeDescriptions": - { - "typeIdentifier": "t_contract$_C_$135", - "typeString": "contract C" - } - }, - "id": 106, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "foo", - "nodeType": "MemberAccess", - "referencedDeclaration": 60, - "src": "794:8:0", - "typeDescriptions": - { - "typeIdentifier": "t_function_external_view$__$returns$_t_array$_t_address_$dyn_memory_ptr_$", - "typeString": "function () view external returns (address[] memory)" - } - }, - "id": 107, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "794:10:0", - "tryCall": false, - "typeDescriptions": - { - "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", - "typeString": "address[] memory" - } - }, - "nodeType": "VariableDeclarationStatement", - "src": "773:31:0" - }, - { - "expression": - { - "arguments": - [ - { - "id": 112, - "name": "b", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 104, - "src": "829:1:0", - "typeDescriptions": - { - "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", - "typeString": "address[] memory" - } - }, - { - "arguments": - [ - { - "id": 115, - "name": "this", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": -28, - "src": "840:4:0", - "typeDescriptions": - { - "typeIdentifier": "t_contract$_C_$135", - "typeString": "contract C" - } - } - ], - "expression": - { - "argumentTypes": - [ - { - "typeIdentifier": "t_contract$_C_$135", - "typeString": "contract C" - } - ], - "id": 114, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "nodeType": "ElementaryTypeNameExpression", - "src": "832:7:0", - "typeDescriptions": - { - "typeIdentifier": "t_type$_t_address_$", - "typeString": "type(address)" - }, - "typeName": - { - "id": 113, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "832:7:0", - "typeDescriptions": {} - } - }, - "id": 116, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "typeConversion", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "832:13:0", - "tryCall": false, - "typeDescriptions": - { - "typeIdentifier": "t_address", - "typeString": "address" - } - } - ], - "expression": - { - "argumentTypes": - [ - { - "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", - "typeString": "address[] memory" - }, - { - "typeIdentifier": "t_address", - "typeString": "address" - } - ], - "expression": - { - "id": 109, - "name": "Utils", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 33, - "src": "814:5:0", - "typeDescriptions": - { - "typeIdentifier": "t_type$_t_contract$_Utils_$33_$", - "typeString": "type(library Utils)" - } - }, - "id": 111, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "getarray", - "nodeType": "MemberAccess", - "referencedDeclaration": 18, - "src": "814:14:0", - "typeDescriptions": - { - "typeIdentifier": "t_function_internal_pure$_t_array$_t_address_$dyn_memory_ptr_$_t_address_$returns$__$", - "typeString": "function (address[] memory,address) pure" - } - }, - "id": 117, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "814:32:0", - "tryCall": false, - "typeDescriptions": - { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 118, - "nodeType": "ExpressionStatement", - "src": "814:32:0" - } - ] - }, - "functionSelector": "d3ab473b", - "id": 120, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "callmyself", - "nameLocation": "736:10:0", - "nodeType": "FunctionDefinition", - "parameters": - { - "id": 98, - "nodeType": "ParameterList", - "parameters": [], - "src": "746:2:0" - }, - "returnParameters": - { - "id": 99, - "nodeType": "ParameterList", - "parameters": [], - "src": "763:0:0" - }, - "scope": 135, - "src": "727:126:0", - "stateMutability": "view", - "virtual": false, - "visibility": "external" - }, - { - "body": - { - "id": 133, - "nodeType": "Block", - "src": "915:29:0", - "statements": - [ - { - "expression": - { - "commonType": - { - "typeIdentifier": "t_int8", - "typeString": "int8" - }, - "id": 131, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": - { - "id": 129, - "name": "c", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 122, - "src": "932:1:0", - "typeDescriptions": - { - "typeIdentifier": "t_int8", - "typeString": "int8" - } - }, - "nodeType": "BinaryOperation", - "operator": "+", - "rightExpression": - { - "id": 130, - "name": "d", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 124, - "src": "936:1:0", - "typeDescriptions": - { - "typeIdentifier": "t_int8", - "typeString": "int8" - } - }, - "src": "932:5:0", - "typeDescriptions": - { - "typeIdentifier": "t_int8", - "typeString": "int8" - } - }, - "functionReturnParameters": 128, - "id": 132, - "nodeType": "Return", - "src": "925:12:0" - } - ] - }, - "functionSelector": "e2666777", - "id": 134, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "add", - "nameLocation": "868:3:0", - "nodeType": "FunctionDefinition", - "parameters": - { - "id": 125, - "nodeType": "ParameterList", - "parameters": - [ - { - "constant": false, - "id": 122, - "mutability": "mutable", - "name": "c", - "nameLocation": "877:1:0", - "nodeType": "VariableDeclaration", - "scope": 134, - "src": "872:6:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_int8", - "typeString": "int8" - }, - "typeName": - { - "id": 121, - "name": "int8", - "nodeType": "ElementaryTypeName", - "src": "872:4:0", - "typeDescriptions": - { - "typeIdentifier": "t_int8", - "typeString": "int8" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 124, - "mutability": "mutable", - "name": "d", - "nameLocation": "885:1:0", - "nodeType": "VariableDeclaration", - "scope": 134, - "src": "880:6:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_int8", - "typeString": "int8" - }, - "typeName": - { - "id": 123, - "name": "int8", - "nodeType": "ElementaryTypeName", - "src": "880:4:0", - "typeDescriptions": - { - "typeIdentifier": "t_int8", - "typeString": "int8" - } - }, - "visibility": "internal" - } - ], - "src": "871:16:0" - }, - "returnParameters": - { - "id": 128, - "nodeType": "ParameterList", - "parameters": - [ - { - "constant": false, - "id": 127, - "mutability": "mutable", - "name": "", - "nameLocation": "-1:-1:-1", - "nodeType": "VariableDeclaration", - "scope": 134, - "src": "909:4:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_int8", - "typeString": "int8" - }, - "typeName": - { - "id": 126, - "name": "int8", - "nodeType": "ElementaryTypeName", - "src": "909:4:0", - "typeDescriptions": - { - "typeIdentifier": "t_int8", - "typeString": "int8" - } - }, - "visibility": "internal" - } - ], - "src": "908:6:0" - }, - "scope": 135, - "src": "859:85:0", - "stateMutability": "pure", - "virtual": false, - "visibility": "public" - } - ], - "scope": 136, - "src": "280:666:0", - "usedErrors": [] - } - ], - "src": "42:905:0" -} \ No newline at end of file diff --git a/resources/regressions/multiple-contracts-1.json/input_json/C.sol_json.ast.json b/resources/regressions/multiple-contracts-1.json/input_json/C.sol_json.ast.json deleted file mode 100644 index a3306b6..0000000 --- a/resources/regressions/multiple-contracts-1.json/input_json/C.sol_json.ast.json +++ /dev/null @@ -1,1828 +0,0 @@ -{ - "absolutePath": "benchmarks/MultipleContracts/C.sol", - "exportedSymbols": - { - "C": - [ - 135 - ], - "Utils": - [ - 33 - ] - }, - "id": 136, - "license": "GPL-3.0-only", - "nodeType": "SourceUnit", - "nodes": - [ - { - "id": 1, - "literals": - [ - "solidity", - "^", - "0.8", - ".13" - ], - "nodeType": "PragmaDirective", - "src": "42:24:0" - }, - { - "abstract": false, - "baseContracts": [], - "canonicalName": "Utils", - "contractDependencies": [], - "contractKind": "library", - "fullyImplemented": true, - "id": 33, - "linearizedBaseContracts": - [ - 33 - ], - "name": "Utils", - "nameLocation": "76:5:0", - "nodeType": "ContractDefinition", - "nodes": - [ - { - "body": - { - "id": 17, - "nodeType": "Block", - "src": "151:34:0", - "statements": - [ - { - "expression": - { - "arguments": - [ - { - "commonType": - { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "id": 14, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": - { - "baseExpression": - { - "id": 10, - "name": "c", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4, - "src": "168:1:0", - "typeDescriptions": - { - "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", - "typeString": "address[] memory" - } - }, - "id": 12, - "indexExpression": - { - "hexValue": "30", - "id": 11, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "170:1:0", - "typeDescriptions": - { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - }, - "value": "0" - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "168:4:0", - "typeDescriptions": - { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "nodeType": "BinaryOperation", - "operator": "==", - "rightExpression": - { - "id": 13, - "name": "e", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 6, - "src": "176:1:0", - "typeDescriptions": - { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "src": "168:9:0", - "typeDescriptions": - { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - } - ], - "expression": - { - "argumentTypes": - [ - { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - ], - "id": 9, - "name": "assert", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": -3, - "src": "161:6:0", - "typeDescriptions": - { - "typeIdentifier": "t_function_assert_pure$_t_bool_$returns$__$", - "typeString": "function (bool) pure" - } - }, - "id": 15, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "161:17:0", - "tryCall": false, - "typeDescriptions": - { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 16, - "nodeType": "ExpressionStatement", - "src": "161:17:0" - } - ] - }, - "id": 18, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "getarray", - "nameLocation": "97:8:0", - "nodeType": "FunctionDefinition", - "parameters": - { - "id": 7, - "nodeType": "ParameterList", - "parameters": - [ - { - "constant": false, - "id": 4, - "mutability": "mutable", - "name": "c", - "nameLocation": "123:1:0", - "nodeType": "VariableDeclaration", - "scope": 18, - "src": "106:18:0", - "stateVariable": false, - "storageLocation": "memory", - "typeDescriptions": - { - "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", - "typeString": "address[]" - }, - "typeName": - { - "baseType": - { - "id": 2, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "106:7:0", - "stateMutability": "nonpayable", - "typeDescriptions": - { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "id": 3, - "nodeType": "ArrayTypeName", - "src": "106:9:0", - "typeDescriptions": - { - "typeIdentifier": "t_array$_t_address_$dyn_storage_ptr", - "typeString": "address[]" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 6, - "mutability": "mutable", - "name": "e", - "nameLocation": "134:1:0", - "nodeType": "VariableDeclaration", - "scope": 18, - "src": "126:9:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": - { - "id": 5, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "126:7:0", - "stateMutability": "nonpayable", - "typeDescriptions": - { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "visibility": "internal" - } - ], - "src": "105:31:0" - }, - "returnParameters": - { - "id": 8, - "nodeType": "ParameterList", - "parameters": [], - "src": "151:0:0" - }, - "scope": 33, - "src": "88:97:0", - "stateMutability": "pure", - "virtual": false, - "visibility": "internal" - }, - { - "body": - { - "id": 31, - "nodeType": "Block", - "src": "247:29:0", - "statements": - [ - { - "expression": - { - "commonType": - { - "typeIdentifier": "t_int8", - "typeString": "int8" - }, - "id": 29, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": - { - "id": 27, - "name": "a", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 20, - "src": "264:1:0", - "typeDescriptions": - { - "typeIdentifier": "t_int8", - "typeString": "int8" - } - }, - "nodeType": "BinaryOperation", - "operator": "+", - "rightExpression": - { - "id": 28, - "name": "b", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 22, - "src": "268:1:0", - "typeDescriptions": - { - "typeIdentifier": "t_int8", - "typeString": "int8" - } - }, - "src": "264:5:0", - "typeDescriptions": - { - "typeIdentifier": "t_int8", - "typeString": "int8" - } - }, - "functionReturnParameters": 26, - "id": 30, - "nodeType": "Return", - "src": "257:12:0" - } - ] - }, - "functionSelector": "e2666777", - "id": 32, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "add", - "nameLocation": "200:3:0", - "nodeType": "FunctionDefinition", - "parameters": - { - "id": 23, - "nodeType": "ParameterList", - "parameters": - [ - { - "constant": false, - "id": 20, - "mutability": "mutable", - "name": "a", - "nameLocation": "209:1:0", - "nodeType": "VariableDeclaration", - "scope": 32, - "src": "204:6:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_int8", - "typeString": "int8" - }, - "typeName": - { - "id": 19, - "name": "int8", - "nodeType": "ElementaryTypeName", - "src": "204:4:0", - "typeDescriptions": - { - "typeIdentifier": "t_int8", - "typeString": "int8" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 22, - "mutability": "mutable", - "name": "b", - "nameLocation": "217:1:0", - "nodeType": "VariableDeclaration", - "scope": 32, - "src": "212:6:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_int8", - "typeString": "int8" - }, - "typeName": - { - "id": 21, - "name": "int8", - "nodeType": "ElementaryTypeName", - "src": "212:4:0", - "typeDescriptions": - { - "typeIdentifier": "t_int8", - "typeString": "int8" - } - }, - "visibility": "internal" - } - ], - "src": "203:16:0" - }, - "returnParameters": - { - "id": 26, - "nodeType": "ParameterList", - "parameters": - [ - { - "constant": false, - "id": 25, - "mutability": "mutable", - "name": "", - "nameLocation": "-1:-1:-1", - "nodeType": "VariableDeclaration", - "scope": 32, - "src": "241:4:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_int8", - "typeString": "int8" - }, - "typeName": - { - "id": 24, - "name": "int8", - "nodeType": "ElementaryTypeName", - "src": "241:4:0", - "typeDescriptions": - { - "typeIdentifier": "t_int8", - "typeString": "int8" - } - }, - "visibility": "internal" - } - ], - "src": "240:6:0" - }, - "scope": 33, - "src": "191:85:0", - "stateMutability": "pure", - "virtual": false, - "visibility": "public" - } - ], - "scope": 136, - "src": "68:210:0", - "usedErrors": [] - }, - { - "abstract": false, - "baseContracts": [], - "canonicalName": "C", - "contractDependencies": [], - "contractKind": "contract", - "fullyImplemented": true, - "id": 135, - "linearizedBaseContracts": - [ - 135 - ], - "name": "C", - "nameLocation": "289:1:0", - "nodeType": "ContractDefinition", - "nodes": - [ - { - "body": - { - "id": 59, - "nodeType": "Block", - "src": "353:99:0", - "statements": - [ - { - "assignments": - [ - 43 - ], - "declarations": - [ - { - "constant": false, - "id": 43, - "mutability": "mutable", - "name": "a", - "nameLocation": "380:1:0", - "nodeType": "VariableDeclaration", - "scope": 59, - "src": "363:18:0", - "stateVariable": false, - "storageLocation": "memory", - "typeDescriptions": - { - "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", - "typeString": "address[]" - }, - "typeName": - { - "baseType": - { - "id": 41, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "363:7:0", - "typeDescriptions": - { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "id": 42, - "nodeType": "ArrayTypeName", - "src": "363:9:0", - "typeDescriptions": - { - "typeIdentifier": "t_array$_t_address_$dyn_storage_ptr", - "typeString": "address[]" - } - }, - "visibility": "internal" - } - ], - "id": 49, - "initialValue": - { - "arguments": - [ - { - "hexValue": "31", - "id": 47, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "398:1:0", - "typeDescriptions": - { - "typeIdentifier": "t_rational_1_by_1", - "typeString": "int_const 1" - }, - "value": "1" - } - ], - "expression": - { - "argumentTypes": - [ - { - "typeIdentifier": "t_rational_1_by_1", - "typeString": "int_const 1" - } - ], - "id": 46, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "nodeType": "NewExpression", - "src": "384:13:0", - "typeDescriptions": - { - "typeIdentifier": "t_function_objectcreation_pure$_t_uint256_$returns$_t_array$_t_address_$dyn_memory_ptr_$", - "typeString": "function (uint256) pure returns (address[] memory)" - }, - "typeName": - { - "baseType": - { - "id": 44, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "388:7:0", - "stateMutability": "nonpayable", - "typeDescriptions": - { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "id": 45, - "nodeType": "ArrayTypeName", - "src": "388:9:0", - "typeDescriptions": - { - "typeIdentifier": "t_array$_t_address_$dyn_storage_ptr", - "typeString": "address[]" - } - } - }, - "id": 48, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "384:16:0", - "tryCall": false, - "typeDescriptions": - { - "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", - "typeString": "address[] memory" - } - }, - "nodeType": "VariableDeclarationStatement", - "src": "363:37:0" - }, - { - "expression": - { - "id": 55, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": - { - "baseExpression": - { - "id": 50, - "name": "a", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 43, - "src": "410:1:0", - "typeDescriptions": - { - "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", - "typeString": "address[] memory" - } - }, - "id": 52, - "indexExpression": - { - "hexValue": "30", - "id": 51, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "412:1:0", - "typeDescriptions": - { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - }, - "value": "0" - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": true, - "nodeType": "IndexAccess", - "src": "410:4:0", - "typeDescriptions": - { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": - { - "expression": - { - "id": 53, - "name": "msg", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": -15, - "src": "417:3:0", - "typeDescriptions": - { - "typeIdentifier": "t_magic_message", - "typeString": "msg" - } - }, - "id": 54, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "sender", - "nodeType": "MemberAccess", - "src": "417:10:0", - "typeDescriptions": - { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "src": "410:17:0", - "typeDescriptions": - { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "id": 56, - "nodeType": "ExpressionStatement", - "src": "410:17:0" - }, - { - "expression": - { - "id": 57, - "name": "a", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 43, - "src": "444:1:0", - "typeDescriptions": - { - "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", - "typeString": "address[] memory" - } - }, - "functionReturnParameters": 38, - "id": 58, - "nodeType": "Return", - "src": "437:8:0" - } - ] - }, - "functionSelector": "c2985578", - "id": 60, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "foo", - "nameLocation": "306:3:0", - "nodeType": "FunctionDefinition", - "parameters": - { - "id": 34, - "nodeType": "ParameterList", - "parameters": [], - "src": "309:2:0" - }, - "returnParameters": - { - "id": 38, - "nodeType": "ParameterList", - "parameters": - [ - { - "constant": false, - "id": 37, - "mutability": "mutable", - "name": "", - "nameLocation": "-1:-1:-1", - "nodeType": "VariableDeclaration", - "scope": 60, - "src": "335:16:0", - "stateVariable": false, - "storageLocation": "memory", - "typeDescriptions": - { - "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", - "typeString": "address[]" - }, - "typeName": - { - "baseType": - { - "id": 35, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "335:7:0", - "stateMutability": "nonpayable", - "typeDescriptions": - { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "id": 36, - "nodeType": "ArrayTypeName", - "src": "335:9:0", - "typeDescriptions": - { - "typeIdentifier": "t_array$_t_address_$dyn_storage_ptr", - "typeString": "address[]" - } - }, - "visibility": "internal" - } - ], - "src": "334:18:0" - }, - "scope": 135, - "src": "297:155:0", - "stateMutability": "view", - "virtual": false, - "visibility": "external" - }, - { - "body": - { - "id": 79, - "nodeType": "Block", - "src": "532:88:0", - "statements": - [ - { - "assignments": - [ - 68 - ], - "declarations": - [ - { - "constant": false, - "id": 68, - "mutability": "mutable", - "name": "a", - "nameLocation": "550:1:0", - "nodeType": "VariableDeclaration", - "scope": 79, - "src": "542:9:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": - { - "id": 67, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "542:7:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - } - ], - "id": 70, - "initialValue": - { - "hexValue": "3130", - "id": 69, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "554:2:0", - "typeDescriptions": - { - "typeIdentifier": "t_rational_10_by_1", - "typeString": "int_const 10" - }, - "value": "10" - }, - "nodeType": "VariableDeclarationStatement", - "src": "542:14:0" - }, - { - "assignments": - [ - 72 - ], - "declarations": - [ - { - "constant": false, - "id": 72, - "mutability": "mutable", - "name": "res", - "nameLocation": "574:3:0", - "nodeType": "VariableDeclaration", - "scope": 79, - "src": "566:11:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": - { - "id": 71, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "566:7:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - } - ], - "id": 76, - "initialValue": - { - "commonType": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 75, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": - { - "id": 73, - "name": "a", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 68, - "src": "580:1:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "**", - "rightExpression": - { - "id": 74, - "name": "decimals", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 62, - "src": "585:8:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - } - }, - "src": "580:13:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "VariableDeclarationStatement", - "src": "566:27:0" - }, - { - "expression": - { - "id": 77, - "name": "res", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 72, - "src": "610:3:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "functionReturnParameters": 66, - "id": 78, - "nodeType": "Return", - "src": "603:10:0" - } - ] - }, - "functionSelector": "eb79f1be", - "id": 80, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "get10PowerDecimals", - "nameLocation": "467:18:0", - "nodeType": "FunctionDefinition", - "parameters": - { - "id": 63, - "nodeType": "ParameterList", - "parameters": - [ - { - "constant": false, - "id": 62, - "mutability": "mutable", - "name": "decimals", - "nameLocation": "492:8:0", - "nodeType": "VariableDeclaration", - "scope": 80, - "src": "486:14:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - }, - "typeName": - { - "id": 61, - "name": "uint8", - "nodeType": "ElementaryTypeName", - "src": "486:5:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - } - }, - "visibility": "internal" - } - ], - "src": "485:16:0" - }, - "returnParameters": - { - "id": 66, - "nodeType": "ParameterList", - "parameters": - [ - { - "constant": false, - "id": 65, - "mutability": "mutable", - "name": "", - "nameLocation": "-1:-1:-1", - "nodeType": "VariableDeclaration", - "scope": 80, - "src": "523:7:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": - { - "id": 64, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "523:7:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - } - ], - "src": "522:9:0" - }, - "scope": 135, - "src": "458:162:0", - "stateMutability": "pure", - "virtual": false, - "visibility": "public" - }, - { - "body": - { - "id": 96, - "nodeType": "Block", - "src": "687:34:0", - "statements": - [ - { - "expression": - { - "arguments": - [ - { - "commonType": - { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "id": 93, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": - { - "baseExpression": - { - "id": 89, - "name": "c", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 83, - "src": "704:1:0", - "typeDescriptions": - { - "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", - "typeString": "address[] memory" - } - }, - "id": 91, - "indexExpression": - { - "hexValue": "30", - "id": 90, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "706:1:0", - "typeDescriptions": - { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - }, - "value": "0" - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "704:4:0", - "typeDescriptions": - { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "nodeType": "BinaryOperation", - "operator": "==", - "rightExpression": - { - "id": 92, - "name": "e", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 85, - "src": "712:1:0", - "typeDescriptions": - { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "src": "704:9:0", - "typeDescriptions": - { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - } - ], - "expression": - { - "argumentTypes": - [ - { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - ], - "id": 88, - "name": "assert", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": -3, - "src": "697:6:0", - "typeDescriptions": - { - "typeIdentifier": "t_function_assert_pure$_t_bool_$returns$__$", - "typeString": "function (bool) pure" - } - }, - "id": 94, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "697:17:0", - "tryCall": false, - "typeDescriptions": - { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 95, - "nodeType": "ExpressionStatement", - "src": "697:17:0" - } - ] - }, - "functionSelector": "e5b2857b", - "id": 97, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "getarray", - "nameLocation": "635:8:0", - "nodeType": "FunctionDefinition", - "parameters": - { - "id": 86, - "nodeType": "ParameterList", - "parameters": - [ - { - "constant": false, - "id": 83, - "mutability": "mutable", - "name": "c", - "nameLocation": "661:1:0", - "nodeType": "VariableDeclaration", - "scope": 97, - "src": "644:18:0", - "stateVariable": false, - "storageLocation": "memory", - "typeDescriptions": - { - "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", - "typeString": "address[]" - }, - "typeName": - { - "baseType": - { - "id": 81, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "644:7:0", - "stateMutability": "nonpayable", - "typeDescriptions": - { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "id": 82, - "nodeType": "ArrayTypeName", - "src": "644:9:0", - "typeDescriptions": - { - "typeIdentifier": "t_array$_t_address_$dyn_storage_ptr", - "typeString": "address[]" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 85, - "mutability": "mutable", - "name": "e", - "nameLocation": "672:1:0", - "nodeType": "VariableDeclaration", - "scope": 97, - "src": "664:9:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": - { - "id": 84, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "664:7:0", - "stateMutability": "nonpayable", - "typeDescriptions": - { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "visibility": "internal" - } - ], - "src": "643:31:0" - }, - "returnParameters": - { - "id": 87, - "nodeType": "ParameterList", - "parameters": [], - "src": "687:0:0" - }, - "scope": 135, - "src": "626:95:0", - "stateMutability": "pure", - "virtual": false, - "visibility": "public" - }, - { - "body": - { - "id": 119, - "nodeType": "Block", - "src": "763:90:0", - "statements": - [ - { - "assignments": - [ - 104 - ], - "declarations": - [ - { - "constant": false, - "id": 104, - "mutability": "mutable", - "name": "b", - "nameLocation": "790:1:0", - "nodeType": "VariableDeclaration", - "scope": 119, - "src": "773:18:0", - "stateVariable": false, - "storageLocation": "memory", - "typeDescriptions": - { - "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", - "typeString": "address[]" - }, - "typeName": - { - "baseType": - { - "id": 102, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "773:7:0", - "typeDescriptions": - { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "id": 103, - "nodeType": "ArrayTypeName", - "src": "773:9:0", - "typeDescriptions": - { - "typeIdentifier": "t_array$_t_address_$dyn_storage_ptr", - "typeString": "address[]" - } - }, - "visibility": "internal" - } - ], - "id": 108, - "initialValue": - { - "arguments": [], - "expression": - { - "argumentTypes": [], - "expression": - { - "id": 105, - "name": "this", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": -28, - "src": "794:4:0", - "typeDescriptions": - { - "typeIdentifier": "t_contract$_C_$135", - "typeString": "contract C" - } - }, - "id": 106, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "foo", - "nodeType": "MemberAccess", - "referencedDeclaration": 60, - "src": "794:8:0", - "typeDescriptions": - { - "typeIdentifier": "t_function_external_view$__$returns$_t_array$_t_address_$dyn_memory_ptr_$", - "typeString": "function () view external returns (address[] memory)" - } - }, - "id": 107, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "794:10:0", - "tryCall": false, - "typeDescriptions": - { - "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", - "typeString": "address[] memory" - } - }, - "nodeType": "VariableDeclarationStatement", - "src": "773:31:0" - }, - { - "expression": - { - "arguments": - [ - { - "id": 112, - "name": "b", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 104, - "src": "829:1:0", - "typeDescriptions": - { - "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", - "typeString": "address[] memory" - } - }, - { - "arguments": - [ - { - "id": 115, - "name": "this", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": -28, - "src": "840:4:0", - "typeDescriptions": - { - "typeIdentifier": "t_contract$_C_$135", - "typeString": "contract C" - } - } - ], - "expression": - { - "argumentTypes": - [ - { - "typeIdentifier": "t_contract$_C_$135", - "typeString": "contract C" - } - ], - "id": 114, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "nodeType": "ElementaryTypeNameExpression", - "src": "832:7:0", - "typeDescriptions": - { - "typeIdentifier": "t_type$_t_address_$", - "typeString": "type(address)" - }, - "typeName": - { - "id": 113, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "832:7:0", - "typeDescriptions": {} - } - }, - "id": 116, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "typeConversion", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "832:13:0", - "tryCall": false, - "typeDescriptions": - { - "typeIdentifier": "t_address", - "typeString": "address" - } - } - ], - "expression": - { - "argumentTypes": - [ - { - "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", - "typeString": "address[] memory" - }, - { - "typeIdentifier": "t_address", - "typeString": "address" - } - ], - "expression": - { - "id": 109, - "name": "Utils", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 33, - "src": "814:5:0", - "typeDescriptions": - { - "typeIdentifier": "t_type$_t_contract$_Utils_$33_$", - "typeString": "type(library Utils)" - } - }, - "id": 111, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "getarray", - "nodeType": "MemberAccess", - "referencedDeclaration": 18, - "src": "814:14:0", - "typeDescriptions": - { - "typeIdentifier": "t_function_internal_pure$_t_array$_t_address_$dyn_memory_ptr_$_t_address_$returns$__$", - "typeString": "function (address[] memory,address) pure" - } - }, - "id": 117, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "814:32:0", - "tryCall": false, - "typeDescriptions": - { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 118, - "nodeType": "ExpressionStatement", - "src": "814:32:0" - } - ] - }, - "functionSelector": "d3ab473b", - "id": 120, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "callmyself", - "nameLocation": "736:10:0", - "nodeType": "FunctionDefinition", - "parameters": - { - "id": 98, - "nodeType": "ParameterList", - "parameters": [], - "src": "746:2:0" - }, - "returnParameters": - { - "id": 99, - "nodeType": "ParameterList", - "parameters": [], - "src": "763:0:0" - }, - "scope": 135, - "src": "727:126:0", - "stateMutability": "view", - "virtual": false, - "visibility": "external" - }, - { - "body": - { - "id": 133, - "nodeType": "Block", - "src": "915:29:0", - "statements": - [ - { - "expression": - { - "commonType": - { - "typeIdentifier": "t_int8", - "typeString": "int8" - }, - "id": 131, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": - { - "id": 129, - "name": "c", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 122, - "src": "932:1:0", - "typeDescriptions": - { - "typeIdentifier": "t_int8", - "typeString": "int8" - } - }, - "nodeType": "BinaryOperation", - "operator": "+", - "rightExpression": - { - "id": 130, - "name": "d", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 124, - "src": "936:1:0", - "typeDescriptions": - { - "typeIdentifier": "t_int8", - "typeString": "int8" - } - }, - "src": "932:5:0", - "typeDescriptions": - { - "typeIdentifier": "t_int8", - "typeString": "int8" - } - }, - "functionReturnParameters": 128, - "id": 132, - "nodeType": "Return", - "src": "925:12:0" - } - ] - }, - "functionSelector": "e2666777", - "id": 134, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "add", - "nameLocation": "868:3:0", - "nodeType": "FunctionDefinition", - "parameters": - { - "id": 125, - "nodeType": "ParameterList", - "parameters": - [ - { - "constant": false, - "id": 122, - "mutability": "mutable", - "name": "c", - "nameLocation": "877:1:0", - "nodeType": "VariableDeclaration", - "scope": 134, - "src": "872:6:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_int8", - "typeString": "int8" - }, - "typeName": - { - "id": 121, - "name": "int8", - "nodeType": "ElementaryTypeName", - "src": "872:4:0", - "typeDescriptions": - { - "typeIdentifier": "t_int8", - "typeString": "int8" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 124, - "mutability": "mutable", - "name": "d", - "nameLocation": "885:1:0", - "nodeType": "VariableDeclaration", - "scope": 134, - "src": "880:6:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_int8", - "typeString": "int8" - }, - "typeName": - { - "id": 123, - "name": "int8", - "nodeType": "ElementaryTypeName", - "src": "880:4:0", - "typeDescriptions": - { - "typeIdentifier": "t_int8", - "typeString": "int8" - } - }, - "visibility": "internal" - } - ], - "src": "871:16:0" - }, - "returnParameters": - { - "id": 128, - "nodeType": "ParameterList", - "parameters": - [ - { - "constant": false, - "id": 127, - "mutability": "mutable", - "name": "", - "nameLocation": "-1:-1:-1", - "nodeType": "VariableDeclaration", - "scope": 134, - "src": "909:4:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_int8", - "typeString": "int8" - }, - "typeName": - { - "id": 126, - "name": "int8", - "nodeType": "ElementaryTypeName", - "src": "909:4:0", - "typeDescriptions": - { - "typeIdentifier": "t_int8", - "typeString": "int8" - } - }, - "visibility": "internal" - } - ], - "src": "908:6:0" - }, - "scope": 135, - "src": "859:85:0", - "stateMutability": "pure", - "virtual": false, - "visibility": "public" - } - ], - "scope": 136, - "src": "280:666:0", - "usedErrors": [] - } - ], - "src": "42:905:0" -} \ No newline at end of file diff --git a/resources/regressions/multiple-contracts-1.json/mutants.log b/resources/regressions/multiple-contracts-1.json/mutants.log deleted file mode 100644 index 22dfd19..0000000 --- a/resources/regressions/multiple-contracts-1.json/mutants.log +++ /dev/null @@ -1,8 +0,0 @@ -1,DeleteExpressionMutation,MultipleContracts/C.sol,7:9,assert(c[0] == e),assert(true) -2,BinaryOpMutation,MultipleContracts/C.sol,24:24, ** ,+ -3,BinaryOpMutation,MultipleContracts/C.sol,24:24, ** ,- -4,BinaryOpMutation,MultipleContracts/C.sol,24:24, ** ,* -5,BinaryOpMutation,MultipleContracts/C.sol,24:24, ** ,/ -6,BinaryOpMutation,MultipleContracts/C.sol,24:24, ** ,% -7,SwapArgumentsOperatorMutation,MultipleContracts/C.sol,24:23,a ** decimals,decimals ** a -8,DeleteExpressionMutation,MultipleContracts/C.sol,29:9,assert(c[0] == e),assert(true) diff --git a/resources/regressions/multiple-contracts-1.json/mutants/6/MultipleContracts/C.sol b/resources/regressions/multiple-contracts-1.json/mutants/6/MultipleContracts/C.sol deleted file mode 100644 index 98a4b5f..0000000 --- a/resources/regressions/multiple-contracts-1.json/mutants/6/MultipleContracts/C.sol +++ /dev/null @@ -1,41 +0,0 @@ -// SPDX-License-Identifier: GPL-3.0-only - -pragma solidity ^0.8.13; - -library Utils { - function getarray(address[] memory c, address e) internal pure { - assert(c[0] == e); - } - - function add(int8 a, int8 b) public pure returns (int8) { - return a + b; - } -} - -contract C { - function foo() external view returns (address[] memory) { - address[] memory a = new address[](1); - a[0] = msg.sender; - return a; - } - - function get10PowerDecimals(uint8 decimals) public pure returns (uint256) { - uint256 a = 10; - /// BinaryOpMutation(`**` |==> `%`) of: `uint256 res = a ** decimals;` - uint256 res = a%decimals; - return res; - } - - function getarray(address[] memory c, address e) public pure { - assert(c[0] == e); - } - - function callmyself() external view { - address[] memory b = this.foo(); - Utils.getarray(b, address(this)); - } - - function add(int8 c, int8 d) public pure returns (int8) { - return c + d; - } -} diff --git a/resources/regressions/multiple-contracts-1.json/mutants/7/MultipleContracts/C.sol b/resources/regressions/multiple-contracts-1.json/mutants/7/MultipleContracts/C.sol deleted file mode 100644 index 55b45bf..0000000 --- a/resources/regressions/multiple-contracts-1.json/mutants/7/MultipleContracts/C.sol +++ /dev/null @@ -1,41 +0,0 @@ -// SPDX-License-Identifier: GPL-3.0-only - -pragma solidity ^0.8.13; - -library Utils { - function getarray(address[] memory c, address e) internal pure { - assert(c[0] == e); - } - - function add(int8 a, int8 b) public pure returns (int8) { - return a + b; - } -} - -contract C { - function foo() external view returns (address[] memory) { - address[] memory a = new address[](1); - a[0] = msg.sender; - return a; - } - - function get10PowerDecimals(uint8 decimals) public pure returns (uint256) { - uint256 a = 10; - /// SwapArgumentsOperatorMutation(`a ** decimals` |==> `decimals ** a`) of: `uint256 res = a ** decimals;` - uint256 res = decimals ** a; - return res; - } - - function getarray(address[] memory c, address e) public pure { - assert(c[0] == e); - } - - function callmyself() external view { - address[] memory b = this.foo(); - Utils.getarray(b, address(this)); - } - - function add(int8 c, int8 d) public pure returns (int8) { - return c + d; - } -} diff --git a/resources/regressions/multiple-contracts-2.json/gambit_results.json b/resources/regressions/multiple-contracts-2.json/gambit_results.json deleted file mode 100644 index 232e564..0000000 --- a/resources/regressions/multiple-contracts-2.json/gambit_results.json +++ /dev/null @@ -1,72 +0,0 @@ -[ - { - "description": "BinaryOpMutation", - "diff": "--- original\n+++ mutant\n@@ -8,7 +8,8 @@\n }\n \n function add(int8 a, int8 b) public pure returns (int8) {\n- return a + b;\n+ /// BinaryOpMutation(`+` |==> `-`) of: `return a + b;`\n+ return a-b;\n }\n }\n \n", - "id": "1", - "name": "mutants/1/MultipleContracts/C.sol", - "original": "MultipleContracts/C.sol", - }, - { - "description": "BinaryOpMutation", - "diff": "--- original\n+++ mutant\n@@ -8,7 +8,8 @@\n }\n \n function add(int8 a, int8 b) public pure returns (int8) {\n- return a + b;\n+ /// BinaryOpMutation(`+` |==> `*`) of: `return a + b;`\n+ return a*b;\n }\n }\n \n", - "id": "2", - "name": "mutants/2/MultipleContracts/C.sol", - "original": "MultipleContracts/C.sol", - }, - { - "description": "BinaryOpMutation", - "diff": "--- original\n+++ mutant\n@@ -8,7 +8,8 @@\n }\n \n function add(int8 a, int8 b) public pure returns (int8) {\n- return a + b;\n+ /// BinaryOpMutation(`+` |==> `/`) of: `return a + b;`\n+ return a/b;\n }\n }\n \n", - "id": "3", - "name": "mutants/3/MultipleContracts/C.sol", - "original": "MultipleContracts/C.sol", - }, - { - "description": "BinaryOpMutation", - "diff": "--- original\n+++ mutant\n@@ -8,7 +8,8 @@\n }\n \n function add(int8 a, int8 b) public pure returns (int8) {\n- return a + b;\n+ /// BinaryOpMutation(`+` |==> `%`) of: `return a + b;`\n+ return a%b;\n }\n }\n \n", - "id": "4", - "name": "mutants/4/MultipleContracts/C.sol", - "original": "MultipleContracts/C.sol", - }, - { - "description": "BinaryOpMutation", - "diff": "--- original\n+++ mutant\n@@ -21,7 +21,8 @@\n \n function get10PowerDecimals(uint8 decimals) public pure returns (uint256) {\n uint256 a = 10;\n- uint256 res = a ** decimals;\n+ /// BinaryOpMutation(`**` |==> `+`) of: `uint256 res = a ** decimals;`\n+ uint256 res = a+decimals;\n return res;\n }\n \n", - "id": "5", - "name": "mutants/5/MultipleContracts/C.sol", - "original": "MultipleContracts/C.sol", - }, - { - "description": "BinaryOpMutation", - "diff": "--- original\n+++ mutant\n@@ -21,7 +21,8 @@\n \n function get10PowerDecimals(uint8 decimals) public pure returns (uint256) {\n uint256 a = 10;\n- uint256 res = a ** decimals;\n+ /// BinaryOpMutation(`**` |==> `-`) of: `uint256 res = a ** decimals;`\n+ uint256 res = a-decimals;\n return res;\n }\n \n", - "id": "6", - "name": "mutants/6/MultipleContracts/C.sol", - "original": "MultipleContracts/C.sol", - }, - { - "description": "BinaryOpMutation", - "diff": "--- original\n+++ mutant\n@@ -21,7 +21,8 @@\n \n function get10PowerDecimals(uint8 decimals) public pure returns (uint256) {\n uint256 a = 10;\n- uint256 res = a ** decimals;\n+ /// BinaryOpMutation(`**` |==> `*`) of: `uint256 res = a ** decimals;`\n+ uint256 res = a*decimals;\n return res;\n }\n \n", - "id": "7", - "name": "mutants/7/MultipleContracts/C.sol", - "original": "MultipleContracts/C.sol", - }, - { - "description": "BinaryOpMutation", - "diff": "--- original\n+++ mutant\n@@ -21,7 +21,8 @@\n \n function get10PowerDecimals(uint8 decimals) public pure returns (uint256) {\n uint256 a = 10;\n- uint256 res = a ** decimals;\n+ /// BinaryOpMutation(`**` |==> `/`) of: `uint256 res = a ** decimals;`\n+ uint256 res = a/decimals;\n return res;\n }\n \n", - "id": "8", - "name": "mutants/8/MultipleContracts/C.sol", - "original": "MultipleContracts/C.sol", - }, - { - "description": "BinaryOpMutation", - "diff": "--- original\n+++ mutant\n@@ -21,7 +21,8 @@\n \n function get10PowerDecimals(uint8 decimals) public pure returns (uint256) {\n uint256 a = 10;\n- uint256 res = a ** decimals;\n+ /// BinaryOpMutation(`**` |==> `%`) of: `uint256 res = a ** decimals;`\n+ uint256 res = a%decimals;\n return res;\n }\n \n", - "id": "9", - "name": "mutants/9/MultipleContracts/C.sol", - "original": "MultipleContracts/C.sol", - }, - { - "description": "SwapArgumentsOperatorMutation", - "diff": "--- original\n+++ mutant\n@@ -21,7 +21,8 @@\n \n function get10PowerDecimals(uint8 decimals) public pure returns (uint256) {\n uint256 a = 10;\n- uint256 res = a ** decimals;\n+ /// SwapArgumentsOperatorMutation(`a ** decimals` |==> `decimals ** a`) of: `uint256 res = a ** decimals;`\n+ uint256 res = decimals ** a;\n return res;\n }\n \n", - "id": "10", - "name": "mutants/10/MultipleContracts/C.sol", - "original": "MultipleContracts/C.sol", - } -] \ No newline at end of file diff --git a/resources/regressions/multiple-contracts-2.json/input_json/C.sol_json.ast b/resources/regressions/multiple-contracts-2.json/input_json/C.sol_json.ast deleted file mode 100644 index a3306b6..0000000 --- a/resources/regressions/multiple-contracts-2.json/input_json/C.sol_json.ast +++ /dev/null @@ -1,1828 +0,0 @@ -{ - "absolutePath": "benchmarks/MultipleContracts/C.sol", - "exportedSymbols": - { - "C": - [ - 135 - ], - "Utils": - [ - 33 - ] - }, - "id": 136, - "license": "GPL-3.0-only", - "nodeType": "SourceUnit", - "nodes": - [ - { - "id": 1, - "literals": - [ - "solidity", - "^", - "0.8", - ".13" - ], - "nodeType": "PragmaDirective", - "src": "42:24:0" - }, - { - "abstract": false, - "baseContracts": [], - "canonicalName": "Utils", - "contractDependencies": [], - "contractKind": "library", - "fullyImplemented": true, - "id": 33, - "linearizedBaseContracts": - [ - 33 - ], - "name": "Utils", - "nameLocation": "76:5:0", - "nodeType": "ContractDefinition", - "nodes": - [ - { - "body": - { - "id": 17, - "nodeType": "Block", - "src": "151:34:0", - "statements": - [ - { - "expression": - { - "arguments": - [ - { - "commonType": - { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "id": 14, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": - { - "baseExpression": - { - "id": 10, - "name": "c", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4, - "src": "168:1:0", - "typeDescriptions": - { - "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", - "typeString": "address[] memory" - } - }, - "id": 12, - "indexExpression": - { - "hexValue": "30", - "id": 11, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "170:1:0", - "typeDescriptions": - { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - }, - "value": "0" - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "168:4:0", - "typeDescriptions": - { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "nodeType": "BinaryOperation", - "operator": "==", - "rightExpression": - { - "id": 13, - "name": "e", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 6, - "src": "176:1:0", - "typeDescriptions": - { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "src": "168:9:0", - "typeDescriptions": - { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - } - ], - "expression": - { - "argumentTypes": - [ - { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - ], - "id": 9, - "name": "assert", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": -3, - "src": "161:6:0", - "typeDescriptions": - { - "typeIdentifier": "t_function_assert_pure$_t_bool_$returns$__$", - "typeString": "function (bool) pure" - } - }, - "id": 15, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "161:17:0", - "tryCall": false, - "typeDescriptions": - { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 16, - "nodeType": "ExpressionStatement", - "src": "161:17:0" - } - ] - }, - "id": 18, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "getarray", - "nameLocation": "97:8:0", - "nodeType": "FunctionDefinition", - "parameters": - { - "id": 7, - "nodeType": "ParameterList", - "parameters": - [ - { - "constant": false, - "id": 4, - "mutability": "mutable", - "name": "c", - "nameLocation": "123:1:0", - "nodeType": "VariableDeclaration", - "scope": 18, - "src": "106:18:0", - "stateVariable": false, - "storageLocation": "memory", - "typeDescriptions": - { - "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", - "typeString": "address[]" - }, - "typeName": - { - "baseType": - { - "id": 2, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "106:7:0", - "stateMutability": "nonpayable", - "typeDescriptions": - { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "id": 3, - "nodeType": "ArrayTypeName", - "src": "106:9:0", - "typeDescriptions": - { - "typeIdentifier": "t_array$_t_address_$dyn_storage_ptr", - "typeString": "address[]" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 6, - "mutability": "mutable", - "name": "e", - "nameLocation": "134:1:0", - "nodeType": "VariableDeclaration", - "scope": 18, - "src": "126:9:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": - { - "id": 5, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "126:7:0", - "stateMutability": "nonpayable", - "typeDescriptions": - { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "visibility": "internal" - } - ], - "src": "105:31:0" - }, - "returnParameters": - { - "id": 8, - "nodeType": "ParameterList", - "parameters": [], - "src": "151:0:0" - }, - "scope": 33, - "src": "88:97:0", - "stateMutability": "pure", - "virtual": false, - "visibility": "internal" - }, - { - "body": - { - "id": 31, - "nodeType": "Block", - "src": "247:29:0", - "statements": - [ - { - "expression": - { - "commonType": - { - "typeIdentifier": "t_int8", - "typeString": "int8" - }, - "id": 29, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": - { - "id": 27, - "name": "a", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 20, - "src": "264:1:0", - "typeDescriptions": - { - "typeIdentifier": "t_int8", - "typeString": "int8" - } - }, - "nodeType": "BinaryOperation", - "operator": "+", - "rightExpression": - { - "id": 28, - "name": "b", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 22, - "src": "268:1:0", - "typeDescriptions": - { - "typeIdentifier": "t_int8", - "typeString": "int8" - } - }, - "src": "264:5:0", - "typeDescriptions": - { - "typeIdentifier": "t_int8", - "typeString": "int8" - } - }, - "functionReturnParameters": 26, - "id": 30, - "nodeType": "Return", - "src": "257:12:0" - } - ] - }, - "functionSelector": "e2666777", - "id": 32, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "add", - "nameLocation": "200:3:0", - "nodeType": "FunctionDefinition", - "parameters": - { - "id": 23, - "nodeType": "ParameterList", - "parameters": - [ - { - "constant": false, - "id": 20, - "mutability": "mutable", - "name": "a", - "nameLocation": "209:1:0", - "nodeType": "VariableDeclaration", - "scope": 32, - "src": "204:6:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_int8", - "typeString": "int8" - }, - "typeName": - { - "id": 19, - "name": "int8", - "nodeType": "ElementaryTypeName", - "src": "204:4:0", - "typeDescriptions": - { - "typeIdentifier": "t_int8", - "typeString": "int8" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 22, - "mutability": "mutable", - "name": "b", - "nameLocation": "217:1:0", - "nodeType": "VariableDeclaration", - "scope": 32, - "src": "212:6:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_int8", - "typeString": "int8" - }, - "typeName": - { - "id": 21, - "name": "int8", - "nodeType": "ElementaryTypeName", - "src": "212:4:0", - "typeDescriptions": - { - "typeIdentifier": "t_int8", - "typeString": "int8" - } - }, - "visibility": "internal" - } - ], - "src": "203:16:0" - }, - "returnParameters": - { - "id": 26, - "nodeType": "ParameterList", - "parameters": - [ - { - "constant": false, - "id": 25, - "mutability": "mutable", - "name": "", - "nameLocation": "-1:-1:-1", - "nodeType": "VariableDeclaration", - "scope": 32, - "src": "241:4:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_int8", - "typeString": "int8" - }, - "typeName": - { - "id": 24, - "name": "int8", - "nodeType": "ElementaryTypeName", - "src": "241:4:0", - "typeDescriptions": - { - "typeIdentifier": "t_int8", - "typeString": "int8" - } - }, - "visibility": "internal" - } - ], - "src": "240:6:0" - }, - "scope": 33, - "src": "191:85:0", - "stateMutability": "pure", - "virtual": false, - "visibility": "public" - } - ], - "scope": 136, - "src": "68:210:0", - "usedErrors": [] - }, - { - "abstract": false, - "baseContracts": [], - "canonicalName": "C", - "contractDependencies": [], - "contractKind": "contract", - "fullyImplemented": true, - "id": 135, - "linearizedBaseContracts": - [ - 135 - ], - "name": "C", - "nameLocation": "289:1:0", - "nodeType": "ContractDefinition", - "nodes": - [ - { - "body": - { - "id": 59, - "nodeType": "Block", - "src": "353:99:0", - "statements": - [ - { - "assignments": - [ - 43 - ], - "declarations": - [ - { - "constant": false, - "id": 43, - "mutability": "mutable", - "name": "a", - "nameLocation": "380:1:0", - "nodeType": "VariableDeclaration", - "scope": 59, - "src": "363:18:0", - "stateVariable": false, - "storageLocation": "memory", - "typeDescriptions": - { - "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", - "typeString": "address[]" - }, - "typeName": - { - "baseType": - { - "id": 41, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "363:7:0", - "typeDescriptions": - { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "id": 42, - "nodeType": "ArrayTypeName", - "src": "363:9:0", - "typeDescriptions": - { - "typeIdentifier": "t_array$_t_address_$dyn_storage_ptr", - "typeString": "address[]" - } - }, - "visibility": "internal" - } - ], - "id": 49, - "initialValue": - { - "arguments": - [ - { - "hexValue": "31", - "id": 47, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "398:1:0", - "typeDescriptions": - { - "typeIdentifier": "t_rational_1_by_1", - "typeString": "int_const 1" - }, - "value": "1" - } - ], - "expression": - { - "argumentTypes": - [ - { - "typeIdentifier": "t_rational_1_by_1", - "typeString": "int_const 1" - } - ], - "id": 46, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "nodeType": "NewExpression", - "src": "384:13:0", - "typeDescriptions": - { - "typeIdentifier": "t_function_objectcreation_pure$_t_uint256_$returns$_t_array$_t_address_$dyn_memory_ptr_$", - "typeString": "function (uint256) pure returns (address[] memory)" - }, - "typeName": - { - "baseType": - { - "id": 44, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "388:7:0", - "stateMutability": "nonpayable", - "typeDescriptions": - { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "id": 45, - "nodeType": "ArrayTypeName", - "src": "388:9:0", - "typeDescriptions": - { - "typeIdentifier": "t_array$_t_address_$dyn_storage_ptr", - "typeString": "address[]" - } - } - }, - "id": 48, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "384:16:0", - "tryCall": false, - "typeDescriptions": - { - "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", - "typeString": "address[] memory" - } - }, - "nodeType": "VariableDeclarationStatement", - "src": "363:37:0" - }, - { - "expression": - { - "id": 55, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": - { - "baseExpression": - { - "id": 50, - "name": "a", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 43, - "src": "410:1:0", - "typeDescriptions": - { - "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", - "typeString": "address[] memory" - } - }, - "id": 52, - "indexExpression": - { - "hexValue": "30", - "id": 51, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "412:1:0", - "typeDescriptions": - { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - }, - "value": "0" - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": true, - "nodeType": "IndexAccess", - "src": "410:4:0", - "typeDescriptions": - { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": - { - "expression": - { - "id": 53, - "name": "msg", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": -15, - "src": "417:3:0", - "typeDescriptions": - { - "typeIdentifier": "t_magic_message", - "typeString": "msg" - } - }, - "id": 54, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "sender", - "nodeType": "MemberAccess", - "src": "417:10:0", - "typeDescriptions": - { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "src": "410:17:0", - "typeDescriptions": - { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "id": 56, - "nodeType": "ExpressionStatement", - "src": "410:17:0" - }, - { - "expression": - { - "id": 57, - "name": "a", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 43, - "src": "444:1:0", - "typeDescriptions": - { - "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", - "typeString": "address[] memory" - } - }, - "functionReturnParameters": 38, - "id": 58, - "nodeType": "Return", - "src": "437:8:0" - } - ] - }, - "functionSelector": "c2985578", - "id": 60, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "foo", - "nameLocation": "306:3:0", - "nodeType": "FunctionDefinition", - "parameters": - { - "id": 34, - "nodeType": "ParameterList", - "parameters": [], - "src": "309:2:0" - }, - "returnParameters": - { - "id": 38, - "nodeType": "ParameterList", - "parameters": - [ - { - "constant": false, - "id": 37, - "mutability": "mutable", - "name": "", - "nameLocation": "-1:-1:-1", - "nodeType": "VariableDeclaration", - "scope": 60, - "src": "335:16:0", - "stateVariable": false, - "storageLocation": "memory", - "typeDescriptions": - { - "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", - "typeString": "address[]" - }, - "typeName": - { - "baseType": - { - "id": 35, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "335:7:0", - "stateMutability": "nonpayable", - "typeDescriptions": - { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "id": 36, - "nodeType": "ArrayTypeName", - "src": "335:9:0", - "typeDescriptions": - { - "typeIdentifier": "t_array$_t_address_$dyn_storage_ptr", - "typeString": "address[]" - } - }, - "visibility": "internal" - } - ], - "src": "334:18:0" - }, - "scope": 135, - "src": "297:155:0", - "stateMutability": "view", - "virtual": false, - "visibility": "external" - }, - { - "body": - { - "id": 79, - "nodeType": "Block", - "src": "532:88:0", - "statements": - [ - { - "assignments": - [ - 68 - ], - "declarations": - [ - { - "constant": false, - "id": 68, - "mutability": "mutable", - "name": "a", - "nameLocation": "550:1:0", - "nodeType": "VariableDeclaration", - "scope": 79, - "src": "542:9:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": - { - "id": 67, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "542:7:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - } - ], - "id": 70, - "initialValue": - { - "hexValue": "3130", - "id": 69, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "554:2:0", - "typeDescriptions": - { - "typeIdentifier": "t_rational_10_by_1", - "typeString": "int_const 10" - }, - "value": "10" - }, - "nodeType": "VariableDeclarationStatement", - "src": "542:14:0" - }, - { - "assignments": - [ - 72 - ], - "declarations": - [ - { - "constant": false, - "id": 72, - "mutability": "mutable", - "name": "res", - "nameLocation": "574:3:0", - "nodeType": "VariableDeclaration", - "scope": 79, - "src": "566:11:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": - { - "id": 71, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "566:7:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - } - ], - "id": 76, - "initialValue": - { - "commonType": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 75, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": - { - "id": 73, - "name": "a", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 68, - "src": "580:1:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "**", - "rightExpression": - { - "id": 74, - "name": "decimals", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 62, - "src": "585:8:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - } - }, - "src": "580:13:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "VariableDeclarationStatement", - "src": "566:27:0" - }, - { - "expression": - { - "id": 77, - "name": "res", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 72, - "src": "610:3:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "functionReturnParameters": 66, - "id": 78, - "nodeType": "Return", - "src": "603:10:0" - } - ] - }, - "functionSelector": "eb79f1be", - "id": 80, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "get10PowerDecimals", - "nameLocation": "467:18:0", - "nodeType": "FunctionDefinition", - "parameters": - { - "id": 63, - "nodeType": "ParameterList", - "parameters": - [ - { - "constant": false, - "id": 62, - "mutability": "mutable", - "name": "decimals", - "nameLocation": "492:8:0", - "nodeType": "VariableDeclaration", - "scope": 80, - "src": "486:14:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - }, - "typeName": - { - "id": 61, - "name": "uint8", - "nodeType": "ElementaryTypeName", - "src": "486:5:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - } - }, - "visibility": "internal" - } - ], - "src": "485:16:0" - }, - "returnParameters": - { - "id": 66, - "nodeType": "ParameterList", - "parameters": - [ - { - "constant": false, - "id": 65, - "mutability": "mutable", - "name": "", - "nameLocation": "-1:-1:-1", - "nodeType": "VariableDeclaration", - "scope": 80, - "src": "523:7:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": - { - "id": 64, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "523:7:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - } - ], - "src": "522:9:0" - }, - "scope": 135, - "src": "458:162:0", - "stateMutability": "pure", - "virtual": false, - "visibility": "public" - }, - { - "body": - { - "id": 96, - "nodeType": "Block", - "src": "687:34:0", - "statements": - [ - { - "expression": - { - "arguments": - [ - { - "commonType": - { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "id": 93, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": - { - "baseExpression": - { - "id": 89, - "name": "c", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 83, - "src": "704:1:0", - "typeDescriptions": - { - "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", - "typeString": "address[] memory" - } - }, - "id": 91, - "indexExpression": - { - "hexValue": "30", - "id": 90, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "706:1:0", - "typeDescriptions": - { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - }, - "value": "0" - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "704:4:0", - "typeDescriptions": - { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "nodeType": "BinaryOperation", - "operator": "==", - "rightExpression": - { - "id": 92, - "name": "e", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 85, - "src": "712:1:0", - "typeDescriptions": - { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "src": "704:9:0", - "typeDescriptions": - { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - } - ], - "expression": - { - "argumentTypes": - [ - { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - ], - "id": 88, - "name": "assert", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": -3, - "src": "697:6:0", - "typeDescriptions": - { - "typeIdentifier": "t_function_assert_pure$_t_bool_$returns$__$", - "typeString": "function (bool) pure" - } - }, - "id": 94, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "697:17:0", - "tryCall": false, - "typeDescriptions": - { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 95, - "nodeType": "ExpressionStatement", - "src": "697:17:0" - } - ] - }, - "functionSelector": "e5b2857b", - "id": 97, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "getarray", - "nameLocation": "635:8:0", - "nodeType": "FunctionDefinition", - "parameters": - { - "id": 86, - "nodeType": "ParameterList", - "parameters": - [ - { - "constant": false, - "id": 83, - "mutability": "mutable", - "name": "c", - "nameLocation": "661:1:0", - "nodeType": "VariableDeclaration", - "scope": 97, - "src": "644:18:0", - "stateVariable": false, - "storageLocation": "memory", - "typeDescriptions": - { - "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", - "typeString": "address[]" - }, - "typeName": - { - "baseType": - { - "id": 81, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "644:7:0", - "stateMutability": "nonpayable", - "typeDescriptions": - { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "id": 82, - "nodeType": "ArrayTypeName", - "src": "644:9:0", - "typeDescriptions": - { - "typeIdentifier": "t_array$_t_address_$dyn_storage_ptr", - "typeString": "address[]" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 85, - "mutability": "mutable", - "name": "e", - "nameLocation": "672:1:0", - "nodeType": "VariableDeclaration", - "scope": 97, - "src": "664:9:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": - { - "id": 84, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "664:7:0", - "stateMutability": "nonpayable", - "typeDescriptions": - { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "visibility": "internal" - } - ], - "src": "643:31:0" - }, - "returnParameters": - { - "id": 87, - "nodeType": "ParameterList", - "parameters": [], - "src": "687:0:0" - }, - "scope": 135, - "src": "626:95:0", - "stateMutability": "pure", - "virtual": false, - "visibility": "public" - }, - { - "body": - { - "id": 119, - "nodeType": "Block", - "src": "763:90:0", - "statements": - [ - { - "assignments": - [ - 104 - ], - "declarations": - [ - { - "constant": false, - "id": 104, - "mutability": "mutable", - "name": "b", - "nameLocation": "790:1:0", - "nodeType": "VariableDeclaration", - "scope": 119, - "src": "773:18:0", - "stateVariable": false, - "storageLocation": "memory", - "typeDescriptions": - { - "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", - "typeString": "address[]" - }, - "typeName": - { - "baseType": - { - "id": 102, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "773:7:0", - "typeDescriptions": - { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "id": 103, - "nodeType": "ArrayTypeName", - "src": "773:9:0", - "typeDescriptions": - { - "typeIdentifier": "t_array$_t_address_$dyn_storage_ptr", - "typeString": "address[]" - } - }, - "visibility": "internal" - } - ], - "id": 108, - "initialValue": - { - "arguments": [], - "expression": - { - "argumentTypes": [], - "expression": - { - "id": 105, - "name": "this", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": -28, - "src": "794:4:0", - "typeDescriptions": - { - "typeIdentifier": "t_contract$_C_$135", - "typeString": "contract C" - } - }, - "id": 106, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "foo", - "nodeType": "MemberAccess", - "referencedDeclaration": 60, - "src": "794:8:0", - "typeDescriptions": - { - "typeIdentifier": "t_function_external_view$__$returns$_t_array$_t_address_$dyn_memory_ptr_$", - "typeString": "function () view external returns (address[] memory)" - } - }, - "id": 107, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "794:10:0", - "tryCall": false, - "typeDescriptions": - { - "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", - "typeString": "address[] memory" - } - }, - "nodeType": "VariableDeclarationStatement", - "src": "773:31:0" - }, - { - "expression": - { - "arguments": - [ - { - "id": 112, - "name": "b", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 104, - "src": "829:1:0", - "typeDescriptions": - { - "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", - "typeString": "address[] memory" - } - }, - { - "arguments": - [ - { - "id": 115, - "name": "this", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": -28, - "src": "840:4:0", - "typeDescriptions": - { - "typeIdentifier": "t_contract$_C_$135", - "typeString": "contract C" - } - } - ], - "expression": - { - "argumentTypes": - [ - { - "typeIdentifier": "t_contract$_C_$135", - "typeString": "contract C" - } - ], - "id": 114, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "nodeType": "ElementaryTypeNameExpression", - "src": "832:7:0", - "typeDescriptions": - { - "typeIdentifier": "t_type$_t_address_$", - "typeString": "type(address)" - }, - "typeName": - { - "id": 113, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "832:7:0", - "typeDescriptions": {} - } - }, - "id": 116, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "typeConversion", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "832:13:0", - "tryCall": false, - "typeDescriptions": - { - "typeIdentifier": "t_address", - "typeString": "address" - } - } - ], - "expression": - { - "argumentTypes": - [ - { - "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", - "typeString": "address[] memory" - }, - { - "typeIdentifier": "t_address", - "typeString": "address" - } - ], - "expression": - { - "id": 109, - "name": "Utils", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 33, - "src": "814:5:0", - "typeDescriptions": - { - "typeIdentifier": "t_type$_t_contract$_Utils_$33_$", - "typeString": "type(library Utils)" - } - }, - "id": 111, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "getarray", - "nodeType": "MemberAccess", - "referencedDeclaration": 18, - "src": "814:14:0", - "typeDescriptions": - { - "typeIdentifier": "t_function_internal_pure$_t_array$_t_address_$dyn_memory_ptr_$_t_address_$returns$__$", - "typeString": "function (address[] memory,address) pure" - } - }, - "id": 117, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "814:32:0", - "tryCall": false, - "typeDescriptions": - { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 118, - "nodeType": "ExpressionStatement", - "src": "814:32:0" - } - ] - }, - "functionSelector": "d3ab473b", - "id": 120, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "callmyself", - "nameLocation": "736:10:0", - "nodeType": "FunctionDefinition", - "parameters": - { - "id": 98, - "nodeType": "ParameterList", - "parameters": [], - "src": "746:2:0" - }, - "returnParameters": - { - "id": 99, - "nodeType": "ParameterList", - "parameters": [], - "src": "763:0:0" - }, - "scope": 135, - "src": "727:126:0", - "stateMutability": "view", - "virtual": false, - "visibility": "external" - }, - { - "body": - { - "id": 133, - "nodeType": "Block", - "src": "915:29:0", - "statements": - [ - { - "expression": - { - "commonType": - { - "typeIdentifier": "t_int8", - "typeString": "int8" - }, - "id": 131, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": - { - "id": 129, - "name": "c", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 122, - "src": "932:1:0", - "typeDescriptions": - { - "typeIdentifier": "t_int8", - "typeString": "int8" - } - }, - "nodeType": "BinaryOperation", - "operator": "+", - "rightExpression": - { - "id": 130, - "name": "d", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 124, - "src": "936:1:0", - "typeDescriptions": - { - "typeIdentifier": "t_int8", - "typeString": "int8" - } - }, - "src": "932:5:0", - "typeDescriptions": - { - "typeIdentifier": "t_int8", - "typeString": "int8" - } - }, - "functionReturnParameters": 128, - "id": 132, - "nodeType": "Return", - "src": "925:12:0" - } - ] - }, - "functionSelector": "e2666777", - "id": 134, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "add", - "nameLocation": "868:3:0", - "nodeType": "FunctionDefinition", - "parameters": - { - "id": 125, - "nodeType": "ParameterList", - "parameters": - [ - { - "constant": false, - "id": 122, - "mutability": "mutable", - "name": "c", - "nameLocation": "877:1:0", - "nodeType": "VariableDeclaration", - "scope": 134, - "src": "872:6:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_int8", - "typeString": "int8" - }, - "typeName": - { - "id": 121, - "name": "int8", - "nodeType": "ElementaryTypeName", - "src": "872:4:0", - "typeDescriptions": - { - "typeIdentifier": "t_int8", - "typeString": "int8" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 124, - "mutability": "mutable", - "name": "d", - "nameLocation": "885:1:0", - "nodeType": "VariableDeclaration", - "scope": 134, - "src": "880:6:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_int8", - "typeString": "int8" - }, - "typeName": - { - "id": 123, - "name": "int8", - "nodeType": "ElementaryTypeName", - "src": "880:4:0", - "typeDescriptions": - { - "typeIdentifier": "t_int8", - "typeString": "int8" - } - }, - "visibility": "internal" - } - ], - "src": "871:16:0" - }, - "returnParameters": - { - "id": 128, - "nodeType": "ParameterList", - "parameters": - [ - { - "constant": false, - "id": 127, - "mutability": "mutable", - "name": "", - "nameLocation": "-1:-1:-1", - "nodeType": "VariableDeclaration", - "scope": 134, - "src": "909:4:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_int8", - "typeString": "int8" - }, - "typeName": - { - "id": 126, - "name": "int8", - "nodeType": "ElementaryTypeName", - "src": "909:4:0", - "typeDescriptions": - { - "typeIdentifier": "t_int8", - "typeString": "int8" - } - }, - "visibility": "internal" - } - ], - "src": "908:6:0" - }, - "scope": 135, - "src": "859:85:0", - "stateMutability": "pure", - "virtual": false, - "visibility": "public" - } - ], - "scope": 136, - "src": "280:666:0", - "usedErrors": [] - } - ], - "src": "42:905:0" -} \ No newline at end of file diff --git a/resources/regressions/multiple-contracts-2.json/input_json/C.sol_json.ast.json b/resources/regressions/multiple-contracts-2.json/input_json/C.sol_json.ast.json deleted file mode 100644 index a3306b6..0000000 --- a/resources/regressions/multiple-contracts-2.json/input_json/C.sol_json.ast.json +++ /dev/null @@ -1,1828 +0,0 @@ -{ - "absolutePath": "benchmarks/MultipleContracts/C.sol", - "exportedSymbols": - { - "C": - [ - 135 - ], - "Utils": - [ - 33 - ] - }, - "id": 136, - "license": "GPL-3.0-only", - "nodeType": "SourceUnit", - "nodes": - [ - { - "id": 1, - "literals": - [ - "solidity", - "^", - "0.8", - ".13" - ], - "nodeType": "PragmaDirective", - "src": "42:24:0" - }, - { - "abstract": false, - "baseContracts": [], - "canonicalName": "Utils", - "contractDependencies": [], - "contractKind": "library", - "fullyImplemented": true, - "id": 33, - "linearizedBaseContracts": - [ - 33 - ], - "name": "Utils", - "nameLocation": "76:5:0", - "nodeType": "ContractDefinition", - "nodes": - [ - { - "body": - { - "id": 17, - "nodeType": "Block", - "src": "151:34:0", - "statements": - [ - { - "expression": - { - "arguments": - [ - { - "commonType": - { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "id": 14, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": - { - "baseExpression": - { - "id": 10, - "name": "c", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4, - "src": "168:1:0", - "typeDescriptions": - { - "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", - "typeString": "address[] memory" - } - }, - "id": 12, - "indexExpression": - { - "hexValue": "30", - "id": 11, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "170:1:0", - "typeDescriptions": - { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - }, - "value": "0" - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "168:4:0", - "typeDescriptions": - { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "nodeType": "BinaryOperation", - "operator": "==", - "rightExpression": - { - "id": 13, - "name": "e", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 6, - "src": "176:1:0", - "typeDescriptions": - { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "src": "168:9:0", - "typeDescriptions": - { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - } - ], - "expression": - { - "argumentTypes": - [ - { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - ], - "id": 9, - "name": "assert", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": -3, - "src": "161:6:0", - "typeDescriptions": - { - "typeIdentifier": "t_function_assert_pure$_t_bool_$returns$__$", - "typeString": "function (bool) pure" - } - }, - "id": 15, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "161:17:0", - "tryCall": false, - "typeDescriptions": - { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 16, - "nodeType": "ExpressionStatement", - "src": "161:17:0" - } - ] - }, - "id": 18, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "getarray", - "nameLocation": "97:8:0", - "nodeType": "FunctionDefinition", - "parameters": - { - "id": 7, - "nodeType": "ParameterList", - "parameters": - [ - { - "constant": false, - "id": 4, - "mutability": "mutable", - "name": "c", - "nameLocation": "123:1:0", - "nodeType": "VariableDeclaration", - "scope": 18, - "src": "106:18:0", - "stateVariable": false, - "storageLocation": "memory", - "typeDescriptions": - { - "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", - "typeString": "address[]" - }, - "typeName": - { - "baseType": - { - "id": 2, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "106:7:0", - "stateMutability": "nonpayable", - "typeDescriptions": - { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "id": 3, - "nodeType": "ArrayTypeName", - "src": "106:9:0", - "typeDescriptions": - { - "typeIdentifier": "t_array$_t_address_$dyn_storage_ptr", - "typeString": "address[]" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 6, - "mutability": "mutable", - "name": "e", - "nameLocation": "134:1:0", - "nodeType": "VariableDeclaration", - "scope": 18, - "src": "126:9:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": - { - "id": 5, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "126:7:0", - "stateMutability": "nonpayable", - "typeDescriptions": - { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "visibility": "internal" - } - ], - "src": "105:31:0" - }, - "returnParameters": - { - "id": 8, - "nodeType": "ParameterList", - "parameters": [], - "src": "151:0:0" - }, - "scope": 33, - "src": "88:97:0", - "stateMutability": "pure", - "virtual": false, - "visibility": "internal" - }, - { - "body": - { - "id": 31, - "nodeType": "Block", - "src": "247:29:0", - "statements": - [ - { - "expression": - { - "commonType": - { - "typeIdentifier": "t_int8", - "typeString": "int8" - }, - "id": 29, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": - { - "id": 27, - "name": "a", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 20, - "src": "264:1:0", - "typeDescriptions": - { - "typeIdentifier": "t_int8", - "typeString": "int8" - } - }, - "nodeType": "BinaryOperation", - "operator": "+", - "rightExpression": - { - "id": 28, - "name": "b", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 22, - "src": "268:1:0", - "typeDescriptions": - { - "typeIdentifier": "t_int8", - "typeString": "int8" - } - }, - "src": "264:5:0", - "typeDescriptions": - { - "typeIdentifier": "t_int8", - "typeString": "int8" - } - }, - "functionReturnParameters": 26, - "id": 30, - "nodeType": "Return", - "src": "257:12:0" - } - ] - }, - "functionSelector": "e2666777", - "id": 32, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "add", - "nameLocation": "200:3:0", - "nodeType": "FunctionDefinition", - "parameters": - { - "id": 23, - "nodeType": "ParameterList", - "parameters": - [ - { - "constant": false, - "id": 20, - "mutability": "mutable", - "name": "a", - "nameLocation": "209:1:0", - "nodeType": "VariableDeclaration", - "scope": 32, - "src": "204:6:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_int8", - "typeString": "int8" - }, - "typeName": - { - "id": 19, - "name": "int8", - "nodeType": "ElementaryTypeName", - "src": "204:4:0", - "typeDescriptions": - { - "typeIdentifier": "t_int8", - "typeString": "int8" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 22, - "mutability": "mutable", - "name": "b", - "nameLocation": "217:1:0", - "nodeType": "VariableDeclaration", - "scope": 32, - "src": "212:6:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_int8", - "typeString": "int8" - }, - "typeName": - { - "id": 21, - "name": "int8", - "nodeType": "ElementaryTypeName", - "src": "212:4:0", - "typeDescriptions": - { - "typeIdentifier": "t_int8", - "typeString": "int8" - } - }, - "visibility": "internal" - } - ], - "src": "203:16:0" - }, - "returnParameters": - { - "id": 26, - "nodeType": "ParameterList", - "parameters": - [ - { - "constant": false, - "id": 25, - "mutability": "mutable", - "name": "", - "nameLocation": "-1:-1:-1", - "nodeType": "VariableDeclaration", - "scope": 32, - "src": "241:4:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_int8", - "typeString": "int8" - }, - "typeName": - { - "id": 24, - "name": "int8", - "nodeType": "ElementaryTypeName", - "src": "241:4:0", - "typeDescriptions": - { - "typeIdentifier": "t_int8", - "typeString": "int8" - } - }, - "visibility": "internal" - } - ], - "src": "240:6:0" - }, - "scope": 33, - "src": "191:85:0", - "stateMutability": "pure", - "virtual": false, - "visibility": "public" - } - ], - "scope": 136, - "src": "68:210:0", - "usedErrors": [] - }, - { - "abstract": false, - "baseContracts": [], - "canonicalName": "C", - "contractDependencies": [], - "contractKind": "contract", - "fullyImplemented": true, - "id": 135, - "linearizedBaseContracts": - [ - 135 - ], - "name": "C", - "nameLocation": "289:1:0", - "nodeType": "ContractDefinition", - "nodes": - [ - { - "body": - { - "id": 59, - "nodeType": "Block", - "src": "353:99:0", - "statements": - [ - { - "assignments": - [ - 43 - ], - "declarations": - [ - { - "constant": false, - "id": 43, - "mutability": "mutable", - "name": "a", - "nameLocation": "380:1:0", - "nodeType": "VariableDeclaration", - "scope": 59, - "src": "363:18:0", - "stateVariable": false, - "storageLocation": "memory", - "typeDescriptions": - { - "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", - "typeString": "address[]" - }, - "typeName": - { - "baseType": - { - "id": 41, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "363:7:0", - "typeDescriptions": - { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "id": 42, - "nodeType": "ArrayTypeName", - "src": "363:9:0", - "typeDescriptions": - { - "typeIdentifier": "t_array$_t_address_$dyn_storage_ptr", - "typeString": "address[]" - } - }, - "visibility": "internal" - } - ], - "id": 49, - "initialValue": - { - "arguments": - [ - { - "hexValue": "31", - "id": 47, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "398:1:0", - "typeDescriptions": - { - "typeIdentifier": "t_rational_1_by_1", - "typeString": "int_const 1" - }, - "value": "1" - } - ], - "expression": - { - "argumentTypes": - [ - { - "typeIdentifier": "t_rational_1_by_1", - "typeString": "int_const 1" - } - ], - "id": 46, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "nodeType": "NewExpression", - "src": "384:13:0", - "typeDescriptions": - { - "typeIdentifier": "t_function_objectcreation_pure$_t_uint256_$returns$_t_array$_t_address_$dyn_memory_ptr_$", - "typeString": "function (uint256) pure returns (address[] memory)" - }, - "typeName": - { - "baseType": - { - "id": 44, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "388:7:0", - "stateMutability": "nonpayable", - "typeDescriptions": - { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "id": 45, - "nodeType": "ArrayTypeName", - "src": "388:9:0", - "typeDescriptions": - { - "typeIdentifier": "t_array$_t_address_$dyn_storage_ptr", - "typeString": "address[]" - } - } - }, - "id": 48, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "384:16:0", - "tryCall": false, - "typeDescriptions": - { - "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", - "typeString": "address[] memory" - } - }, - "nodeType": "VariableDeclarationStatement", - "src": "363:37:0" - }, - { - "expression": - { - "id": 55, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": - { - "baseExpression": - { - "id": 50, - "name": "a", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 43, - "src": "410:1:0", - "typeDescriptions": - { - "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", - "typeString": "address[] memory" - } - }, - "id": 52, - "indexExpression": - { - "hexValue": "30", - "id": 51, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "412:1:0", - "typeDescriptions": - { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - }, - "value": "0" - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": true, - "nodeType": "IndexAccess", - "src": "410:4:0", - "typeDescriptions": - { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": - { - "expression": - { - "id": 53, - "name": "msg", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": -15, - "src": "417:3:0", - "typeDescriptions": - { - "typeIdentifier": "t_magic_message", - "typeString": "msg" - } - }, - "id": 54, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "sender", - "nodeType": "MemberAccess", - "src": "417:10:0", - "typeDescriptions": - { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "src": "410:17:0", - "typeDescriptions": - { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "id": 56, - "nodeType": "ExpressionStatement", - "src": "410:17:0" - }, - { - "expression": - { - "id": 57, - "name": "a", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 43, - "src": "444:1:0", - "typeDescriptions": - { - "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", - "typeString": "address[] memory" - } - }, - "functionReturnParameters": 38, - "id": 58, - "nodeType": "Return", - "src": "437:8:0" - } - ] - }, - "functionSelector": "c2985578", - "id": 60, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "foo", - "nameLocation": "306:3:0", - "nodeType": "FunctionDefinition", - "parameters": - { - "id": 34, - "nodeType": "ParameterList", - "parameters": [], - "src": "309:2:0" - }, - "returnParameters": - { - "id": 38, - "nodeType": "ParameterList", - "parameters": - [ - { - "constant": false, - "id": 37, - "mutability": "mutable", - "name": "", - "nameLocation": "-1:-1:-1", - "nodeType": "VariableDeclaration", - "scope": 60, - "src": "335:16:0", - "stateVariable": false, - "storageLocation": "memory", - "typeDescriptions": - { - "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", - "typeString": "address[]" - }, - "typeName": - { - "baseType": - { - "id": 35, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "335:7:0", - "stateMutability": "nonpayable", - "typeDescriptions": - { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "id": 36, - "nodeType": "ArrayTypeName", - "src": "335:9:0", - "typeDescriptions": - { - "typeIdentifier": "t_array$_t_address_$dyn_storage_ptr", - "typeString": "address[]" - } - }, - "visibility": "internal" - } - ], - "src": "334:18:0" - }, - "scope": 135, - "src": "297:155:0", - "stateMutability": "view", - "virtual": false, - "visibility": "external" - }, - { - "body": - { - "id": 79, - "nodeType": "Block", - "src": "532:88:0", - "statements": - [ - { - "assignments": - [ - 68 - ], - "declarations": - [ - { - "constant": false, - "id": 68, - "mutability": "mutable", - "name": "a", - "nameLocation": "550:1:0", - "nodeType": "VariableDeclaration", - "scope": 79, - "src": "542:9:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": - { - "id": 67, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "542:7:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - } - ], - "id": 70, - "initialValue": - { - "hexValue": "3130", - "id": 69, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "554:2:0", - "typeDescriptions": - { - "typeIdentifier": "t_rational_10_by_1", - "typeString": "int_const 10" - }, - "value": "10" - }, - "nodeType": "VariableDeclarationStatement", - "src": "542:14:0" - }, - { - "assignments": - [ - 72 - ], - "declarations": - [ - { - "constant": false, - "id": 72, - "mutability": "mutable", - "name": "res", - "nameLocation": "574:3:0", - "nodeType": "VariableDeclaration", - "scope": 79, - "src": "566:11:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": - { - "id": 71, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "566:7:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - } - ], - "id": 76, - "initialValue": - { - "commonType": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 75, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": - { - "id": 73, - "name": "a", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 68, - "src": "580:1:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "**", - "rightExpression": - { - "id": 74, - "name": "decimals", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 62, - "src": "585:8:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - } - }, - "src": "580:13:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "VariableDeclarationStatement", - "src": "566:27:0" - }, - { - "expression": - { - "id": 77, - "name": "res", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 72, - "src": "610:3:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "functionReturnParameters": 66, - "id": 78, - "nodeType": "Return", - "src": "603:10:0" - } - ] - }, - "functionSelector": "eb79f1be", - "id": 80, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "get10PowerDecimals", - "nameLocation": "467:18:0", - "nodeType": "FunctionDefinition", - "parameters": - { - "id": 63, - "nodeType": "ParameterList", - "parameters": - [ - { - "constant": false, - "id": 62, - "mutability": "mutable", - "name": "decimals", - "nameLocation": "492:8:0", - "nodeType": "VariableDeclaration", - "scope": 80, - "src": "486:14:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - }, - "typeName": - { - "id": 61, - "name": "uint8", - "nodeType": "ElementaryTypeName", - "src": "486:5:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - } - }, - "visibility": "internal" - } - ], - "src": "485:16:0" - }, - "returnParameters": - { - "id": 66, - "nodeType": "ParameterList", - "parameters": - [ - { - "constant": false, - "id": 65, - "mutability": "mutable", - "name": "", - "nameLocation": "-1:-1:-1", - "nodeType": "VariableDeclaration", - "scope": 80, - "src": "523:7:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": - { - "id": 64, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "523:7:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - } - ], - "src": "522:9:0" - }, - "scope": 135, - "src": "458:162:0", - "stateMutability": "pure", - "virtual": false, - "visibility": "public" - }, - { - "body": - { - "id": 96, - "nodeType": "Block", - "src": "687:34:0", - "statements": - [ - { - "expression": - { - "arguments": - [ - { - "commonType": - { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "id": 93, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": - { - "baseExpression": - { - "id": 89, - "name": "c", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 83, - "src": "704:1:0", - "typeDescriptions": - { - "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", - "typeString": "address[] memory" - } - }, - "id": 91, - "indexExpression": - { - "hexValue": "30", - "id": 90, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "706:1:0", - "typeDescriptions": - { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - }, - "value": "0" - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "704:4:0", - "typeDescriptions": - { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "nodeType": "BinaryOperation", - "operator": "==", - "rightExpression": - { - "id": 92, - "name": "e", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 85, - "src": "712:1:0", - "typeDescriptions": - { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "src": "704:9:0", - "typeDescriptions": - { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - } - ], - "expression": - { - "argumentTypes": - [ - { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - ], - "id": 88, - "name": "assert", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": -3, - "src": "697:6:0", - "typeDescriptions": - { - "typeIdentifier": "t_function_assert_pure$_t_bool_$returns$__$", - "typeString": "function (bool) pure" - } - }, - "id": 94, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "697:17:0", - "tryCall": false, - "typeDescriptions": - { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 95, - "nodeType": "ExpressionStatement", - "src": "697:17:0" - } - ] - }, - "functionSelector": "e5b2857b", - "id": 97, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "getarray", - "nameLocation": "635:8:0", - "nodeType": "FunctionDefinition", - "parameters": - { - "id": 86, - "nodeType": "ParameterList", - "parameters": - [ - { - "constant": false, - "id": 83, - "mutability": "mutable", - "name": "c", - "nameLocation": "661:1:0", - "nodeType": "VariableDeclaration", - "scope": 97, - "src": "644:18:0", - "stateVariable": false, - "storageLocation": "memory", - "typeDescriptions": - { - "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", - "typeString": "address[]" - }, - "typeName": - { - "baseType": - { - "id": 81, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "644:7:0", - "stateMutability": "nonpayable", - "typeDescriptions": - { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "id": 82, - "nodeType": "ArrayTypeName", - "src": "644:9:0", - "typeDescriptions": - { - "typeIdentifier": "t_array$_t_address_$dyn_storage_ptr", - "typeString": "address[]" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 85, - "mutability": "mutable", - "name": "e", - "nameLocation": "672:1:0", - "nodeType": "VariableDeclaration", - "scope": 97, - "src": "664:9:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": - { - "id": 84, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "664:7:0", - "stateMutability": "nonpayable", - "typeDescriptions": - { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "visibility": "internal" - } - ], - "src": "643:31:0" - }, - "returnParameters": - { - "id": 87, - "nodeType": "ParameterList", - "parameters": [], - "src": "687:0:0" - }, - "scope": 135, - "src": "626:95:0", - "stateMutability": "pure", - "virtual": false, - "visibility": "public" - }, - { - "body": - { - "id": 119, - "nodeType": "Block", - "src": "763:90:0", - "statements": - [ - { - "assignments": - [ - 104 - ], - "declarations": - [ - { - "constant": false, - "id": 104, - "mutability": "mutable", - "name": "b", - "nameLocation": "790:1:0", - "nodeType": "VariableDeclaration", - "scope": 119, - "src": "773:18:0", - "stateVariable": false, - "storageLocation": "memory", - "typeDescriptions": - { - "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", - "typeString": "address[]" - }, - "typeName": - { - "baseType": - { - "id": 102, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "773:7:0", - "typeDescriptions": - { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "id": 103, - "nodeType": "ArrayTypeName", - "src": "773:9:0", - "typeDescriptions": - { - "typeIdentifier": "t_array$_t_address_$dyn_storage_ptr", - "typeString": "address[]" - } - }, - "visibility": "internal" - } - ], - "id": 108, - "initialValue": - { - "arguments": [], - "expression": - { - "argumentTypes": [], - "expression": - { - "id": 105, - "name": "this", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": -28, - "src": "794:4:0", - "typeDescriptions": - { - "typeIdentifier": "t_contract$_C_$135", - "typeString": "contract C" - } - }, - "id": 106, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "foo", - "nodeType": "MemberAccess", - "referencedDeclaration": 60, - "src": "794:8:0", - "typeDescriptions": - { - "typeIdentifier": "t_function_external_view$__$returns$_t_array$_t_address_$dyn_memory_ptr_$", - "typeString": "function () view external returns (address[] memory)" - } - }, - "id": 107, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "794:10:0", - "tryCall": false, - "typeDescriptions": - { - "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", - "typeString": "address[] memory" - } - }, - "nodeType": "VariableDeclarationStatement", - "src": "773:31:0" - }, - { - "expression": - { - "arguments": - [ - { - "id": 112, - "name": "b", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 104, - "src": "829:1:0", - "typeDescriptions": - { - "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", - "typeString": "address[] memory" - } - }, - { - "arguments": - [ - { - "id": 115, - "name": "this", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": -28, - "src": "840:4:0", - "typeDescriptions": - { - "typeIdentifier": "t_contract$_C_$135", - "typeString": "contract C" - } - } - ], - "expression": - { - "argumentTypes": - [ - { - "typeIdentifier": "t_contract$_C_$135", - "typeString": "contract C" - } - ], - "id": 114, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "nodeType": "ElementaryTypeNameExpression", - "src": "832:7:0", - "typeDescriptions": - { - "typeIdentifier": "t_type$_t_address_$", - "typeString": "type(address)" - }, - "typeName": - { - "id": 113, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "832:7:0", - "typeDescriptions": {} - } - }, - "id": 116, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "typeConversion", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "832:13:0", - "tryCall": false, - "typeDescriptions": - { - "typeIdentifier": "t_address", - "typeString": "address" - } - } - ], - "expression": - { - "argumentTypes": - [ - { - "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", - "typeString": "address[] memory" - }, - { - "typeIdentifier": "t_address", - "typeString": "address" - } - ], - "expression": - { - "id": 109, - "name": "Utils", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 33, - "src": "814:5:0", - "typeDescriptions": - { - "typeIdentifier": "t_type$_t_contract$_Utils_$33_$", - "typeString": "type(library Utils)" - } - }, - "id": 111, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "getarray", - "nodeType": "MemberAccess", - "referencedDeclaration": 18, - "src": "814:14:0", - "typeDescriptions": - { - "typeIdentifier": "t_function_internal_pure$_t_array$_t_address_$dyn_memory_ptr_$_t_address_$returns$__$", - "typeString": "function (address[] memory,address) pure" - } - }, - "id": 117, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "814:32:0", - "tryCall": false, - "typeDescriptions": - { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 118, - "nodeType": "ExpressionStatement", - "src": "814:32:0" - } - ] - }, - "functionSelector": "d3ab473b", - "id": 120, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "callmyself", - "nameLocation": "736:10:0", - "nodeType": "FunctionDefinition", - "parameters": - { - "id": 98, - "nodeType": "ParameterList", - "parameters": [], - "src": "746:2:0" - }, - "returnParameters": - { - "id": 99, - "nodeType": "ParameterList", - "parameters": [], - "src": "763:0:0" - }, - "scope": 135, - "src": "727:126:0", - "stateMutability": "view", - "virtual": false, - "visibility": "external" - }, - { - "body": - { - "id": 133, - "nodeType": "Block", - "src": "915:29:0", - "statements": - [ - { - "expression": - { - "commonType": - { - "typeIdentifier": "t_int8", - "typeString": "int8" - }, - "id": 131, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": - { - "id": 129, - "name": "c", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 122, - "src": "932:1:0", - "typeDescriptions": - { - "typeIdentifier": "t_int8", - "typeString": "int8" - } - }, - "nodeType": "BinaryOperation", - "operator": "+", - "rightExpression": - { - "id": 130, - "name": "d", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 124, - "src": "936:1:0", - "typeDescriptions": - { - "typeIdentifier": "t_int8", - "typeString": "int8" - } - }, - "src": "932:5:0", - "typeDescriptions": - { - "typeIdentifier": "t_int8", - "typeString": "int8" - } - }, - "functionReturnParameters": 128, - "id": 132, - "nodeType": "Return", - "src": "925:12:0" - } - ] - }, - "functionSelector": "e2666777", - "id": 134, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "add", - "nameLocation": "868:3:0", - "nodeType": "FunctionDefinition", - "parameters": - { - "id": 125, - "nodeType": "ParameterList", - "parameters": - [ - { - "constant": false, - "id": 122, - "mutability": "mutable", - "name": "c", - "nameLocation": "877:1:0", - "nodeType": "VariableDeclaration", - "scope": 134, - "src": "872:6:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_int8", - "typeString": "int8" - }, - "typeName": - { - "id": 121, - "name": "int8", - "nodeType": "ElementaryTypeName", - "src": "872:4:0", - "typeDescriptions": - { - "typeIdentifier": "t_int8", - "typeString": "int8" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 124, - "mutability": "mutable", - "name": "d", - "nameLocation": "885:1:0", - "nodeType": "VariableDeclaration", - "scope": 134, - "src": "880:6:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_int8", - "typeString": "int8" - }, - "typeName": - { - "id": 123, - "name": "int8", - "nodeType": "ElementaryTypeName", - "src": "880:4:0", - "typeDescriptions": - { - "typeIdentifier": "t_int8", - "typeString": "int8" - } - }, - "visibility": "internal" - } - ], - "src": "871:16:0" - }, - "returnParameters": - { - "id": 128, - "nodeType": "ParameterList", - "parameters": - [ - { - "constant": false, - "id": 127, - "mutability": "mutable", - "name": "", - "nameLocation": "-1:-1:-1", - "nodeType": "VariableDeclaration", - "scope": 134, - "src": "909:4:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_int8", - "typeString": "int8" - }, - "typeName": - { - "id": 126, - "name": "int8", - "nodeType": "ElementaryTypeName", - "src": "909:4:0", - "typeDescriptions": - { - "typeIdentifier": "t_int8", - "typeString": "int8" - } - }, - "visibility": "internal" - } - ], - "src": "908:6:0" - }, - "scope": 135, - "src": "859:85:0", - "stateMutability": "pure", - "virtual": false, - "visibility": "public" - } - ], - "scope": 136, - "src": "280:666:0", - "usedErrors": [] - } - ], - "src": "42:905:0" -} \ No newline at end of file diff --git a/resources/regressions/multiple-contracts-2.json/mutants.log b/resources/regressions/multiple-contracts-2.json/mutants.log deleted file mode 100644 index 523683b..0000000 --- a/resources/regressions/multiple-contracts-2.json/mutants.log +++ /dev/null @@ -1,10 +0,0 @@ -1,BinaryOpMutation,MultipleContracts/C.sol,11:17, + ,- -2,BinaryOpMutation,MultipleContracts/C.sol,11:17, + ,* -3,BinaryOpMutation,MultipleContracts/C.sol,11:17, + ,/ -4,BinaryOpMutation,MultipleContracts/C.sol,11:17, + ,% -5,BinaryOpMutation,MultipleContracts/C.sol,24:24, ** ,+ -6,BinaryOpMutation,MultipleContracts/C.sol,24:24, ** ,- -7,BinaryOpMutation,MultipleContracts/C.sol,24:24, ** ,* -8,BinaryOpMutation,MultipleContracts/C.sol,24:24, ** ,/ -9,BinaryOpMutation,MultipleContracts/C.sol,24:24, ** ,% -10,SwapArgumentsOperatorMutation,MultipleContracts/C.sol,24:23,a ** decimals,decimals ** a diff --git a/resources/regressions/multiple-contracts-2.json/mutants/10/MultipleContracts/C.sol b/resources/regressions/multiple-contracts-2.json/mutants/10/MultipleContracts/C.sol deleted file mode 100644 index 55b45bf..0000000 --- a/resources/regressions/multiple-contracts-2.json/mutants/10/MultipleContracts/C.sol +++ /dev/null @@ -1,41 +0,0 @@ -// SPDX-License-Identifier: GPL-3.0-only - -pragma solidity ^0.8.13; - -library Utils { - function getarray(address[] memory c, address e) internal pure { - assert(c[0] == e); - } - - function add(int8 a, int8 b) public pure returns (int8) { - return a + b; - } -} - -contract C { - function foo() external view returns (address[] memory) { - address[] memory a = new address[](1); - a[0] = msg.sender; - return a; - } - - function get10PowerDecimals(uint8 decimals) public pure returns (uint256) { - uint256 a = 10; - /// SwapArgumentsOperatorMutation(`a ** decimals` |==> `decimals ** a`) of: `uint256 res = a ** decimals;` - uint256 res = decimals ** a; - return res; - } - - function getarray(address[] memory c, address e) public pure { - assert(c[0] == e); - } - - function callmyself() external view { - address[] memory b = this.foo(); - Utils.getarray(b, address(this)); - } - - function add(int8 c, int8 d) public pure returns (int8) { - return c + d; - } -} diff --git a/resources/regressions/multiple-contracts-2.json/mutants/5/MultipleContracts/C.sol b/resources/regressions/multiple-contracts-2.json/mutants/5/MultipleContracts/C.sol deleted file mode 100644 index 59da228..0000000 --- a/resources/regressions/multiple-contracts-2.json/mutants/5/MultipleContracts/C.sol +++ /dev/null @@ -1,41 +0,0 @@ -// SPDX-License-Identifier: GPL-3.0-only - -pragma solidity ^0.8.13; - -library Utils { - function getarray(address[] memory c, address e) internal pure { - assert(c[0] == e); - } - - function add(int8 a, int8 b) public pure returns (int8) { - return a + b; - } -} - -contract C { - function foo() external view returns (address[] memory) { - address[] memory a = new address[](1); - a[0] = msg.sender; - return a; - } - - function get10PowerDecimals(uint8 decimals) public pure returns (uint256) { - uint256 a = 10; - /// BinaryOpMutation(`**` |==> `+`) of: `uint256 res = a ** decimals;` - uint256 res = a+decimals; - return res; - } - - function getarray(address[] memory c, address e) public pure { - assert(c[0] == e); - } - - function callmyself() external view { - address[] memory b = this.foo(); - Utils.getarray(b, address(this)); - } - - function add(int8 c, int8 d) public pure returns (int8) { - return c + d; - } -} diff --git a/resources/regressions/multiple-contracts-2.json/mutants/6/MultipleContracts/C.sol b/resources/regressions/multiple-contracts-2.json/mutants/6/MultipleContracts/C.sol deleted file mode 100644 index 911e098..0000000 --- a/resources/regressions/multiple-contracts-2.json/mutants/6/MultipleContracts/C.sol +++ /dev/null @@ -1,41 +0,0 @@ -// SPDX-License-Identifier: GPL-3.0-only - -pragma solidity ^0.8.13; - -library Utils { - function getarray(address[] memory c, address e) internal pure { - assert(c[0] == e); - } - - function add(int8 a, int8 b) public pure returns (int8) { - return a + b; - } -} - -contract C { - function foo() external view returns (address[] memory) { - address[] memory a = new address[](1); - a[0] = msg.sender; - return a; - } - - function get10PowerDecimals(uint8 decimals) public pure returns (uint256) { - uint256 a = 10; - /// BinaryOpMutation(`**` |==> `-`) of: `uint256 res = a ** decimals;` - uint256 res = a-decimals; - return res; - } - - function getarray(address[] memory c, address e) public pure { - assert(c[0] == e); - } - - function callmyself() external view { - address[] memory b = this.foo(); - Utils.getarray(b, address(this)); - } - - function add(int8 c, int8 d) public pure returns (int8) { - return c + d; - } -} diff --git a/resources/regressions/multiple-contracts-2.json/mutants/7/MultipleContracts/C.sol b/resources/regressions/multiple-contracts-2.json/mutants/7/MultipleContracts/C.sol deleted file mode 100644 index 53ca08b..0000000 --- a/resources/regressions/multiple-contracts-2.json/mutants/7/MultipleContracts/C.sol +++ /dev/null @@ -1,41 +0,0 @@ -// SPDX-License-Identifier: GPL-3.0-only - -pragma solidity ^0.8.13; - -library Utils { - function getarray(address[] memory c, address e) internal pure { - assert(c[0] == e); - } - - function add(int8 a, int8 b) public pure returns (int8) { - return a + b; - } -} - -contract C { - function foo() external view returns (address[] memory) { - address[] memory a = new address[](1); - a[0] = msg.sender; - return a; - } - - function get10PowerDecimals(uint8 decimals) public pure returns (uint256) { - uint256 a = 10; - /// BinaryOpMutation(`**` |==> `*`) of: `uint256 res = a ** decimals;` - uint256 res = a*decimals; - return res; - } - - function getarray(address[] memory c, address e) public pure { - assert(c[0] == e); - } - - function callmyself() external view { - address[] memory b = this.foo(); - Utils.getarray(b, address(this)); - } - - function add(int8 c, int8 d) public pure returns (int8) { - return c + d; - } -} diff --git a/resources/regressions/multiple-contracts-2.json/mutants/8/MultipleContracts/C.sol b/resources/regressions/multiple-contracts-2.json/mutants/8/MultipleContracts/C.sol deleted file mode 100644 index 218d97b..0000000 --- a/resources/regressions/multiple-contracts-2.json/mutants/8/MultipleContracts/C.sol +++ /dev/null @@ -1,41 +0,0 @@ -// SPDX-License-Identifier: GPL-3.0-only - -pragma solidity ^0.8.13; - -library Utils { - function getarray(address[] memory c, address e) internal pure { - assert(c[0] == e); - } - - function add(int8 a, int8 b) public pure returns (int8) { - return a + b; - } -} - -contract C { - function foo() external view returns (address[] memory) { - address[] memory a = new address[](1); - a[0] = msg.sender; - return a; - } - - function get10PowerDecimals(uint8 decimals) public pure returns (uint256) { - uint256 a = 10; - /// BinaryOpMutation(`**` |==> `/`) of: `uint256 res = a ** decimals;` - uint256 res = a/decimals; - return res; - } - - function getarray(address[] memory c, address e) public pure { - assert(c[0] == e); - } - - function callmyself() external view { - address[] memory b = this.foo(); - Utils.getarray(b, address(this)); - } - - function add(int8 c, int8 d) public pure returns (int8) { - return c + d; - } -} diff --git a/resources/regressions/multiple-contracts-2.json/mutants/9/MultipleContracts/C.sol b/resources/regressions/multiple-contracts-2.json/mutants/9/MultipleContracts/C.sol deleted file mode 100644 index 98a4b5f..0000000 --- a/resources/regressions/multiple-contracts-2.json/mutants/9/MultipleContracts/C.sol +++ /dev/null @@ -1,41 +0,0 @@ -// SPDX-License-Identifier: GPL-3.0-only - -pragma solidity ^0.8.13; - -library Utils { - function getarray(address[] memory c, address e) internal pure { - assert(c[0] == e); - } - - function add(int8 a, int8 b) public pure returns (int8) { - return a + b; - } -} - -contract C { - function foo() external view returns (address[] memory) { - address[] memory a = new address[](1); - a[0] = msg.sender; - return a; - } - - function get10PowerDecimals(uint8 decimals) public pure returns (uint256) { - uint256 a = 10; - /// BinaryOpMutation(`**` |==> `%`) of: `uint256 res = a ** decimals;` - uint256 res = a%decimals; - return res; - } - - function getarray(address[] memory c, address e) public pure { - assert(c[0] == e); - } - - function callmyself() external view { - address[] memory b = this.foo(); - Utils.getarray(b, address(this)); - } - - function add(int8 c, int8 d) public pure returns (int8) { - return c + d; - } -} diff --git a/resources/regressions/multiple-contracts-3.json/gambit_results.json b/resources/regressions/multiple-contracts-3.json/gambit_results.json deleted file mode 100644 index 16e00d5..0000000 --- a/resources/regressions/multiple-contracts-3.json/gambit_results.json +++ /dev/null @@ -1,128 +0,0 @@ -[ - { - "description": "DeleteExpressionMutation", - "diff": "--- original\n+++ mutant\n@@ -4,7 +4,8 @@\n \n library Utils {\n function getarray(address[] memory c, address e) internal pure {\n- assert(c[0] == e);\n+ /// DeleteExpressionMutation(`assert(c[0] == e)` |==> `assert(true)`) of: `assert(c[0] == e);`\n+ assert(true);\n }\n \n function add(int8 a, int8 b) public pure returns (int8) {\n", - "id": "1", - "name": "mutants/1/MultipleContracts/C.sol", - "original": "MultipleContracts/C.sol", - }, - { - "description": "BinaryOpMutation", - "diff": "--- original\n+++ mutant\n@@ -8,7 +8,8 @@\n }\n \n function add(int8 a, int8 b) public pure returns (int8) {\n- return a + b;\n+ /// BinaryOpMutation(`+` |==> `-`) of: `return a + b;`\n+ return a-b;\n }\n }\n \n", - "id": "2", - "name": "mutants/2/MultipleContracts/C.sol", - "original": "MultipleContracts/C.sol", - }, - { - "description": "BinaryOpMutation", - "diff": "--- original\n+++ mutant\n@@ -8,7 +8,8 @@\n }\n \n function add(int8 a, int8 b) public pure returns (int8) {\n- return a + b;\n+ /// BinaryOpMutation(`+` |==> `*`) of: `return a + b;`\n+ return a*b;\n }\n }\n \n", - "id": "3", - "name": "mutants/3/MultipleContracts/C.sol", - "original": "MultipleContracts/C.sol", - }, - { - "description": "BinaryOpMutation", - "diff": "--- original\n+++ mutant\n@@ -8,7 +8,8 @@\n }\n \n function add(int8 a, int8 b) public pure returns (int8) {\n- return a + b;\n+ /// BinaryOpMutation(`+` |==> `/`) of: `return a + b;`\n+ return a/b;\n }\n }\n \n", - "id": "4", - "name": "mutants/4/MultipleContracts/C.sol", - "original": "MultipleContracts/C.sol", - }, - { - "description": "BinaryOpMutation", - "diff": "--- original\n+++ mutant\n@@ -8,7 +8,8 @@\n }\n \n function add(int8 a, int8 b) public pure returns (int8) {\n- return a + b;\n+ /// BinaryOpMutation(`+` |==> `%`) of: `return a + b;`\n+ return a%b;\n }\n }\n \n", - "id": "5", - "name": "mutants/5/MultipleContracts/C.sol", - "original": "MultipleContracts/C.sol", - }, - { - "description": "DeleteExpressionMutation", - "diff": "--- original\n+++ mutant\n@@ -15,7 +15,8 @@\n contract C {\n function foo() external view returns (address[] memory) {\n address[] memory a = new address[](1);\n- a[0] = msg.sender;\n+ /// DeleteExpressionMutation(`a[0] = msg.sender` |==> `assert(true)`) of: `a[0] = msg.sender;`\n+ assert(true);\n return a;\n }\n \n", - "id": "6", - "name": "mutants/6/MultipleContracts/C.sol", - "original": "MultipleContracts/C.sol", - }, - { - "description": "BinaryOpMutation", - "diff": "--- original\n+++ mutant\n@@ -21,7 +21,8 @@\n \n function get10PowerDecimals(uint8 decimals) public pure returns (uint256) {\n uint256 a = 10;\n- uint256 res = a ** decimals;\n+ /// BinaryOpMutation(`**` |==> `+`) of: `uint256 res = a ** decimals;`\n+ uint256 res = a+decimals;\n return res;\n }\n \n", - "id": "7", - "name": "mutants/7/MultipleContracts/C.sol", - "original": "MultipleContracts/C.sol", - }, - { - "description": "BinaryOpMutation", - "diff": "--- original\n+++ mutant\n@@ -21,7 +21,8 @@\n \n function get10PowerDecimals(uint8 decimals) public pure returns (uint256) {\n uint256 a = 10;\n- uint256 res = a ** decimals;\n+ /// BinaryOpMutation(`**` |==> `-`) of: `uint256 res = a ** decimals;`\n+ uint256 res = a-decimals;\n return res;\n }\n \n", - "id": "8", - "name": "mutants/8/MultipleContracts/C.sol", - "original": "MultipleContracts/C.sol", - }, - { - "description": "BinaryOpMutation", - "diff": "--- original\n+++ mutant\n@@ -21,7 +21,8 @@\n \n function get10PowerDecimals(uint8 decimals) public pure returns (uint256) {\n uint256 a = 10;\n- uint256 res = a ** decimals;\n+ /// BinaryOpMutation(`**` |==> `*`) of: `uint256 res = a ** decimals;`\n+ uint256 res = a*decimals;\n return res;\n }\n \n", - "id": "9", - "name": "mutants/9/MultipleContracts/C.sol", - "original": "MultipleContracts/C.sol", - }, - { - "description": "BinaryOpMutation", - "diff": "--- original\n+++ mutant\n@@ -21,7 +21,8 @@\n \n function get10PowerDecimals(uint8 decimals) public pure returns (uint256) {\n uint256 a = 10;\n- uint256 res = a ** decimals;\n+ /// BinaryOpMutation(`**` |==> `/`) of: `uint256 res = a ** decimals;`\n+ uint256 res = a/decimals;\n return res;\n }\n \n", - "id": "10", - "name": "mutants/10/MultipleContracts/C.sol", - "original": "MultipleContracts/C.sol", - }, - { - "description": "BinaryOpMutation", - "diff": "--- original\n+++ mutant\n@@ -21,7 +21,8 @@\n \n function get10PowerDecimals(uint8 decimals) public pure returns (uint256) {\n uint256 a = 10;\n- uint256 res = a ** decimals;\n+ /// BinaryOpMutation(`**` |==> `%`) of: `uint256 res = a ** decimals;`\n+ uint256 res = a%decimals;\n return res;\n }\n \n", - "id": "11", - "name": "mutants/11/MultipleContracts/C.sol", - "original": "MultipleContracts/C.sol", - }, - { - "description": "SwapArgumentsOperatorMutation", - "diff": "--- original\n+++ mutant\n@@ -21,7 +21,8 @@\n \n function get10PowerDecimals(uint8 decimals) public pure returns (uint256) {\n uint256 a = 10;\n- uint256 res = a ** decimals;\n+ /// SwapArgumentsOperatorMutation(`a ** decimals` |==> `decimals ** a`) of: `uint256 res = a ** decimals;`\n+ uint256 res = decimals ** a;\n return res;\n }\n \n", - "id": "12", - "name": "mutants/12/MultipleContracts/C.sol", - "original": "MultipleContracts/C.sol", - }, - { - "description": "DeleteExpressionMutation", - "diff": "--- original\n+++ mutant\n@@ -26,7 +26,8 @@\n }\n \n function getarray(address[] memory c, address e) public pure {\n- assert(c[0] == e);\n+ /// DeleteExpressionMutation(`assert(c[0] == e)` |==> `assert(true)`) of: `assert(c[0] == e);`\n+ assert(true);\n }\n \n function callmyself() external view {\n", - "id": "13", - "name": "mutants/13/MultipleContracts/C.sol", - "original": "MultipleContracts/C.sol", - }, - { - "description": "DeleteExpressionMutation", - "diff": "--- original\n+++ mutant\n@@ -31,7 +31,8 @@\n \n function callmyself() external view {\n address[] memory b = this.foo();\n- Utils.getarray(b, address(this));\n+ /// DeleteExpressionMutation(`Utils.getarray(b, address(this))` |==> `assert(true)`) of: `Utils.getarray(b, address(this));`\n+ assert(true);\n }\n \n function add(int8 c, int8 d) public pure returns (int8) {\n", - "id": "14", - "name": "mutants/14/MultipleContracts/C.sol", - "original": "MultipleContracts/C.sol", - }, - { - "description": "BinaryOpMutation", - "diff": "--- original\n+++ mutant\n@@ -35,6 +35,7 @@\n }\n \n function add(int8 c, int8 d) public pure returns (int8) {\n- return c + d;\n+ /// BinaryOpMutation(`+` |==> `-`) of: `return c + d;`\n+ return c-d;\n }\n }\n", - "id": "15", - "name": "mutants/15/MultipleContracts/C.sol", - "original": "MultipleContracts/C.sol", - }, - { - "description": "BinaryOpMutation", - "diff": "--- original\n+++ mutant\n@@ -35,6 +35,7 @@\n }\n \n function add(int8 c, int8 d) public pure returns (int8) {\n- return c + d;\n+ /// BinaryOpMutation(`+` |==> `*`) of: `return c + d;`\n+ return c*d;\n }\n }\n", - "id": "16", - "name": "mutants/16/MultipleContracts/C.sol", - "original": "MultipleContracts/C.sol", - }, - { - "description": "BinaryOpMutation", - "diff": "--- original\n+++ mutant\n@@ -35,6 +35,7 @@\n }\n \n function add(int8 c, int8 d) public pure returns (int8) {\n- return c + d;\n+ /// BinaryOpMutation(`+` |==> `/`) of: `return c + d;`\n+ return c/d;\n }\n }\n", - "id": "17", - "name": "mutants/17/MultipleContracts/C.sol", - "original": "MultipleContracts/C.sol", - }, - { - "description": "BinaryOpMutation", - "diff": "--- original\n+++ mutant\n@@ -35,6 +35,7 @@\n }\n \n function add(int8 c, int8 d) public pure returns (int8) {\n- return c + d;\n+ /// BinaryOpMutation(`+` |==> `%`) of: `return c + d;`\n+ return c%d;\n }\n }\n", - "id": "18", - "name": "mutants/18/MultipleContracts/C.sol", - "original": "MultipleContracts/C.sol", - } -] \ No newline at end of file diff --git a/resources/regressions/multiple-contracts-3.json/input_json/C.sol_json.ast b/resources/regressions/multiple-contracts-3.json/input_json/C.sol_json.ast deleted file mode 100644 index a3306b6..0000000 --- a/resources/regressions/multiple-contracts-3.json/input_json/C.sol_json.ast +++ /dev/null @@ -1,1828 +0,0 @@ -{ - "absolutePath": "benchmarks/MultipleContracts/C.sol", - "exportedSymbols": - { - "C": - [ - 135 - ], - "Utils": - [ - 33 - ] - }, - "id": 136, - "license": "GPL-3.0-only", - "nodeType": "SourceUnit", - "nodes": - [ - { - "id": 1, - "literals": - [ - "solidity", - "^", - "0.8", - ".13" - ], - "nodeType": "PragmaDirective", - "src": "42:24:0" - }, - { - "abstract": false, - "baseContracts": [], - "canonicalName": "Utils", - "contractDependencies": [], - "contractKind": "library", - "fullyImplemented": true, - "id": 33, - "linearizedBaseContracts": - [ - 33 - ], - "name": "Utils", - "nameLocation": "76:5:0", - "nodeType": "ContractDefinition", - "nodes": - [ - { - "body": - { - "id": 17, - "nodeType": "Block", - "src": "151:34:0", - "statements": - [ - { - "expression": - { - "arguments": - [ - { - "commonType": - { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "id": 14, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": - { - "baseExpression": - { - "id": 10, - "name": "c", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4, - "src": "168:1:0", - "typeDescriptions": - { - "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", - "typeString": "address[] memory" - } - }, - "id": 12, - "indexExpression": - { - "hexValue": "30", - "id": 11, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "170:1:0", - "typeDescriptions": - { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - }, - "value": "0" - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "168:4:0", - "typeDescriptions": - { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "nodeType": "BinaryOperation", - "operator": "==", - "rightExpression": - { - "id": 13, - "name": "e", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 6, - "src": "176:1:0", - "typeDescriptions": - { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "src": "168:9:0", - "typeDescriptions": - { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - } - ], - "expression": - { - "argumentTypes": - [ - { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - ], - "id": 9, - "name": "assert", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": -3, - "src": "161:6:0", - "typeDescriptions": - { - "typeIdentifier": "t_function_assert_pure$_t_bool_$returns$__$", - "typeString": "function (bool) pure" - } - }, - "id": 15, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "161:17:0", - "tryCall": false, - "typeDescriptions": - { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 16, - "nodeType": "ExpressionStatement", - "src": "161:17:0" - } - ] - }, - "id": 18, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "getarray", - "nameLocation": "97:8:0", - "nodeType": "FunctionDefinition", - "parameters": - { - "id": 7, - "nodeType": "ParameterList", - "parameters": - [ - { - "constant": false, - "id": 4, - "mutability": "mutable", - "name": "c", - "nameLocation": "123:1:0", - "nodeType": "VariableDeclaration", - "scope": 18, - "src": "106:18:0", - "stateVariable": false, - "storageLocation": "memory", - "typeDescriptions": - { - "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", - "typeString": "address[]" - }, - "typeName": - { - "baseType": - { - "id": 2, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "106:7:0", - "stateMutability": "nonpayable", - "typeDescriptions": - { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "id": 3, - "nodeType": "ArrayTypeName", - "src": "106:9:0", - "typeDescriptions": - { - "typeIdentifier": "t_array$_t_address_$dyn_storage_ptr", - "typeString": "address[]" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 6, - "mutability": "mutable", - "name": "e", - "nameLocation": "134:1:0", - "nodeType": "VariableDeclaration", - "scope": 18, - "src": "126:9:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": - { - "id": 5, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "126:7:0", - "stateMutability": "nonpayable", - "typeDescriptions": - { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "visibility": "internal" - } - ], - "src": "105:31:0" - }, - "returnParameters": - { - "id": 8, - "nodeType": "ParameterList", - "parameters": [], - "src": "151:0:0" - }, - "scope": 33, - "src": "88:97:0", - "stateMutability": "pure", - "virtual": false, - "visibility": "internal" - }, - { - "body": - { - "id": 31, - "nodeType": "Block", - "src": "247:29:0", - "statements": - [ - { - "expression": - { - "commonType": - { - "typeIdentifier": "t_int8", - "typeString": "int8" - }, - "id": 29, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": - { - "id": 27, - "name": "a", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 20, - "src": "264:1:0", - "typeDescriptions": - { - "typeIdentifier": "t_int8", - "typeString": "int8" - } - }, - "nodeType": "BinaryOperation", - "operator": "+", - "rightExpression": - { - "id": 28, - "name": "b", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 22, - "src": "268:1:0", - "typeDescriptions": - { - "typeIdentifier": "t_int8", - "typeString": "int8" - } - }, - "src": "264:5:0", - "typeDescriptions": - { - "typeIdentifier": "t_int8", - "typeString": "int8" - } - }, - "functionReturnParameters": 26, - "id": 30, - "nodeType": "Return", - "src": "257:12:0" - } - ] - }, - "functionSelector": "e2666777", - "id": 32, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "add", - "nameLocation": "200:3:0", - "nodeType": "FunctionDefinition", - "parameters": - { - "id": 23, - "nodeType": "ParameterList", - "parameters": - [ - { - "constant": false, - "id": 20, - "mutability": "mutable", - "name": "a", - "nameLocation": "209:1:0", - "nodeType": "VariableDeclaration", - "scope": 32, - "src": "204:6:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_int8", - "typeString": "int8" - }, - "typeName": - { - "id": 19, - "name": "int8", - "nodeType": "ElementaryTypeName", - "src": "204:4:0", - "typeDescriptions": - { - "typeIdentifier": "t_int8", - "typeString": "int8" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 22, - "mutability": "mutable", - "name": "b", - "nameLocation": "217:1:0", - "nodeType": "VariableDeclaration", - "scope": 32, - "src": "212:6:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_int8", - "typeString": "int8" - }, - "typeName": - { - "id": 21, - "name": "int8", - "nodeType": "ElementaryTypeName", - "src": "212:4:0", - "typeDescriptions": - { - "typeIdentifier": "t_int8", - "typeString": "int8" - } - }, - "visibility": "internal" - } - ], - "src": "203:16:0" - }, - "returnParameters": - { - "id": 26, - "nodeType": "ParameterList", - "parameters": - [ - { - "constant": false, - "id": 25, - "mutability": "mutable", - "name": "", - "nameLocation": "-1:-1:-1", - "nodeType": "VariableDeclaration", - "scope": 32, - "src": "241:4:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_int8", - "typeString": "int8" - }, - "typeName": - { - "id": 24, - "name": "int8", - "nodeType": "ElementaryTypeName", - "src": "241:4:0", - "typeDescriptions": - { - "typeIdentifier": "t_int8", - "typeString": "int8" - } - }, - "visibility": "internal" - } - ], - "src": "240:6:0" - }, - "scope": 33, - "src": "191:85:0", - "stateMutability": "pure", - "virtual": false, - "visibility": "public" - } - ], - "scope": 136, - "src": "68:210:0", - "usedErrors": [] - }, - { - "abstract": false, - "baseContracts": [], - "canonicalName": "C", - "contractDependencies": [], - "contractKind": "contract", - "fullyImplemented": true, - "id": 135, - "linearizedBaseContracts": - [ - 135 - ], - "name": "C", - "nameLocation": "289:1:0", - "nodeType": "ContractDefinition", - "nodes": - [ - { - "body": - { - "id": 59, - "nodeType": "Block", - "src": "353:99:0", - "statements": - [ - { - "assignments": - [ - 43 - ], - "declarations": - [ - { - "constant": false, - "id": 43, - "mutability": "mutable", - "name": "a", - "nameLocation": "380:1:0", - "nodeType": "VariableDeclaration", - "scope": 59, - "src": "363:18:0", - "stateVariable": false, - "storageLocation": "memory", - "typeDescriptions": - { - "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", - "typeString": "address[]" - }, - "typeName": - { - "baseType": - { - "id": 41, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "363:7:0", - "typeDescriptions": - { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "id": 42, - "nodeType": "ArrayTypeName", - "src": "363:9:0", - "typeDescriptions": - { - "typeIdentifier": "t_array$_t_address_$dyn_storage_ptr", - "typeString": "address[]" - } - }, - "visibility": "internal" - } - ], - "id": 49, - "initialValue": - { - "arguments": - [ - { - "hexValue": "31", - "id": 47, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "398:1:0", - "typeDescriptions": - { - "typeIdentifier": "t_rational_1_by_1", - "typeString": "int_const 1" - }, - "value": "1" - } - ], - "expression": - { - "argumentTypes": - [ - { - "typeIdentifier": "t_rational_1_by_1", - "typeString": "int_const 1" - } - ], - "id": 46, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "nodeType": "NewExpression", - "src": "384:13:0", - "typeDescriptions": - { - "typeIdentifier": "t_function_objectcreation_pure$_t_uint256_$returns$_t_array$_t_address_$dyn_memory_ptr_$", - "typeString": "function (uint256) pure returns (address[] memory)" - }, - "typeName": - { - "baseType": - { - "id": 44, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "388:7:0", - "stateMutability": "nonpayable", - "typeDescriptions": - { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "id": 45, - "nodeType": "ArrayTypeName", - "src": "388:9:0", - "typeDescriptions": - { - "typeIdentifier": "t_array$_t_address_$dyn_storage_ptr", - "typeString": "address[]" - } - } - }, - "id": 48, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "384:16:0", - "tryCall": false, - "typeDescriptions": - { - "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", - "typeString": "address[] memory" - } - }, - "nodeType": "VariableDeclarationStatement", - "src": "363:37:0" - }, - { - "expression": - { - "id": 55, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": - { - "baseExpression": - { - "id": 50, - "name": "a", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 43, - "src": "410:1:0", - "typeDescriptions": - { - "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", - "typeString": "address[] memory" - } - }, - "id": 52, - "indexExpression": - { - "hexValue": "30", - "id": 51, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "412:1:0", - "typeDescriptions": - { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - }, - "value": "0" - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": true, - "nodeType": "IndexAccess", - "src": "410:4:0", - "typeDescriptions": - { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": - { - "expression": - { - "id": 53, - "name": "msg", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": -15, - "src": "417:3:0", - "typeDescriptions": - { - "typeIdentifier": "t_magic_message", - "typeString": "msg" - } - }, - "id": 54, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "sender", - "nodeType": "MemberAccess", - "src": "417:10:0", - "typeDescriptions": - { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "src": "410:17:0", - "typeDescriptions": - { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "id": 56, - "nodeType": "ExpressionStatement", - "src": "410:17:0" - }, - { - "expression": - { - "id": 57, - "name": "a", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 43, - "src": "444:1:0", - "typeDescriptions": - { - "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", - "typeString": "address[] memory" - } - }, - "functionReturnParameters": 38, - "id": 58, - "nodeType": "Return", - "src": "437:8:0" - } - ] - }, - "functionSelector": "c2985578", - "id": 60, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "foo", - "nameLocation": "306:3:0", - "nodeType": "FunctionDefinition", - "parameters": - { - "id": 34, - "nodeType": "ParameterList", - "parameters": [], - "src": "309:2:0" - }, - "returnParameters": - { - "id": 38, - "nodeType": "ParameterList", - "parameters": - [ - { - "constant": false, - "id": 37, - "mutability": "mutable", - "name": "", - "nameLocation": "-1:-1:-1", - "nodeType": "VariableDeclaration", - "scope": 60, - "src": "335:16:0", - "stateVariable": false, - "storageLocation": "memory", - "typeDescriptions": - { - "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", - "typeString": "address[]" - }, - "typeName": - { - "baseType": - { - "id": 35, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "335:7:0", - "stateMutability": "nonpayable", - "typeDescriptions": - { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "id": 36, - "nodeType": "ArrayTypeName", - "src": "335:9:0", - "typeDescriptions": - { - "typeIdentifier": "t_array$_t_address_$dyn_storage_ptr", - "typeString": "address[]" - } - }, - "visibility": "internal" - } - ], - "src": "334:18:0" - }, - "scope": 135, - "src": "297:155:0", - "stateMutability": "view", - "virtual": false, - "visibility": "external" - }, - { - "body": - { - "id": 79, - "nodeType": "Block", - "src": "532:88:0", - "statements": - [ - { - "assignments": - [ - 68 - ], - "declarations": - [ - { - "constant": false, - "id": 68, - "mutability": "mutable", - "name": "a", - "nameLocation": "550:1:0", - "nodeType": "VariableDeclaration", - "scope": 79, - "src": "542:9:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": - { - "id": 67, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "542:7:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - } - ], - "id": 70, - "initialValue": - { - "hexValue": "3130", - "id": 69, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "554:2:0", - "typeDescriptions": - { - "typeIdentifier": "t_rational_10_by_1", - "typeString": "int_const 10" - }, - "value": "10" - }, - "nodeType": "VariableDeclarationStatement", - "src": "542:14:0" - }, - { - "assignments": - [ - 72 - ], - "declarations": - [ - { - "constant": false, - "id": 72, - "mutability": "mutable", - "name": "res", - "nameLocation": "574:3:0", - "nodeType": "VariableDeclaration", - "scope": 79, - "src": "566:11:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": - { - "id": 71, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "566:7:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - } - ], - "id": 76, - "initialValue": - { - "commonType": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 75, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": - { - "id": 73, - "name": "a", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 68, - "src": "580:1:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "**", - "rightExpression": - { - "id": 74, - "name": "decimals", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 62, - "src": "585:8:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - } - }, - "src": "580:13:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "VariableDeclarationStatement", - "src": "566:27:0" - }, - { - "expression": - { - "id": 77, - "name": "res", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 72, - "src": "610:3:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "functionReturnParameters": 66, - "id": 78, - "nodeType": "Return", - "src": "603:10:0" - } - ] - }, - "functionSelector": "eb79f1be", - "id": 80, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "get10PowerDecimals", - "nameLocation": "467:18:0", - "nodeType": "FunctionDefinition", - "parameters": - { - "id": 63, - "nodeType": "ParameterList", - "parameters": - [ - { - "constant": false, - "id": 62, - "mutability": "mutable", - "name": "decimals", - "nameLocation": "492:8:0", - "nodeType": "VariableDeclaration", - "scope": 80, - "src": "486:14:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - }, - "typeName": - { - "id": 61, - "name": "uint8", - "nodeType": "ElementaryTypeName", - "src": "486:5:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - } - }, - "visibility": "internal" - } - ], - "src": "485:16:0" - }, - "returnParameters": - { - "id": 66, - "nodeType": "ParameterList", - "parameters": - [ - { - "constant": false, - "id": 65, - "mutability": "mutable", - "name": "", - "nameLocation": "-1:-1:-1", - "nodeType": "VariableDeclaration", - "scope": 80, - "src": "523:7:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": - { - "id": 64, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "523:7:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - } - ], - "src": "522:9:0" - }, - "scope": 135, - "src": "458:162:0", - "stateMutability": "pure", - "virtual": false, - "visibility": "public" - }, - { - "body": - { - "id": 96, - "nodeType": "Block", - "src": "687:34:0", - "statements": - [ - { - "expression": - { - "arguments": - [ - { - "commonType": - { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "id": 93, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": - { - "baseExpression": - { - "id": 89, - "name": "c", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 83, - "src": "704:1:0", - "typeDescriptions": - { - "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", - "typeString": "address[] memory" - } - }, - "id": 91, - "indexExpression": - { - "hexValue": "30", - "id": 90, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "706:1:0", - "typeDescriptions": - { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - }, - "value": "0" - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "704:4:0", - "typeDescriptions": - { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "nodeType": "BinaryOperation", - "operator": "==", - "rightExpression": - { - "id": 92, - "name": "e", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 85, - "src": "712:1:0", - "typeDescriptions": - { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "src": "704:9:0", - "typeDescriptions": - { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - } - ], - "expression": - { - "argumentTypes": - [ - { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - ], - "id": 88, - "name": "assert", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": -3, - "src": "697:6:0", - "typeDescriptions": - { - "typeIdentifier": "t_function_assert_pure$_t_bool_$returns$__$", - "typeString": "function (bool) pure" - } - }, - "id": 94, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "697:17:0", - "tryCall": false, - "typeDescriptions": - { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 95, - "nodeType": "ExpressionStatement", - "src": "697:17:0" - } - ] - }, - "functionSelector": "e5b2857b", - "id": 97, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "getarray", - "nameLocation": "635:8:0", - "nodeType": "FunctionDefinition", - "parameters": - { - "id": 86, - "nodeType": "ParameterList", - "parameters": - [ - { - "constant": false, - "id": 83, - "mutability": "mutable", - "name": "c", - "nameLocation": "661:1:0", - "nodeType": "VariableDeclaration", - "scope": 97, - "src": "644:18:0", - "stateVariable": false, - "storageLocation": "memory", - "typeDescriptions": - { - "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", - "typeString": "address[]" - }, - "typeName": - { - "baseType": - { - "id": 81, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "644:7:0", - "stateMutability": "nonpayable", - "typeDescriptions": - { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "id": 82, - "nodeType": "ArrayTypeName", - "src": "644:9:0", - "typeDescriptions": - { - "typeIdentifier": "t_array$_t_address_$dyn_storage_ptr", - "typeString": "address[]" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 85, - "mutability": "mutable", - "name": "e", - "nameLocation": "672:1:0", - "nodeType": "VariableDeclaration", - "scope": 97, - "src": "664:9:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": - { - "id": 84, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "664:7:0", - "stateMutability": "nonpayable", - "typeDescriptions": - { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "visibility": "internal" - } - ], - "src": "643:31:0" - }, - "returnParameters": - { - "id": 87, - "nodeType": "ParameterList", - "parameters": [], - "src": "687:0:0" - }, - "scope": 135, - "src": "626:95:0", - "stateMutability": "pure", - "virtual": false, - "visibility": "public" - }, - { - "body": - { - "id": 119, - "nodeType": "Block", - "src": "763:90:0", - "statements": - [ - { - "assignments": - [ - 104 - ], - "declarations": - [ - { - "constant": false, - "id": 104, - "mutability": "mutable", - "name": "b", - "nameLocation": "790:1:0", - "nodeType": "VariableDeclaration", - "scope": 119, - "src": "773:18:0", - "stateVariable": false, - "storageLocation": "memory", - "typeDescriptions": - { - "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", - "typeString": "address[]" - }, - "typeName": - { - "baseType": - { - "id": 102, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "773:7:0", - "typeDescriptions": - { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "id": 103, - "nodeType": "ArrayTypeName", - "src": "773:9:0", - "typeDescriptions": - { - "typeIdentifier": "t_array$_t_address_$dyn_storage_ptr", - "typeString": "address[]" - } - }, - "visibility": "internal" - } - ], - "id": 108, - "initialValue": - { - "arguments": [], - "expression": - { - "argumentTypes": [], - "expression": - { - "id": 105, - "name": "this", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": -28, - "src": "794:4:0", - "typeDescriptions": - { - "typeIdentifier": "t_contract$_C_$135", - "typeString": "contract C" - } - }, - "id": 106, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "foo", - "nodeType": "MemberAccess", - "referencedDeclaration": 60, - "src": "794:8:0", - "typeDescriptions": - { - "typeIdentifier": "t_function_external_view$__$returns$_t_array$_t_address_$dyn_memory_ptr_$", - "typeString": "function () view external returns (address[] memory)" - } - }, - "id": 107, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "794:10:0", - "tryCall": false, - "typeDescriptions": - { - "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", - "typeString": "address[] memory" - } - }, - "nodeType": "VariableDeclarationStatement", - "src": "773:31:0" - }, - { - "expression": - { - "arguments": - [ - { - "id": 112, - "name": "b", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 104, - "src": "829:1:0", - "typeDescriptions": - { - "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", - "typeString": "address[] memory" - } - }, - { - "arguments": - [ - { - "id": 115, - "name": "this", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": -28, - "src": "840:4:0", - "typeDescriptions": - { - "typeIdentifier": "t_contract$_C_$135", - "typeString": "contract C" - } - } - ], - "expression": - { - "argumentTypes": - [ - { - "typeIdentifier": "t_contract$_C_$135", - "typeString": "contract C" - } - ], - "id": 114, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "nodeType": "ElementaryTypeNameExpression", - "src": "832:7:0", - "typeDescriptions": - { - "typeIdentifier": "t_type$_t_address_$", - "typeString": "type(address)" - }, - "typeName": - { - "id": 113, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "832:7:0", - "typeDescriptions": {} - } - }, - "id": 116, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "typeConversion", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "832:13:0", - "tryCall": false, - "typeDescriptions": - { - "typeIdentifier": "t_address", - "typeString": "address" - } - } - ], - "expression": - { - "argumentTypes": - [ - { - "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", - "typeString": "address[] memory" - }, - { - "typeIdentifier": "t_address", - "typeString": "address" - } - ], - "expression": - { - "id": 109, - "name": "Utils", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 33, - "src": "814:5:0", - "typeDescriptions": - { - "typeIdentifier": "t_type$_t_contract$_Utils_$33_$", - "typeString": "type(library Utils)" - } - }, - "id": 111, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "getarray", - "nodeType": "MemberAccess", - "referencedDeclaration": 18, - "src": "814:14:0", - "typeDescriptions": - { - "typeIdentifier": "t_function_internal_pure$_t_array$_t_address_$dyn_memory_ptr_$_t_address_$returns$__$", - "typeString": "function (address[] memory,address) pure" - } - }, - "id": 117, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "814:32:0", - "tryCall": false, - "typeDescriptions": - { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 118, - "nodeType": "ExpressionStatement", - "src": "814:32:0" - } - ] - }, - "functionSelector": "d3ab473b", - "id": 120, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "callmyself", - "nameLocation": "736:10:0", - "nodeType": "FunctionDefinition", - "parameters": - { - "id": 98, - "nodeType": "ParameterList", - "parameters": [], - "src": "746:2:0" - }, - "returnParameters": - { - "id": 99, - "nodeType": "ParameterList", - "parameters": [], - "src": "763:0:0" - }, - "scope": 135, - "src": "727:126:0", - "stateMutability": "view", - "virtual": false, - "visibility": "external" - }, - { - "body": - { - "id": 133, - "nodeType": "Block", - "src": "915:29:0", - "statements": - [ - { - "expression": - { - "commonType": - { - "typeIdentifier": "t_int8", - "typeString": "int8" - }, - "id": 131, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": - { - "id": 129, - "name": "c", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 122, - "src": "932:1:0", - "typeDescriptions": - { - "typeIdentifier": "t_int8", - "typeString": "int8" - } - }, - "nodeType": "BinaryOperation", - "operator": "+", - "rightExpression": - { - "id": 130, - "name": "d", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 124, - "src": "936:1:0", - "typeDescriptions": - { - "typeIdentifier": "t_int8", - "typeString": "int8" - } - }, - "src": "932:5:0", - "typeDescriptions": - { - "typeIdentifier": "t_int8", - "typeString": "int8" - } - }, - "functionReturnParameters": 128, - "id": 132, - "nodeType": "Return", - "src": "925:12:0" - } - ] - }, - "functionSelector": "e2666777", - "id": 134, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "add", - "nameLocation": "868:3:0", - "nodeType": "FunctionDefinition", - "parameters": - { - "id": 125, - "nodeType": "ParameterList", - "parameters": - [ - { - "constant": false, - "id": 122, - "mutability": "mutable", - "name": "c", - "nameLocation": "877:1:0", - "nodeType": "VariableDeclaration", - "scope": 134, - "src": "872:6:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_int8", - "typeString": "int8" - }, - "typeName": - { - "id": 121, - "name": "int8", - "nodeType": "ElementaryTypeName", - "src": "872:4:0", - "typeDescriptions": - { - "typeIdentifier": "t_int8", - "typeString": "int8" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 124, - "mutability": "mutable", - "name": "d", - "nameLocation": "885:1:0", - "nodeType": "VariableDeclaration", - "scope": 134, - "src": "880:6:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_int8", - "typeString": "int8" - }, - "typeName": - { - "id": 123, - "name": "int8", - "nodeType": "ElementaryTypeName", - "src": "880:4:0", - "typeDescriptions": - { - "typeIdentifier": "t_int8", - "typeString": "int8" - } - }, - "visibility": "internal" - } - ], - "src": "871:16:0" - }, - "returnParameters": - { - "id": 128, - "nodeType": "ParameterList", - "parameters": - [ - { - "constant": false, - "id": 127, - "mutability": "mutable", - "name": "", - "nameLocation": "-1:-1:-1", - "nodeType": "VariableDeclaration", - "scope": 134, - "src": "909:4:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_int8", - "typeString": "int8" - }, - "typeName": - { - "id": 126, - "name": "int8", - "nodeType": "ElementaryTypeName", - "src": "909:4:0", - "typeDescriptions": - { - "typeIdentifier": "t_int8", - "typeString": "int8" - } - }, - "visibility": "internal" - } - ], - "src": "908:6:0" - }, - "scope": 135, - "src": "859:85:0", - "stateMutability": "pure", - "virtual": false, - "visibility": "public" - } - ], - "scope": 136, - "src": "280:666:0", - "usedErrors": [] - } - ], - "src": "42:905:0" -} \ No newline at end of file diff --git a/resources/regressions/multiple-contracts-3.json/input_json/C.sol_json.ast.json b/resources/regressions/multiple-contracts-3.json/input_json/C.sol_json.ast.json deleted file mode 100644 index a3306b6..0000000 --- a/resources/regressions/multiple-contracts-3.json/input_json/C.sol_json.ast.json +++ /dev/null @@ -1,1828 +0,0 @@ -{ - "absolutePath": "benchmarks/MultipleContracts/C.sol", - "exportedSymbols": - { - "C": - [ - 135 - ], - "Utils": - [ - 33 - ] - }, - "id": 136, - "license": "GPL-3.0-only", - "nodeType": "SourceUnit", - "nodes": - [ - { - "id": 1, - "literals": - [ - "solidity", - "^", - "0.8", - ".13" - ], - "nodeType": "PragmaDirective", - "src": "42:24:0" - }, - { - "abstract": false, - "baseContracts": [], - "canonicalName": "Utils", - "contractDependencies": [], - "contractKind": "library", - "fullyImplemented": true, - "id": 33, - "linearizedBaseContracts": - [ - 33 - ], - "name": "Utils", - "nameLocation": "76:5:0", - "nodeType": "ContractDefinition", - "nodes": - [ - { - "body": - { - "id": 17, - "nodeType": "Block", - "src": "151:34:0", - "statements": - [ - { - "expression": - { - "arguments": - [ - { - "commonType": - { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "id": 14, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": - { - "baseExpression": - { - "id": 10, - "name": "c", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4, - "src": "168:1:0", - "typeDescriptions": - { - "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", - "typeString": "address[] memory" - } - }, - "id": 12, - "indexExpression": - { - "hexValue": "30", - "id": 11, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "170:1:0", - "typeDescriptions": - { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - }, - "value": "0" - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "168:4:0", - "typeDescriptions": - { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "nodeType": "BinaryOperation", - "operator": "==", - "rightExpression": - { - "id": 13, - "name": "e", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 6, - "src": "176:1:0", - "typeDescriptions": - { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "src": "168:9:0", - "typeDescriptions": - { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - } - ], - "expression": - { - "argumentTypes": - [ - { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - ], - "id": 9, - "name": "assert", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": -3, - "src": "161:6:0", - "typeDescriptions": - { - "typeIdentifier": "t_function_assert_pure$_t_bool_$returns$__$", - "typeString": "function (bool) pure" - } - }, - "id": 15, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "161:17:0", - "tryCall": false, - "typeDescriptions": - { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 16, - "nodeType": "ExpressionStatement", - "src": "161:17:0" - } - ] - }, - "id": 18, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "getarray", - "nameLocation": "97:8:0", - "nodeType": "FunctionDefinition", - "parameters": - { - "id": 7, - "nodeType": "ParameterList", - "parameters": - [ - { - "constant": false, - "id": 4, - "mutability": "mutable", - "name": "c", - "nameLocation": "123:1:0", - "nodeType": "VariableDeclaration", - "scope": 18, - "src": "106:18:0", - "stateVariable": false, - "storageLocation": "memory", - "typeDescriptions": - { - "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", - "typeString": "address[]" - }, - "typeName": - { - "baseType": - { - "id": 2, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "106:7:0", - "stateMutability": "nonpayable", - "typeDescriptions": - { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "id": 3, - "nodeType": "ArrayTypeName", - "src": "106:9:0", - "typeDescriptions": - { - "typeIdentifier": "t_array$_t_address_$dyn_storage_ptr", - "typeString": "address[]" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 6, - "mutability": "mutable", - "name": "e", - "nameLocation": "134:1:0", - "nodeType": "VariableDeclaration", - "scope": 18, - "src": "126:9:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": - { - "id": 5, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "126:7:0", - "stateMutability": "nonpayable", - "typeDescriptions": - { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "visibility": "internal" - } - ], - "src": "105:31:0" - }, - "returnParameters": - { - "id": 8, - "nodeType": "ParameterList", - "parameters": [], - "src": "151:0:0" - }, - "scope": 33, - "src": "88:97:0", - "stateMutability": "pure", - "virtual": false, - "visibility": "internal" - }, - { - "body": - { - "id": 31, - "nodeType": "Block", - "src": "247:29:0", - "statements": - [ - { - "expression": - { - "commonType": - { - "typeIdentifier": "t_int8", - "typeString": "int8" - }, - "id": 29, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": - { - "id": 27, - "name": "a", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 20, - "src": "264:1:0", - "typeDescriptions": - { - "typeIdentifier": "t_int8", - "typeString": "int8" - } - }, - "nodeType": "BinaryOperation", - "operator": "+", - "rightExpression": - { - "id": 28, - "name": "b", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 22, - "src": "268:1:0", - "typeDescriptions": - { - "typeIdentifier": "t_int8", - "typeString": "int8" - } - }, - "src": "264:5:0", - "typeDescriptions": - { - "typeIdentifier": "t_int8", - "typeString": "int8" - } - }, - "functionReturnParameters": 26, - "id": 30, - "nodeType": "Return", - "src": "257:12:0" - } - ] - }, - "functionSelector": "e2666777", - "id": 32, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "add", - "nameLocation": "200:3:0", - "nodeType": "FunctionDefinition", - "parameters": - { - "id": 23, - "nodeType": "ParameterList", - "parameters": - [ - { - "constant": false, - "id": 20, - "mutability": "mutable", - "name": "a", - "nameLocation": "209:1:0", - "nodeType": "VariableDeclaration", - "scope": 32, - "src": "204:6:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_int8", - "typeString": "int8" - }, - "typeName": - { - "id": 19, - "name": "int8", - "nodeType": "ElementaryTypeName", - "src": "204:4:0", - "typeDescriptions": - { - "typeIdentifier": "t_int8", - "typeString": "int8" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 22, - "mutability": "mutable", - "name": "b", - "nameLocation": "217:1:0", - "nodeType": "VariableDeclaration", - "scope": 32, - "src": "212:6:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_int8", - "typeString": "int8" - }, - "typeName": - { - "id": 21, - "name": "int8", - "nodeType": "ElementaryTypeName", - "src": "212:4:0", - "typeDescriptions": - { - "typeIdentifier": "t_int8", - "typeString": "int8" - } - }, - "visibility": "internal" - } - ], - "src": "203:16:0" - }, - "returnParameters": - { - "id": 26, - "nodeType": "ParameterList", - "parameters": - [ - { - "constant": false, - "id": 25, - "mutability": "mutable", - "name": "", - "nameLocation": "-1:-1:-1", - "nodeType": "VariableDeclaration", - "scope": 32, - "src": "241:4:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_int8", - "typeString": "int8" - }, - "typeName": - { - "id": 24, - "name": "int8", - "nodeType": "ElementaryTypeName", - "src": "241:4:0", - "typeDescriptions": - { - "typeIdentifier": "t_int8", - "typeString": "int8" - } - }, - "visibility": "internal" - } - ], - "src": "240:6:0" - }, - "scope": 33, - "src": "191:85:0", - "stateMutability": "pure", - "virtual": false, - "visibility": "public" - } - ], - "scope": 136, - "src": "68:210:0", - "usedErrors": [] - }, - { - "abstract": false, - "baseContracts": [], - "canonicalName": "C", - "contractDependencies": [], - "contractKind": "contract", - "fullyImplemented": true, - "id": 135, - "linearizedBaseContracts": - [ - 135 - ], - "name": "C", - "nameLocation": "289:1:0", - "nodeType": "ContractDefinition", - "nodes": - [ - { - "body": - { - "id": 59, - "nodeType": "Block", - "src": "353:99:0", - "statements": - [ - { - "assignments": - [ - 43 - ], - "declarations": - [ - { - "constant": false, - "id": 43, - "mutability": "mutable", - "name": "a", - "nameLocation": "380:1:0", - "nodeType": "VariableDeclaration", - "scope": 59, - "src": "363:18:0", - "stateVariable": false, - "storageLocation": "memory", - "typeDescriptions": - { - "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", - "typeString": "address[]" - }, - "typeName": - { - "baseType": - { - "id": 41, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "363:7:0", - "typeDescriptions": - { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "id": 42, - "nodeType": "ArrayTypeName", - "src": "363:9:0", - "typeDescriptions": - { - "typeIdentifier": "t_array$_t_address_$dyn_storage_ptr", - "typeString": "address[]" - } - }, - "visibility": "internal" - } - ], - "id": 49, - "initialValue": - { - "arguments": - [ - { - "hexValue": "31", - "id": 47, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "398:1:0", - "typeDescriptions": - { - "typeIdentifier": "t_rational_1_by_1", - "typeString": "int_const 1" - }, - "value": "1" - } - ], - "expression": - { - "argumentTypes": - [ - { - "typeIdentifier": "t_rational_1_by_1", - "typeString": "int_const 1" - } - ], - "id": 46, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "nodeType": "NewExpression", - "src": "384:13:0", - "typeDescriptions": - { - "typeIdentifier": "t_function_objectcreation_pure$_t_uint256_$returns$_t_array$_t_address_$dyn_memory_ptr_$", - "typeString": "function (uint256) pure returns (address[] memory)" - }, - "typeName": - { - "baseType": - { - "id": 44, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "388:7:0", - "stateMutability": "nonpayable", - "typeDescriptions": - { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "id": 45, - "nodeType": "ArrayTypeName", - "src": "388:9:0", - "typeDescriptions": - { - "typeIdentifier": "t_array$_t_address_$dyn_storage_ptr", - "typeString": "address[]" - } - } - }, - "id": 48, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "384:16:0", - "tryCall": false, - "typeDescriptions": - { - "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", - "typeString": "address[] memory" - } - }, - "nodeType": "VariableDeclarationStatement", - "src": "363:37:0" - }, - { - "expression": - { - "id": 55, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": - { - "baseExpression": - { - "id": 50, - "name": "a", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 43, - "src": "410:1:0", - "typeDescriptions": - { - "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", - "typeString": "address[] memory" - } - }, - "id": 52, - "indexExpression": - { - "hexValue": "30", - "id": 51, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "412:1:0", - "typeDescriptions": - { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - }, - "value": "0" - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": true, - "nodeType": "IndexAccess", - "src": "410:4:0", - "typeDescriptions": - { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": - { - "expression": - { - "id": 53, - "name": "msg", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": -15, - "src": "417:3:0", - "typeDescriptions": - { - "typeIdentifier": "t_magic_message", - "typeString": "msg" - } - }, - "id": 54, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "sender", - "nodeType": "MemberAccess", - "src": "417:10:0", - "typeDescriptions": - { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "src": "410:17:0", - "typeDescriptions": - { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "id": 56, - "nodeType": "ExpressionStatement", - "src": "410:17:0" - }, - { - "expression": - { - "id": 57, - "name": "a", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 43, - "src": "444:1:0", - "typeDescriptions": - { - "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", - "typeString": "address[] memory" - } - }, - "functionReturnParameters": 38, - "id": 58, - "nodeType": "Return", - "src": "437:8:0" - } - ] - }, - "functionSelector": "c2985578", - "id": 60, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "foo", - "nameLocation": "306:3:0", - "nodeType": "FunctionDefinition", - "parameters": - { - "id": 34, - "nodeType": "ParameterList", - "parameters": [], - "src": "309:2:0" - }, - "returnParameters": - { - "id": 38, - "nodeType": "ParameterList", - "parameters": - [ - { - "constant": false, - "id": 37, - "mutability": "mutable", - "name": "", - "nameLocation": "-1:-1:-1", - "nodeType": "VariableDeclaration", - "scope": 60, - "src": "335:16:0", - "stateVariable": false, - "storageLocation": "memory", - "typeDescriptions": - { - "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", - "typeString": "address[]" - }, - "typeName": - { - "baseType": - { - "id": 35, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "335:7:0", - "stateMutability": "nonpayable", - "typeDescriptions": - { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "id": 36, - "nodeType": "ArrayTypeName", - "src": "335:9:0", - "typeDescriptions": - { - "typeIdentifier": "t_array$_t_address_$dyn_storage_ptr", - "typeString": "address[]" - } - }, - "visibility": "internal" - } - ], - "src": "334:18:0" - }, - "scope": 135, - "src": "297:155:0", - "stateMutability": "view", - "virtual": false, - "visibility": "external" - }, - { - "body": - { - "id": 79, - "nodeType": "Block", - "src": "532:88:0", - "statements": - [ - { - "assignments": - [ - 68 - ], - "declarations": - [ - { - "constant": false, - "id": 68, - "mutability": "mutable", - "name": "a", - "nameLocation": "550:1:0", - "nodeType": "VariableDeclaration", - "scope": 79, - "src": "542:9:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": - { - "id": 67, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "542:7:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - } - ], - "id": 70, - "initialValue": - { - "hexValue": "3130", - "id": 69, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "554:2:0", - "typeDescriptions": - { - "typeIdentifier": "t_rational_10_by_1", - "typeString": "int_const 10" - }, - "value": "10" - }, - "nodeType": "VariableDeclarationStatement", - "src": "542:14:0" - }, - { - "assignments": - [ - 72 - ], - "declarations": - [ - { - "constant": false, - "id": 72, - "mutability": "mutable", - "name": "res", - "nameLocation": "574:3:0", - "nodeType": "VariableDeclaration", - "scope": 79, - "src": "566:11:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": - { - "id": 71, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "566:7:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - } - ], - "id": 76, - "initialValue": - { - "commonType": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 75, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": - { - "id": 73, - "name": "a", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 68, - "src": "580:1:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "**", - "rightExpression": - { - "id": 74, - "name": "decimals", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 62, - "src": "585:8:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - } - }, - "src": "580:13:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "VariableDeclarationStatement", - "src": "566:27:0" - }, - { - "expression": - { - "id": 77, - "name": "res", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 72, - "src": "610:3:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "functionReturnParameters": 66, - "id": 78, - "nodeType": "Return", - "src": "603:10:0" - } - ] - }, - "functionSelector": "eb79f1be", - "id": 80, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "get10PowerDecimals", - "nameLocation": "467:18:0", - "nodeType": "FunctionDefinition", - "parameters": - { - "id": 63, - "nodeType": "ParameterList", - "parameters": - [ - { - "constant": false, - "id": 62, - "mutability": "mutable", - "name": "decimals", - "nameLocation": "492:8:0", - "nodeType": "VariableDeclaration", - "scope": 80, - "src": "486:14:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - }, - "typeName": - { - "id": 61, - "name": "uint8", - "nodeType": "ElementaryTypeName", - "src": "486:5:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - } - }, - "visibility": "internal" - } - ], - "src": "485:16:0" - }, - "returnParameters": - { - "id": 66, - "nodeType": "ParameterList", - "parameters": - [ - { - "constant": false, - "id": 65, - "mutability": "mutable", - "name": "", - "nameLocation": "-1:-1:-1", - "nodeType": "VariableDeclaration", - "scope": 80, - "src": "523:7:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": - { - "id": 64, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "523:7:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - } - ], - "src": "522:9:0" - }, - "scope": 135, - "src": "458:162:0", - "stateMutability": "pure", - "virtual": false, - "visibility": "public" - }, - { - "body": - { - "id": 96, - "nodeType": "Block", - "src": "687:34:0", - "statements": - [ - { - "expression": - { - "arguments": - [ - { - "commonType": - { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "id": 93, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": - { - "baseExpression": - { - "id": 89, - "name": "c", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 83, - "src": "704:1:0", - "typeDescriptions": - { - "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", - "typeString": "address[] memory" - } - }, - "id": 91, - "indexExpression": - { - "hexValue": "30", - "id": 90, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "706:1:0", - "typeDescriptions": - { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - }, - "value": "0" - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "704:4:0", - "typeDescriptions": - { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "nodeType": "BinaryOperation", - "operator": "==", - "rightExpression": - { - "id": 92, - "name": "e", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 85, - "src": "712:1:0", - "typeDescriptions": - { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "src": "704:9:0", - "typeDescriptions": - { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - } - ], - "expression": - { - "argumentTypes": - [ - { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - ], - "id": 88, - "name": "assert", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": -3, - "src": "697:6:0", - "typeDescriptions": - { - "typeIdentifier": "t_function_assert_pure$_t_bool_$returns$__$", - "typeString": "function (bool) pure" - } - }, - "id": 94, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "697:17:0", - "tryCall": false, - "typeDescriptions": - { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 95, - "nodeType": "ExpressionStatement", - "src": "697:17:0" - } - ] - }, - "functionSelector": "e5b2857b", - "id": 97, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "getarray", - "nameLocation": "635:8:0", - "nodeType": "FunctionDefinition", - "parameters": - { - "id": 86, - "nodeType": "ParameterList", - "parameters": - [ - { - "constant": false, - "id": 83, - "mutability": "mutable", - "name": "c", - "nameLocation": "661:1:0", - "nodeType": "VariableDeclaration", - "scope": 97, - "src": "644:18:0", - "stateVariable": false, - "storageLocation": "memory", - "typeDescriptions": - { - "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", - "typeString": "address[]" - }, - "typeName": - { - "baseType": - { - "id": 81, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "644:7:0", - "stateMutability": "nonpayable", - "typeDescriptions": - { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "id": 82, - "nodeType": "ArrayTypeName", - "src": "644:9:0", - "typeDescriptions": - { - "typeIdentifier": "t_array$_t_address_$dyn_storage_ptr", - "typeString": "address[]" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 85, - "mutability": "mutable", - "name": "e", - "nameLocation": "672:1:0", - "nodeType": "VariableDeclaration", - "scope": 97, - "src": "664:9:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": - { - "id": 84, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "664:7:0", - "stateMutability": "nonpayable", - "typeDescriptions": - { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "visibility": "internal" - } - ], - "src": "643:31:0" - }, - "returnParameters": - { - "id": 87, - "nodeType": "ParameterList", - "parameters": [], - "src": "687:0:0" - }, - "scope": 135, - "src": "626:95:0", - "stateMutability": "pure", - "virtual": false, - "visibility": "public" - }, - { - "body": - { - "id": 119, - "nodeType": "Block", - "src": "763:90:0", - "statements": - [ - { - "assignments": - [ - 104 - ], - "declarations": - [ - { - "constant": false, - "id": 104, - "mutability": "mutable", - "name": "b", - "nameLocation": "790:1:0", - "nodeType": "VariableDeclaration", - "scope": 119, - "src": "773:18:0", - "stateVariable": false, - "storageLocation": "memory", - "typeDescriptions": - { - "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", - "typeString": "address[]" - }, - "typeName": - { - "baseType": - { - "id": 102, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "773:7:0", - "typeDescriptions": - { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "id": 103, - "nodeType": "ArrayTypeName", - "src": "773:9:0", - "typeDescriptions": - { - "typeIdentifier": "t_array$_t_address_$dyn_storage_ptr", - "typeString": "address[]" - } - }, - "visibility": "internal" - } - ], - "id": 108, - "initialValue": - { - "arguments": [], - "expression": - { - "argumentTypes": [], - "expression": - { - "id": 105, - "name": "this", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": -28, - "src": "794:4:0", - "typeDescriptions": - { - "typeIdentifier": "t_contract$_C_$135", - "typeString": "contract C" - } - }, - "id": 106, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "foo", - "nodeType": "MemberAccess", - "referencedDeclaration": 60, - "src": "794:8:0", - "typeDescriptions": - { - "typeIdentifier": "t_function_external_view$__$returns$_t_array$_t_address_$dyn_memory_ptr_$", - "typeString": "function () view external returns (address[] memory)" - } - }, - "id": 107, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "794:10:0", - "tryCall": false, - "typeDescriptions": - { - "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", - "typeString": "address[] memory" - } - }, - "nodeType": "VariableDeclarationStatement", - "src": "773:31:0" - }, - { - "expression": - { - "arguments": - [ - { - "id": 112, - "name": "b", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 104, - "src": "829:1:0", - "typeDescriptions": - { - "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", - "typeString": "address[] memory" - } - }, - { - "arguments": - [ - { - "id": 115, - "name": "this", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": -28, - "src": "840:4:0", - "typeDescriptions": - { - "typeIdentifier": "t_contract$_C_$135", - "typeString": "contract C" - } - } - ], - "expression": - { - "argumentTypes": - [ - { - "typeIdentifier": "t_contract$_C_$135", - "typeString": "contract C" - } - ], - "id": 114, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "nodeType": "ElementaryTypeNameExpression", - "src": "832:7:0", - "typeDescriptions": - { - "typeIdentifier": "t_type$_t_address_$", - "typeString": "type(address)" - }, - "typeName": - { - "id": 113, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "832:7:0", - "typeDescriptions": {} - } - }, - "id": 116, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "typeConversion", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "832:13:0", - "tryCall": false, - "typeDescriptions": - { - "typeIdentifier": "t_address", - "typeString": "address" - } - } - ], - "expression": - { - "argumentTypes": - [ - { - "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", - "typeString": "address[] memory" - }, - { - "typeIdentifier": "t_address", - "typeString": "address" - } - ], - "expression": - { - "id": 109, - "name": "Utils", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 33, - "src": "814:5:0", - "typeDescriptions": - { - "typeIdentifier": "t_type$_t_contract$_Utils_$33_$", - "typeString": "type(library Utils)" - } - }, - "id": 111, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "getarray", - "nodeType": "MemberAccess", - "referencedDeclaration": 18, - "src": "814:14:0", - "typeDescriptions": - { - "typeIdentifier": "t_function_internal_pure$_t_array$_t_address_$dyn_memory_ptr_$_t_address_$returns$__$", - "typeString": "function (address[] memory,address) pure" - } - }, - "id": 117, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "814:32:0", - "tryCall": false, - "typeDescriptions": - { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 118, - "nodeType": "ExpressionStatement", - "src": "814:32:0" - } - ] - }, - "functionSelector": "d3ab473b", - "id": 120, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "callmyself", - "nameLocation": "736:10:0", - "nodeType": "FunctionDefinition", - "parameters": - { - "id": 98, - "nodeType": "ParameterList", - "parameters": [], - "src": "746:2:0" - }, - "returnParameters": - { - "id": 99, - "nodeType": "ParameterList", - "parameters": [], - "src": "763:0:0" - }, - "scope": 135, - "src": "727:126:0", - "stateMutability": "view", - "virtual": false, - "visibility": "external" - }, - { - "body": - { - "id": 133, - "nodeType": "Block", - "src": "915:29:0", - "statements": - [ - { - "expression": - { - "commonType": - { - "typeIdentifier": "t_int8", - "typeString": "int8" - }, - "id": 131, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": - { - "id": 129, - "name": "c", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 122, - "src": "932:1:0", - "typeDescriptions": - { - "typeIdentifier": "t_int8", - "typeString": "int8" - } - }, - "nodeType": "BinaryOperation", - "operator": "+", - "rightExpression": - { - "id": 130, - "name": "d", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 124, - "src": "936:1:0", - "typeDescriptions": - { - "typeIdentifier": "t_int8", - "typeString": "int8" - } - }, - "src": "932:5:0", - "typeDescriptions": - { - "typeIdentifier": "t_int8", - "typeString": "int8" - } - }, - "functionReturnParameters": 128, - "id": 132, - "nodeType": "Return", - "src": "925:12:0" - } - ] - }, - "functionSelector": "e2666777", - "id": 134, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "add", - "nameLocation": "868:3:0", - "nodeType": "FunctionDefinition", - "parameters": - { - "id": 125, - "nodeType": "ParameterList", - "parameters": - [ - { - "constant": false, - "id": 122, - "mutability": "mutable", - "name": "c", - "nameLocation": "877:1:0", - "nodeType": "VariableDeclaration", - "scope": 134, - "src": "872:6:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_int8", - "typeString": "int8" - }, - "typeName": - { - "id": 121, - "name": "int8", - "nodeType": "ElementaryTypeName", - "src": "872:4:0", - "typeDescriptions": - { - "typeIdentifier": "t_int8", - "typeString": "int8" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 124, - "mutability": "mutable", - "name": "d", - "nameLocation": "885:1:0", - "nodeType": "VariableDeclaration", - "scope": 134, - "src": "880:6:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_int8", - "typeString": "int8" - }, - "typeName": - { - "id": 123, - "name": "int8", - "nodeType": "ElementaryTypeName", - "src": "880:4:0", - "typeDescriptions": - { - "typeIdentifier": "t_int8", - "typeString": "int8" - } - }, - "visibility": "internal" - } - ], - "src": "871:16:0" - }, - "returnParameters": - { - "id": 128, - "nodeType": "ParameterList", - "parameters": - [ - { - "constant": false, - "id": 127, - "mutability": "mutable", - "name": "", - "nameLocation": "-1:-1:-1", - "nodeType": "VariableDeclaration", - "scope": 134, - "src": "909:4:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_int8", - "typeString": "int8" - }, - "typeName": - { - "id": 126, - "name": "int8", - "nodeType": "ElementaryTypeName", - "src": "909:4:0", - "typeDescriptions": - { - "typeIdentifier": "t_int8", - "typeString": "int8" - } - }, - "visibility": "internal" - } - ], - "src": "908:6:0" - }, - "scope": 135, - "src": "859:85:0", - "stateMutability": "pure", - "virtual": false, - "visibility": "public" - } - ], - "scope": 136, - "src": "280:666:0", - "usedErrors": [] - } - ], - "src": "42:905:0" -} \ No newline at end of file diff --git a/resources/regressions/multiple-contracts-3.json/mutants.log b/resources/regressions/multiple-contracts-3.json/mutants.log deleted file mode 100644 index 188e574..0000000 --- a/resources/regressions/multiple-contracts-3.json/mutants.log +++ /dev/null @@ -1,18 +0,0 @@ -1,DeleteExpressionMutation,MultipleContracts/C.sol,7:9,assert(c[0] == e),assert(true) -2,BinaryOpMutation,MultipleContracts/C.sol,11:17, + ,- -3,BinaryOpMutation,MultipleContracts/C.sol,11:17, + ,* -4,BinaryOpMutation,MultipleContracts/C.sol,11:17, + ,/ -5,BinaryOpMutation,MultipleContracts/C.sol,11:17, + ,% -6,DeleteExpressionMutation,MultipleContracts/C.sol,18:9,a[0] = msg.sender,assert(true) -7,BinaryOpMutation,MultipleContracts/C.sol,24:24, ** ,+ -8,BinaryOpMutation,MultipleContracts/C.sol,24:24, ** ,- -9,BinaryOpMutation,MultipleContracts/C.sol,24:24, ** ,* -10,BinaryOpMutation,MultipleContracts/C.sol,24:24, ** ,/ -11,BinaryOpMutation,MultipleContracts/C.sol,24:24, ** ,% -12,SwapArgumentsOperatorMutation,MultipleContracts/C.sol,24:23,a ** decimals,decimals ** a -13,DeleteExpressionMutation,MultipleContracts/C.sol,29:9,assert(c[0] == e),assert(true) -14,DeleteExpressionMutation,MultipleContracts/C.sol,34:9,"Utils.getarray(b, address(this))",assert(true) -15,BinaryOpMutation,MultipleContracts/C.sol,38:17, + ,- -16,BinaryOpMutation,MultipleContracts/C.sol,38:17, + ,* -17,BinaryOpMutation,MultipleContracts/C.sol,38:17, + ,/ -18,BinaryOpMutation,MultipleContracts/C.sol,38:17, + ,% diff --git a/resources/regressions/multiple-contracts-3.json/mutants/10/MultipleContracts/C.sol b/resources/regressions/multiple-contracts-3.json/mutants/10/MultipleContracts/C.sol deleted file mode 100644 index 218d97b..0000000 --- a/resources/regressions/multiple-contracts-3.json/mutants/10/MultipleContracts/C.sol +++ /dev/null @@ -1,41 +0,0 @@ -// SPDX-License-Identifier: GPL-3.0-only - -pragma solidity ^0.8.13; - -library Utils { - function getarray(address[] memory c, address e) internal pure { - assert(c[0] == e); - } - - function add(int8 a, int8 b) public pure returns (int8) { - return a + b; - } -} - -contract C { - function foo() external view returns (address[] memory) { - address[] memory a = new address[](1); - a[0] = msg.sender; - return a; - } - - function get10PowerDecimals(uint8 decimals) public pure returns (uint256) { - uint256 a = 10; - /// BinaryOpMutation(`**` |==> `/`) of: `uint256 res = a ** decimals;` - uint256 res = a/decimals; - return res; - } - - function getarray(address[] memory c, address e) public pure { - assert(c[0] == e); - } - - function callmyself() external view { - address[] memory b = this.foo(); - Utils.getarray(b, address(this)); - } - - function add(int8 c, int8 d) public pure returns (int8) { - return c + d; - } -} diff --git a/resources/regressions/multiple-contracts-3.json/mutants/11/MultipleContracts/C.sol b/resources/regressions/multiple-contracts-3.json/mutants/11/MultipleContracts/C.sol deleted file mode 100644 index 98a4b5f..0000000 --- a/resources/regressions/multiple-contracts-3.json/mutants/11/MultipleContracts/C.sol +++ /dev/null @@ -1,41 +0,0 @@ -// SPDX-License-Identifier: GPL-3.0-only - -pragma solidity ^0.8.13; - -library Utils { - function getarray(address[] memory c, address e) internal pure { - assert(c[0] == e); - } - - function add(int8 a, int8 b) public pure returns (int8) { - return a + b; - } -} - -contract C { - function foo() external view returns (address[] memory) { - address[] memory a = new address[](1); - a[0] = msg.sender; - return a; - } - - function get10PowerDecimals(uint8 decimals) public pure returns (uint256) { - uint256 a = 10; - /// BinaryOpMutation(`**` |==> `%`) of: `uint256 res = a ** decimals;` - uint256 res = a%decimals; - return res; - } - - function getarray(address[] memory c, address e) public pure { - assert(c[0] == e); - } - - function callmyself() external view { - address[] memory b = this.foo(); - Utils.getarray(b, address(this)); - } - - function add(int8 c, int8 d) public pure returns (int8) { - return c + d; - } -} diff --git a/resources/regressions/multiple-contracts-3.json/mutants/12/MultipleContracts/C.sol b/resources/regressions/multiple-contracts-3.json/mutants/12/MultipleContracts/C.sol deleted file mode 100644 index 55b45bf..0000000 --- a/resources/regressions/multiple-contracts-3.json/mutants/12/MultipleContracts/C.sol +++ /dev/null @@ -1,41 +0,0 @@ -// SPDX-License-Identifier: GPL-3.0-only - -pragma solidity ^0.8.13; - -library Utils { - function getarray(address[] memory c, address e) internal pure { - assert(c[0] == e); - } - - function add(int8 a, int8 b) public pure returns (int8) { - return a + b; - } -} - -contract C { - function foo() external view returns (address[] memory) { - address[] memory a = new address[](1); - a[0] = msg.sender; - return a; - } - - function get10PowerDecimals(uint8 decimals) public pure returns (uint256) { - uint256 a = 10; - /// SwapArgumentsOperatorMutation(`a ** decimals` |==> `decimals ** a`) of: `uint256 res = a ** decimals;` - uint256 res = decimals ** a; - return res; - } - - function getarray(address[] memory c, address e) public pure { - assert(c[0] == e); - } - - function callmyself() external view { - address[] memory b = this.foo(); - Utils.getarray(b, address(this)); - } - - function add(int8 c, int8 d) public pure returns (int8) { - return c + d; - } -} diff --git a/resources/regressions/multiple-contracts-3.json/mutants/2/MultipleContracts/C.sol b/resources/regressions/multiple-contracts-3.json/mutants/2/MultipleContracts/C.sol deleted file mode 100644 index a514961..0000000 --- a/resources/regressions/multiple-contracts-3.json/mutants/2/MultipleContracts/C.sol +++ /dev/null @@ -1,41 +0,0 @@ -// SPDX-License-Identifier: GPL-3.0-only - -pragma solidity ^0.8.13; - -library Utils { - function getarray(address[] memory c, address e) internal pure { - assert(c[0] == e); - } - - function add(int8 a, int8 b) public pure returns (int8) { - /// BinaryOpMutation(`+` |==> `-`) of: `return a + b;` - return a-b; - } -} - -contract C { - function foo() external view returns (address[] memory) { - address[] memory a = new address[](1); - a[0] = msg.sender; - return a; - } - - function get10PowerDecimals(uint8 decimals) public pure returns (uint256) { - uint256 a = 10; - uint256 res = a ** decimals; - return res; - } - - function getarray(address[] memory c, address e) public pure { - assert(c[0] == e); - } - - function callmyself() external view { - address[] memory b = this.foo(); - Utils.getarray(b, address(this)); - } - - function add(int8 c, int8 d) public pure returns (int8) { - return c + d; - } -} diff --git a/resources/regressions/multiple-contracts-3.json/mutants/3/MultipleContracts/C.sol b/resources/regressions/multiple-contracts-3.json/mutants/3/MultipleContracts/C.sol deleted file mode 100644 index b85149e..0000000 --- a/resources/regressions/multiple-contracts-3.json/mutants/3/MultipleContracts/C.sol +++ /dev/null @@ -1,41 +0,0 @@ -// SPDX-License-Identifier: GPL-3.0-only - -pragma solidity ^0.8.13; - -library Utils { - function getarray(address[] memory c, address e) internal pure { - assert(c[0] == e); - } - - function add(int8 a, int8 b) public pure returns (int8) { - /// BinaryOpMutation(`+` |==> `*`) of: `return a + b;` - return a*b; - } -} - -contract C { - function foo() external view returns (address[] memory) { - address[] memory a = new address[](1); - a[0] = msg.sender; - return a; - } - - function get10PowerDecimals(uint8 decimals) public pure returns (uint256) { - uint256 a = 10; - uint256 res = a ** decimals; - return res; - } - - function getarray(address[] memory c, address e) public pure { - assert(c[0] == e); - } - - function callmyself() external view { - address[] memory b = this.foo(); - Utils.getarray(b, address(this)); - } - - function add(int8 c, int8 d) public pure returns (int8) { - return c + d; - } -} diff --git a/resources/regressions/multiple-contracts-3.json/mutants/4/MultipleContracts/C.sol b/resources/regressions/multiple-contracts-3.json/mutants/4/MultipleContracts/C.sol deleted file mode 100644 index a5819d3..0000000 --- a/resources/regressions/multiple-contracts-3.json/mutants/4/MultipleContracts/C.sol +++ /dev/null @@ -1,41 +0,0 @@ -// SPDX-License-Identifier: GPL-3.0-only - -pragma solidity ^0.8.13; - -library Utils { - function getarray(address[] memory c, address e) internal pure { - assert(c[0] == e); - } - - function add(int8 a, int8 b) public pure returns (int8) { - /// BinaryOpMutation(`+` |==> `/`) of: `return a + b;` - return a/b; - } -} - -contract C { - function foo() external view returns (address[] memory) { - address[] memory a = new address[](1); - a[0] = msg.sender; - return a; - } - - function get10PowerDecimals(uint8 decimals) public pure returns (uint256) { - uint256 a = 10; - uint256 res = a ** decimals; - return res; - } - - function getarray(address[] memory c, address e) public pure { - assert(c[0] == e); - } - - function callmyself() external view { - address[] memory b = this.foo(); - Utils.getarray(b, address(this)); - } - - function add(int8 c, int8 d) public pure returns (int8) { - return c + d; - } -} diff --git a/resources/regressions/multiple-contracts-3.json/mutants/5/MultipleContracts/C.sol b/resources/regressions/multiple-contracts-3.json/mutants/5/MultipleContracts/C.sol deleted file mode 100644 index 530045e..0000000 --- a/resources/regressions/multiple-contracts-3.json/mutants/5/MultipleContracts/C.sol +++ /dev/null @@ -1,41 +0,0 @@ -// SPDX-License-Identifier: GPL-3.0-only - -pragma solidity ^0.8.13; - -library Utils { - function getarray(address[] memory c, address e) internal pure { - assert(c[0] == e); - } - - function add(int8 a, int8 b) public pure returns (int8) { - /// BinaryOpMutation(`+` |==> `%`) of: `return a + b;` - return a%b; - } -} - -contract C { - function foo() external view returns (address[] memory) { - address[] memory a = new address[](1); - a[0] = msg.sender; - return a; - } - - function get10PowerDecimals(uint8 decimals) public pure returns (uint256) { - uint256 a = 10; - uint256 res = a ** decimals; - return res; - } - - function getarray(address[] memory c, address e) public pure { - assert(c[0] == e); - } - - function callmyself() external view { - address[] memory b = this.foo(); - Utils.getarray(b, address(this)); - } - - function add(int8 c, int8 d) public pure returns (int8) { - return c + d; - } -} diff --git a/resources/regressions/multiple-contracts-3.json/mutants/7/MultipleContracts/C.sol b/resources/regressions/multiple-contracts-3.json/mutants/7/MultipleContracts/C.sol deleted file mode 100644 index 59da228..0000000 --- a/resources/regressions/multiple-contracts-3.json/mutants/7/MultipleContracts/C.sol +++ /dev/null @@ -1,41 +0,0 @@ -// SPDX-License-Identifier: GPL-3.0-only - -pragma solidity ^0.8.13; - -library Utils { - function getarray(address[] memory c, address e) internal pure { - assert(c[0] == e); - } - - function add(int8 a, int8 b) public pure returns (int8) { - return a + b; - } -} - -contract C { - function foo() external view returns (address[] memory) { - address[] memory a = new address[](1); - a[0] = msg.sender; - return a; - } - - function get10PowerDecimals(uint8 decimals) public pure returns (uint256) { - uint256 a = 10; - /// BinaryOpMutation(`**` |==> `+`) of: `uint256 res = a ** decimals;` - uint256 res = a+decimals; - return res; - } - - function getarray(address[] memory c, address e) public pure { - assert(c[0] == e); - } - - function callmyself() external view { - address[] memory b = this.foo(); - Utils.getarray(b, address(this)); - } - - function add(int8 c, int8 d) public pure returns (int8) { - return c + d; - } -} diff --git a/resources/regressions/multiple-contracts-3.json/mutants/8/MultipleContracts/C.sol b/resources/regressions/multiple-contracts-3.json/mutants/8/MultipleContracts/C.sol deleted file mode 100644 index 911e098..0000000 --- a/resources/regressions/multiple-contracts-3.json/mutants/8/MultipleContracts/C.sol +++ /dev/null @@ -1,41 +0,0 @@ -// SPDX-License-Identifier: GPL-3.0-only - -pragma solidity ^0.8.13; - -library Utils { - function getarray(address[] memory c, address e) internal pure { - assert(c[0] == e); - } - - function add(int8 a, int8 b) public pure returns (int8) { - return a + b; - } -} - -contract C { - function foo() external view returns (address[] memory) { - address[] memory a = new address[](1); - a[0] = msg.sender; - return a; - } - - function get10PowerDecimals(uint8 decimals) public pure returns (uint256) { - uint256 a = 10; - /// BinaryOpMutation(`**` |==> `-`) of: `uint256 res = a ** decimals;` - uint256 res = a-decimals; - return res; - } - - function getarray(address[] memory c, address e) public pure { - assert(c[0] == e); - } - - function callmyself() external view { - address[] memory b = this.foo(); - Utils.getarray(b, address(this)); - } - - function add(int8 c, int8 d) public pure returns (int8) { - return c + d; - } -} diff --git a/resources/regressions/multiple-contracts-3.json/mutants/9/MultipleContracts/C.sol b/resources/regressions/multiple-contracts-3.json/mutants/9/MultipleContracts/C.sol deleted file mode 100644 index 53ca08b..0000000 --- a/resources/regressions/multiple-contracts-3.json/mutants/9/MultipleContracts/C.sol +++ /dev/null @@ -1,41 +0,0 @@ -// SPDX-License-Identifier: GPL-3.0-only - -pragma solidity ^0.8.13; - -library Utils { - function getarray(address[] memory c, address e) internal pure { - assert(c[0] == e); - } - - function add(int8 a, int8 b) public pure returns (int8) { - return a + b; - } -} - -contract C { - function foo() external view returns (address[] memory) { - address[] memory a = new address[](1); - a[0] = msg.sender; - return a; - } - - function get10PowerDecimals(uint8 decimals) public pure returns (uint256) { - uint256 a = 10; - /// BinaryOpMutation(`**` |==> `*`) of: `uint256 res = a ** decimals;` - uint256 res = a*decimals; - return res; - } - - function getarray(address[] memory c, address e) public pure { - assert(c[0] == e); - } - - function callmyself() external view { - address[] memory b = this.foo(); - Utils.getarray(b, address(this)); - } - - function add(int8 c, int8 d) public pure returns (int8) { - return c + d; - } -} diff --git a/resources/regressions/multiple-contracts-4.json/gambit_results.json b/resources/regressions/multiple-contracts-4.json/gambit_results.json deleted file mode 100644 index ef080dd..0000000 --- a/resources/regressions/multiple-contracts-4.json/gambit_results.json +++ /dev/null @@ -1,58 +0,0 @@ -[ - { - "description": "BinaryOpMutation", - "diff": "--- original\n+++ mutant\n@@ -8,7 +8,8 @@\n }\n \n function add(int8 a, int8 b) public pure returns (int8) {\n- return a + b;\n+ /// BinaryOpMutation(`+` |==> `-`) of: `return a + b;`\n+ return a-b;\n }\n }\n \n", - "id": "1", - "name": "mutants/1/MultipleContracts/C.sol", - "original": "MultipleContracts/C.sol", - }, - { - "description": "BinaryOpMutation", - "diff": "--- original\n+++ mutant\n@@ -8,7 +8,8 @@\n }\n \n function add(int8 a, int8 b) public pure returns (int8) {\n- return a + b;\n+ /// BinaryOpMutation(`+` |==> `*`) of: `return a + b;`\n+ return a*b;\n }\n }\n \n", - "id": "2", - "name": "mutants/2/MultipleContracts/C.sol", - "original": "MultipleContracts/C.sol", - }, - { - "description": "BinaryOpMutation", - "diff": "--- original\n+++ mutant\n@@ -8,7 +8,8 @@\n }\n \n function add(int8 a, int8 b) public pure returns (int8) {\n- return a + b;\n+ /// BinaryOpMutation(`+` |==> `/`) of: `return a + b;`\n+ return a/b;\n }\n }\n \n", - "id": "3", - "name": "mutants/3/MultipleContracts/C.sol", - "original": "MultipleContracts/C.sol", - }, - { - "description": "BinaryOpMutation", - "diff": "--- original\n+++ mutant\n@@ -8,7 +8,8 @@\n }\n \n function add(int8 a, int8 b) public pure returns (int8) {\n- return a + b;\n+ /// BinaryOpMutation(`+` |==> `%`) of: `return a + b;`\n+ return a%b;\n }\n }\n \n", - "id": "4", - "name": "mutants/4/MultipleContracts/C.sol", - "original": "MultipleContracts/C.sol", - }, - { - "description": "BinaryOpMutation", - "diff": "--- original\n+++ mutant\n@@ -35,6 +35,7 @@\n }\n \n function add(int8 c, int8 d) public pure returns (int8) {\n- return c + d;\n+ /// BinaryOpMutation(`+` |==> `-`) of: `return c + d;`\n+ return c-d;\n }\n }\n", - "id": "5", - "name": "mutants/5/MultipleContracts/C.sol", - "original": "MultipleContracts/C.sol", - }, - { - "description": "BinaryOpMutation", - "diff": "--- original\n+++ mutant\n@@ -35,6 +35,7 @@\n }\n \n function add(int8 c, int8 d) public pure returns (int8) {\n- return c + d;\n+ /// BinaryOpMutation(`+` |==> `*`) of: `return c + d;`\n+ return c*d;\n }\n }\n", - "id": "6", - "name": "mutants/6/MultipleContracts/C.sol", - "original": "MultipleContracts/C.sol", - }, - { - "description": "BinaryOpMutation", - "diff": "--- original\n+++ mutant\n@@ -35,6 +35,7 @@\n }\n \n function add(int8 c, int8 d) public pure returns (int8) {\n- return c + d;\n+ /// BinaryOpMutation(`+` |==> `/`) of: `return c + d;`\n+ return c/d;\n }\n }\n", - "id": "7", - "name": "mutants/7/MultipleContracts/C.sol", - "original": "MultipleContracts/C.sol", - }, - { - "description": "BinaryOpMutation", - "diff": "--- original\n+++ mutant\n@@ -35,6 +35,7 @@\n }\n \n function add(int8 c, int8 d) public pure returns (int8) {\n- return c + d;\n+ /// BinaryOpMutation(`+` |==> `%`) of: `return c + d;`\n+ return c%d;\n }\n }\n", - "id": "8", - "name": "mutants/8/MultipleContracts/C.sol", - "original": "MultipleContracts/C.sol", - } -] \ No newline at end of file diff --git a/resources/regressions/multiple-contracts-4.json/input_json/C.sol_json.ast b/resources/regressions/multiple-contracts-4.json/input_json/C.sol_json.ast deleted file mode 100644 index a3306b6..0000000 --- a/resources/regressions/multiple-contracts-4.json/input_json/C.sol_json.ast +++ /dev/null @@ -1,1828 +0,0 @@ -{ - "absolutePath": "benchmarks/MultipleContracts/C.sol", - "exportedSymbols": - { - "C": - [ - 135 - ], - "Utils": - [ - 33 - ] - }, - "id": 136, - "license": "GPL-3.0-only", - "nodeType": "SourceUnit", - "nodes": - [ - { - "id": 1, - "literals": - [ - "solidity", - "^", - "0.8", - ".13" - ], - "nodeType": "PragmaDirective", - "src": "42:24:0" - }, - { - "abstract": false, - "baseContracts": [], - "canonicalName": "Utils", - "contractDependencies": [], - "contractKind": "library", - "fullyImplemented": true, - "id": 33, - "linearizedBaseContracts": - [ - 33 - ], - "name": "Utils", - "nameLocation": "76:5:0", - "nodeType": "ContractDefinition", - "nodes": - [ - { - "body": - { - "id": 17, - "nodeType": "Block", - "src": "151:34:0", - "statements": - [ - { - "expression": - { - "arguments": - [ - { - "commonType": - { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "id": 14, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": - { - "baseExpression": - { - "id": 10, - "name": "c", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4, - "src": "168:1:0", - "typeDescriptions": - { - "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", - "typeString": "address[] memory" - } - }, - "id": 12, - "indexExpression": - { - "hexValue": "30", - "id": 11, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "170:1:0", - "typeDescriptions": - { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - }, - "value": "0" - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "168:4:0", - "typeDescriptions": - { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "nodeType": "BinaryOperation", - "operator": "==", - "rightExpression": - { - "id": 13, - "name": "e", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 6, - "src": "176:1:0", - "typeDescriptions": - { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "src": "168:9:0", - "typeDescriptions": - { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - } - ], - "expression": - { - "argumentTypes": - [ - { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - ], - "id": 9, - "name": "assert", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": -3, - "src": "161:6:0", - "typeDescriptions": - { - "typeIdentifier": "t_function_assert_pure$_t_bool_$returns$__$", - "typeString": "function (bool) pure" - } - }, - "id": 15, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "161:17:0", - "tryCall": false, - "typeDescriptions": - { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 16, - "nodeType": "ExpressionStatement", - "src": "161:17:0" - } - ] - }, - "id": 18, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "getarray", - "nameLocation": "97:8:0", - "nodeType": "FunctionDefinition", - "parameters": - { - "id": 7, - "nodeType": "ParameterList", - "parameters": - [ - { - "constant": false, - "id": 4, - "mutability": "mutable", - "name": "c", - "nameLocation": "123:1:0", - "nodeType": "VariableDeclaration", - "scope": 18, - "src": "106:18:0", - "stateVariable": false, - "storageLocation": "memory", - "typeDescriptions": - { - "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", - "typeString": "address[]" - }, - "typeName": - { - "baseType": - { - "id": 2, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "106:7:0", - "stateMutability": "nonpayable", - "typeDescriptions": - { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "id": 3, - "nodeType": "ArrayTypeName", - "src": "106:9:0", - "typeDescriptions": - { - "typeIdentifier": "t_array$_t_address_$dyn_storage_ptr", - "typeString": "address[]" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 6, - "mutability": "mutable", - "name": "e", - "nameLocation": "134:1:0", - "nodeType": "VariableDeclaration", - "scope": 18, - "src": "126:9:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": - { - "id": 5, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "126:7:0", - "stateMutability": "nonpayable", - "typeDescriptions": - { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "visibility": "internal" - } - ], - "src": "105:31:0" - }, - "returnParameters": - { - "id": 8, - "nodeType": "ParameterList", - "parameters": [], - "src": "151:0:0" - }, - "scope": 33, - "src": "88:97:0", - "stateMutability": "pure", - "virtual": false, - "visibility": "internal" - }, - { - "body": - { - "id": 31, - "nodeType": "Block", - "src": "247:29:0", - "statements": - [ - { - "expression": - { - "commonType": - { - "typeIdentifier": "t_int8", - "typeString": "int8" - }, - "id": 29, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": - { - "id": 27, - "name": "a", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 20, - "src": "264:1:0", - "typeDescriptions": - { - "typeIdentifier": "t_int8", - "typeString": "int8" - } - }, - "nodeType": "BinaryOperation", - "operator": "+", - "rightExpression": - { - "id": 28, - "name": "b", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 22, - "src": "268:1:0", - "typeDescriptions": - { - "typeIdentifier": "t_int8", - "typeString": "int8" - } - }, - "src": "264:5:0", - "typeDescriptions": - { - "typeIdentifier": "t_int8", - "typeString": "int8" - } - }, - "functionReturnParameters": 26, - "id": 30, - "nodeType": "Return", - "src": "257:12:0" - } - ] - }, - "functionSelector": "e2666777", - "id": 32, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "add", - "nameLocation": "200:3:0", - "nodeType": "FunctionDefinition", - "parameters": - { - "id": 23, - "nodeType": "ParameterList", - "parameters": - [ - { - "constant": false, - "id": 20, - "mutability": "mutable", - "name": "a", - "nameLocation": "209:1:0", - "nodeType": "VariableDeclaration", - "scope": 32, - "src": "204:6:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_int8", - "typeString": "int8" - }, - "typeName": - { - "id": 19, - "name": "int8", - "nodeType": "ElementaryTypeName", - "src": "204:4:0", - "typeDescriptions": - { - "typeIdentifier": "t_int8", - "typeString": "int8" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 22, - "mutability": "mutable", - "name": "b", - "nameLocation": "217:1:0", - "nodeType": "VariableDeclaration", - "scope": 32, - "src": "212:6:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_int8", - "typeString": "int8" - }, - "typeName": - { - "id": 21, - "name": "int8", - "nodeType": "ElementaryTypeName", - "src": "212:4:0", - "typeDescriptions": - { - "typeIdentifier": "t_int8", - "typeString": "int8" - } - }, - "visibility": "internal" - } - ], - "src": "203:16:0" - }, - "returnParameters": - { - "id": 26, - "nodeType": "ParameterList", - "parameters": - [ - { - "constant": false, - "id": 25, - "mutability": "mutable", - "name": "", - "nameLocation": "-1:-1:-1", - "nodeType": "VariableDeclaration", - "scope": 32, - "src": "241:4:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_int8", - "typeString": "int8" - }, - "typeName": - { - "id": 24, - "name": "int8", - "nodeType": "ElementaryTypeName", - "src": "241:4:0", - "typeDescriptions": - { - "typeIdentifier": "t_int8", - "typeString": "int8" - } - }, - "visibility": "internal" - } - ], - "src": "240:6:0" - }, - "scope": 33, - "src": "191:85:0", - "stateMutability": "pure", - "virtual": false, - "visibility": "public" - } - ], - "scope": 136, - "src": "68:210:0", - "usedErrors": [] - }, - { - "abstract": false, - "baseContracts": [], - "canonicalName": "C", - "contractDependencies": [], - "contractKind": "contract", - "fullyImplemented": true, - "id": 135, - "linearizedBaseContracts": - [ - 135 - ], - "name": "C", - "nameLocation": "289:1:0", - "nodeType": "ContractDefinition", - "nodes": - [ - { - "body": - { - "id": 59, - "nodeType": "Block", - "src": "353:99:0", - "statements": - [ - { - "assignments": - [ - 43 - ], - "declarations": - [ - { - "constant": false, - "id": 43, - "mutability": "mutable", - "name": "a", - "nameLocation": "380:1:0", - "nodeType": "VariableDeclaration", - "scope": 59, - "src": "363:18:0", - "stateVariable": false, - "storageLocation": "memory", - "typeDescriptions": - { - "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", - "typeString": "address[]" - }, - "typeName": - { - "baseType": - { - "id": 41, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "363:7:0", - "typeDescriptions": - { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "id": 42, - "nodeType": "ArrayTypeName", - "src": "363:9:0", - "typeDescriptions": - { - "typeIdentifier": "t_array$_t_address_$dyn_storage_ptr", - "typeString": "address[]" - } - }, - "visibility": "internal" - } - ], - "id": 49, - "initialValue": - { - "arguments": - [ - { - "hexValue": "31", - "id": 47, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "398:1:0", - "typeDescriptions": - { - "typeIdentifier": "t_rational_1_by_1", - "typeString": "int_const 1" - }, - "value": "1" - } - ], - "expression": - { - "argumentTypes": - [ - { - "typeIdentifier": "t_rational_1_by_1", - "typeString": "int_const 1" - } - ], - "id": 46, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "nodeType": "NewExpression", - "src": "384:13:0", - "typeDescriptions": - { - "typeIdentifier": "t_function_objectcreation_pure$_t_uint256_$returns$_t_array$_t_address_$dyn_memory_ptr_$", - "typeString": "function (uint256) pure returns (address[] memory)" - }, - "typeName": - { - "baseType": - { - "id": 44, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "388:7:0", - "stateMutability": "nonpayable", - "typeDescriptions": - { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "id": 45, - "nodeType": "ArrayTypeName", - "src": "388:9:0", - "typeDescriptions": - { - "typeIdentifier": "t_array$_t_address_$dyn_storage_ptr", - "typeString": "address[]" - } - } - }, - "id": 48, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "384:16:0", - "tryCall": false, - "typeDescriptions": - { - "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", - "typeString": "address[] memory" - } - }, - "nodeType": "VariableDeclarationStatement", - "src": "363:37:0" - }, - { - "expression": - { - "id": 55, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": - { - "baseExpression": - { - "id": 50, - "name": "a", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 43, - "src": "410:1:0", - "typeDescriptions": - { - "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", - "typeString": "address[] memory" - } - }, - "id": 52, - "indexExpression": - { - "hexValue": "30", - "id": 51, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "412:1:0", - "typeDescriptions": - { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - }, - "value": "0" - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": true, - "nodeType": "IndexAccess", - "src": "410:4:0", - "typeDescriptions": - { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": - { - "expression": - { - "id": 53, - "name": "msg", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": -15, - "src": "417:3:0", - "typeDescriptions": - { - "typeIdentifier": "t_magic_message", - "typeString": "msg" - } - }, - "id": 54, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "sender", - "nodeType": "MemberAccess", - "src": "417:10:0", - "typeDescriptions": - { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "src": "410:17:0", - "typeDescriptions": - { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "id": 56, - "nodeType": "ExpressionStatement", - "src": "410:17:0" - }, - { - "expression": - { - "id": 57, - "name": "a", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 43, - "src": "444:1:0", - "typeDescriptions": - { - "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", - "typeString": "address[] memory" - } - }, - "functionReturnParameters": 38, - "id": 58, - "nodeType": "Return", - "src": "437:8:0" - } - ] - }, - "functionSelector": "c2985578", - "id": 60, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "foo", - "nameLocation": "306:3:0", - "nodeType": "FunctionDefinition", - "parameters": - { - "id": 34, - "nodeType": "ParameterList", - "parameters": [], - "src": "309:2:0" - }, - "returnParameters": - { - "id": 38, - "nodeType": "ParameterList", - "parameters": - [ - { - "constant": false, - "id": 37, - "mutability": "mutable", - "name": "", - "nameLocation": "-1:-1:-1", - "nodeType": "VariableDeclaration", - "scope": 60, - "src": "335:16:0", - "stateVariable": false, - "storageLocation": "memory", - "typeDescriptions": - { - "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", - "typeString": "address[]" - }, - "typeName": - { - "baseType": - { - "id": 35, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "335:7:0", - "stateMutability": "nonpayable", - "typeDescriptions": - { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "id": 36, - "nodeType": "ArrayTypeName", - "src": "335:9:0", - "typeDescriptions": - { - "typeIdentifier": "t_array$_t_address_$dyn_storage_ptr", - "typeString": "address[]" - } - }, - "visibility": "internal" - } - ], - "src": "334:18:0" - }, - "scope": 135, - "src": "297:155:0", - "stateMutability": "view", - "virtual": false, - "visibility": "external" - }, - { - "body": - { - "id": 79, - "nodeType": "Block", - "src": "532:88:0", - "statements": - [ - { - "assignments": - [ - 68 - ], - "declarations": - [ - { - "constant": false, - "id": 68, - "mutability": "mutable", - "name": "a", - "nameLocation": "550:1:0", - "nodeType": "VariableDeclaration", - "scope": 79, - "src": "542:9:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": - { - "id": 67, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "542:7:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - } - ], - "id": 70, - "initialValue": - { - "hexValue": "3130", - "id": 69, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "554:2:0", - "typeDescriptions": - { - "typeIdentifier": "t_rational_10_by_1", - "typeString": "int_const 10" - }, - "value": "10" - }, - "nodeType": "VariableDeclarationStatement", - "src": "542:14:0" - }, - { - "assignments": - [ - 72 - ], - "declarations": - [ - { - "constant": false, - "id": 72, - "mutability": "mutable", - "name": "res", - "nameLocation": "574:3:0", - "nodeType": "VariableDeclaration", - "scope": 79, - "src": "566:11:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": - { - "id": 71, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "566:7:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - } - ], - "id": 76, - "initialValue": - { - "commonType": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 75, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": - { - "id": 73, - "name": "a", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 68, - "src": "580:1:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "**", - "rightExpression": - { - "id": 74, - "name": "decimals", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 62, - "src": "585:8:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - } - }, - "src": "580:13:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "VariableDeclarationStatement", - "src": "566:27:0" - }, - { - "expression": - { - "id": 77, - "name": "res", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 72, - "src": "610:3:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "functionReturnParameters": 66, - "id": 78, - "nodeType": "Return", - "src": "603:10:0" - } - ] - }, - "functionSelector": "eb79f1be", - "id": 80, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "get10PowerDecimals", - "nameLocation": "467:18:0", - "nodeType": "FunctionDefinition", - "parameters": - { - "id": 63, - "nodeType": "ParameterList", - "parameters": - [ - { - "constant": false, - "id": 62, - "mutability": "mutable", - "name": "decimals", - "nameLocation": "492:8:0", - "nodeType": "VariableDeclaration", - "scope": 80, - "src": "486:14:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - }, - "typeName": - { - "id": 61, - "name": "uint8", - "nodeType": "ElementaryTypeName", - "src": "486:5:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - } - }, - "visibility": "internal" - } - ], - "src": "485:16:0" - }, - "returnParameters": - { - "id": 66, - "nodeType": "ParameterList", - "parameters": - [ - { - "constant": false, - "id": 65, - "mutability": "mutable", - "name": "", - "nameLocation": "-1:-1:-1", - "nodeType": "VariableDeclaration", - "scope": 80, - "src": "523:7:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": - { - "id": 64, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "523:7:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - } - ], - "src": "522:9:0" - }, - "scope": 135, - "src": "458:162:0", - "stateMutability": "pure", - "virtual": false, - "visibility": "public" - }, - { - "body": - { - "id": 96, - "nodeType": "Block", - "src": "687:34:0", - "statements": - [ - { - "expression": - { - "arguments": - [ - { - "commonType": - { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "id": 93, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": - { - "baseExpression": - { - "id": 89, - "name": "c", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 83, - "src": "704:1:0", - "typeDescriptions": - { - "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", - "typeString": "address[] memory" - } - }, - "id": 91, - "indexExpression": - { - "hexValue": "30", - "id": 90, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "706:1:0", - "typeDescriptions": - { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - }, - "value": "0" - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "704:4:0", - "typeDescriptions": - { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "nodeType": "BinaryOperation", - "operator": "==", - "rightExpression": - { - "id": 92, - "name": "e", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 85, - "src": "712:1:0", - "typeDescriptions": - { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "src": "704:9:0", - "typeDescriptions": - { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - } - ], - "expression": - { - "argumentTypes": - [ - { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - ], - "id": 88, - "name": "assert", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": -3, - "src": "697:6:0", - "typeDescriptions": - { - "typeIdentifier": "t_function_assert_pure$_t_bool_$returns$__$", - "typeString": "function (bool) pure" - } - }, - "id": 94, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "697:17:0", - "tryCall": false, - "typeDescriptions": - { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 95, - "nodeType": "ExpressionStatement", - "src": "697:17:0" - } - ] - }, - "functionSelector": "e5b2857b", - "id": 97, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "getarray", - "nameLocation": "635:8:0", - "nodeType": "FunctionDefinition", - "parameters": - { - "id": 86, - "nodeType": "ParameterList", - "parameters": - [ - { - "constant": false, - "id": 83, - "mutability": "mutable", - "name": "c", - "nameLocation": "661:1:0", - "nodeType": "VariableDeclaration", - "scope": 97, - "src": "644:18:0", - "stateVariable": false, - "storageLocation": "memory", - "typeDescriptions": - { - "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", - "typeString": "address[]" - }, - "typeName": - { - "baseType": - { - "id": 81, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "644:7:0", - "stateMutability": "nonpayable", - "typeDescriptions": - { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "id": 82, - "nodeType": "ArrayTypeName", - "src": "644:9:0", - "typeDescriptions": - { - "typeIdentifier": "t_array$_t_address_$dyn_storage_ptr", - "typeString": "address[]" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 85, - "mutability": "mutable", - "name": "e", - "nameLocation": "672:1:0", - "nodeType": "VariableDeclaration", - "scope": 97, - "src": "664:9:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": - { - "id": 84, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "664:7:0", - "stateMutability": "nonpayable", - "typeDescriptions": - { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "visibility": "internal" - } - ], - "src": "643:31:0" - }, - "returnParameters": - { - "id": 87, - "nodeType": "ParameterList", - "parameters": [], - "src": "687:0:0" - }, - "scope": 135, - "src": "626:95:0", - "stateMutability": "pure", - "virtual": false, - "visibility": "public" - }, - { - "body": - { - "id": 119, - "nodeType": "Block", - "src": "763:90:0", - "statements": - [ - { - "assignments": - [ - 104 - ], - "declarations": - [ - { - "constant": false, - "id": 104, - "mutability": "mutable", - "name": "b", - "nameLocation": "790:1:0", - "nodeType": "VariableDeclaration", - "scope": 119, - "src": "773:18:0", - "stateVariable": false, - "storageLocation": "memory", - "typeDescriptions": - { - "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", - "typeString": "address[]" - }, - "typeName": - { - "baseType": - { - "id": 102, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "773:7:0", - "typeDescriptions": - { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "id": 103, - "nodeType": "ArrayTypeName", - "src": "773:9:0", - "typeDescriptions": - { - "typeIdentifier": "t_array$_t_address_$dyn_storage_ptr", - "typeString": "address[]" - } - }, - "visibility": "internal" - } - ], - "id": 108, - "initialValue": - { - "arguments": [], - "expression": - { - "argumentTypes": [], - "expression": - { - "id": 105, - "name": "this", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": -28, - "src": "794:4:0", - "typeDescriptions": - { - "typeIdentifier": "t_contract$_C_$135", - "typeString": "contract C" - } - }, - "id": 106, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "foo", - "nodeType": "MemberAccess", - "referencedDeclaration": 60, - "src": "794:8:0", - "typeDescriptions": - { - "typeIdentifier": "t_function_external_view$__$returns$_t_array$_t_address_$dyn_memory_ptr_$", - "typeString": "function () view external returns (address[] memory)" - } - }, - "id": 107, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "794:10:0", - "tryCall": false, - "typeDescriptions": - { - "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", - "typeString": "address[] memory" - } - }, - "nodeType": "VariableDeclarationStatement", - "src": "773:31:0" - }, - { - "expression": - { - "arguments": - [ - { - "id": 112, - "name": "b", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 104, - "src": "829:1:0", - "typeDescriptions": - { - "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", - "typeString": "address[] memory" - } - }, - { - "arguments": - [ - { - "id": 115, - "name": "this", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": -28, - "src": "840:4:0", - "typeDescriptions": - { - "typeIdentifier": "t_contract$_C_$135", - "typeString": "contract C" - } - } - ], - "expression": - { - "argumentTypes": - [ - { - "typeIdentifier": "t_contract$_C_$135", - "typeString": "contract C" - } - ], - "id": 114, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "nodeType": "ElementaryTypeNameExpression", - "src": "832:7:0", - "typeDescriptions": - { - "typeIdentifier": "t_type$_t_address_$", - "typeString": "type(address)" - }, - "typeName": - { - "id": 113, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "832:7:0", - "typeDescriptions": {} - } - }, - "id": 116, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "typeConversion", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "832:13:0", - "tryCall": false, - "typeDescriptions": - { - "typeIdentifier": "t_address", - "typeString": "address" - } - } - ], - "expression": - { - "argumentTypes": - [ - { - "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", - "typeString": "address[] memory" - }, - { - "typeIdentifier": "t_address", - "typeString": "address" - } - ], - "expression": - { - "id": 109, - "name": "Utils", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 33, - "src": "814:5:0", - "typeDescriptions": - { - "typeIdentifier": "t_type$_t_contract$_Utils_$33_$", - "typeString": "type(library Utils)" - } - }, - "id": 111, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "getarray", - "nodeType": "MemberAccess", - "referencedDeclaration": 18, - "src": "814:14:0", - "typeDescriptions": - { - "typeIdentifier": "t_function_internal_pure$_t_array$_t_address_$dyn_memory_ptr_$_t_address_$returns$__$", - "typeString": "function (address[] memory,address) pure" - } - }, - "id": 117, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "814:32:0", - "tryCall": false, - "typeDescriptions": - { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 118, - "nodeType": "ExpressionStatement", - "src": "814:32:0" - } - ] - }, - "functionSelector": "d3ab473b", - "id": 120, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "callmyself", - "nameLocation": "736:10:0", - "nodeType": "FunctionDefinition", - "parameters": - { - "id": 98, - "nodeType": "ParameterList", - "parameters": [], - "src": "746:2:0" - }, - "returnParameters": - { - "id": 99, - "nodeType": "ParameterList", - "parameters": [], - "src": "763:0:0" - }, - "scope": 135, - "src": "727:126:0", - "stateMutability": "view", - "virtual": false, - "visibility": "external" - }, - { - "body": - { - "id": 133, - "nodeType": "Block", - "src": "915:29:0", - "statements": - [ - { - "expression": - { - "commonType": - { - "typeIdentifier": "t_int8", - "typeString": "int8" - }, - "id": 131, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": - { - "id": 129, - "name": "c", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 122, - "src": "932:1:0", - "typeDescriptions": - { - "typeIdentifier": "t_int8", - "typeString": "int8" - } - }, - "nodeType": "BinaryOperation", - "operator": "+", - "rightExpression": - { - "id": 130, - "name": "d", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 124, - "src": "936:1:0", - "typeDescriptions": - { - "typeIdentifier": "t_int8", - "typeString": "int8" - } - }, - "src": "932:5:0", - "typeDescriptions": - { - "typeIdentifier": "t_int8", - "typeString": "int8" - } - }, - "functionReturnParameters": 128, - "id": 132, - "nodeType": "Return", - "src": "925:12:0" - } - ] - }, - "functionSelector": "e2666777", - "id": 134, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "add", - "nameLocation": "868:3:0", - "nodeType": "FunctionDefinition", - "parameters": - { - "id": 125, - "nodeType": "ParameterList", - "parameters": - [ - { - "constant": false, - "id": 122, - "mutability": "mutable", - "name": "c", - "nameLocation": "877:1:0", - "nodeType": "VariableDeclaration", - "scope": 134, - "src": "872:6:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_int8", - "typeString": "int8" - }, - "typeName": - { - "id": 121, - "name": "int8", - "nodeType": "ElementaryTypeName", - "src": "872:4:0", - "typeDescriptions": - { - "typeIdentifier": "t_int8", - "typeString": "int8" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 124, - "mutability": "mutable", - "name": "d", - "nameLocation": "885:1:0", - "nodeType": "VariableDeclaration", - "scope": 134, - "src": "880:6:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_int8", - "typeString": "int8" - }, - "typeName": - { - "id": 123, - "name": "int8", - "nodeType": "ElementaryTypeName", - "src": "880:4:0", - "typeDescriptions": - { - "typeIdentifier": "t_int8", - "typeString": "int8" - } - }, - "visibility": "internal" - } - ], - "src": "871:16:0" - }, - "returnParameters": - { - "id": 128, - "nodeType": "ParameterList", - "parameters": - [ - { - "constant": false, - "id": 127, - "mutability": "mutable", - "name": "", - "nameLocation": "-1:-1:-1", - "nodeType": "VariableDeclaration", - "scope": 134, - "src": "909:4:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_int8", - "typeString": "int8" - }, - "typeName": - { - "id": 126, - "name": "int8", - "nodeType": "ElementaryTypeName", - "src": "909:4:0", - "typeDescriptions": - { - "typeIdentifier": "t_int8", - "typeString": "int8" - } - }, - "visibility": "internal" - } - ], - "src": "908:6:0" - }, - "scope": 135, - "src": "859:85:0", - "stateMutability": "pure", - "virtual": false, - "visibility": "public" - } - ], - "scope": 136, - "src": "280:666:0", - "usedErrors": [] - } - ], - "src": "42:905:0" -} \ No newline at end of file diff --git a/resources/regressions/multiple-contracts-4.json/input_json/C.sol_json.ast.json b/resources/regressions/multiple-contracts-4.json/input_json/C.sol_json.ast.json deleted file mode 100644 index a3306b6..0000000 --- a/resources/regressions/multiple-contracts-4.json/input_json/C.sol_json.ast.json +++ /dev/null @@ -1,1828 +0,0 @@ -{ - "absolutePath": "benchmarks/MultipleContracts/C.sol", - "exportedSymbols": - { - "C": - [ - 135 - ], - "Utils": - [ - 33 - ] - }, - "id": 136, - "license": "GPL-3.0-only", - "nodeType": "SourceUnit", - "nodes": - [ - { - "id": 1, - "literals": - [ - "solidity", - "^", - "0.8", - ".13" - ], - "nodeType": "PragmaDirective", - "src": "42:24:0" - }, - { - "abstract": false, - "baseContracts": [], - "canonicalName": "Utils", - "contractDependencies": [], - "contractKind": "library", - "fullyImplemented": true, - "id": 33, - "linearizedBaseContracts": - [ - 33 - ], - "name": "Utils", - "nameLocation": "76:5:0", - "nodeType": "ContractDefinition", - "nodes": - [ - { - "body": - { - "id": 17, - "nodeType": "Block", - "src": "151:34:0", - "statements": - [ - { - "expression": - { - "arguments": - [ - { - "commonType": - { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "id": 14, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": - { - "baseExpression": - { - "id": 10, - "name": "c", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4, - "src": "168:1:0", - "typeDescriptions": - { - "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", - "typeString": "address[] memory" - } - }, - "id": 12, - "indexExpression": - { - "hexValue": "30", - "id": 11, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "170:1:0", - "typeDescriptions": - { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - }, - "value": "0" - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "168:4:0", - "typeDescriptions": - { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "nodeType": "BinaryOperation", - "operator": "==", - "rightExpression": - { - "id": 13, - "name": "e", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 6, - "src": "176:1:0", - "typeDescriptions": - { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "src": "168:9:0", - "typeDescriptions": - { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - } - ], - "expression": - { - "argumentTypes": - [ - { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - ], - "id": 9, - "name": "assert", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": -3, - "src": "161:6:0", - "typeDescriptions": - { - "typeIdentifier": "t_function_assert_pure$_t_bool_$returns$__$", - "typeString": "function (bool) pure" - } - }, - "id": 15, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "161:17:0", - "tryCall": false, - "typeDescriptions": - { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 16, - "nodeType": "ExpressionStatement", - "src": "161:17:0" - } - ] - }, - "id": 18, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "getarray", - "nameLocation": "97:8:0", - "nodeType": "FunctionDefinition", - "parameters": - { - "id": 7, - "nodeType": "ParameterList", - "parameters": - [ - { - "constant": false, - "id": 4, - "mutability": "mutable", - "name": "c", - "nameLocation": "123:1:0", - "nodeType": "VariableDeclaration", - "scope": 18, - "src": "106:18:0", - "stateVariable": false, - "storageLocation": "memory", - "typeDescriptions": - { - "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", - "typeString": "address[]" - }, - "typeName": - { - "baseType": - { - "id": 2, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "106:7:0", - "stateMutability": "nonpayable", - "typeDescriptions": - { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "id": 3, - "nodeType": "ArrayTypeName", - "src": "106:9:0", - "typeDescriptions": - { - "typeIdentifier": "t_array$_t_address_$dyn_storage_ptr", - "typeString": "address[]" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 6, - "mutability": "mutable", - "name": "e", - "nameLocation": "134:1:0", - "nodeType": "VariableDeclaration", - "scope": 18, - "src": "126:9:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": - { - "id": 5, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "126:7:0", - "stateMutability": "nonpayable", - "typeDescriptions": - { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "visibility": "internal" - } - ], - "src": "105:31:0" - }, - "returnParameters": - { - "id": 8, - "nodeType": "ParameterList", - "parameters": [], - "src": "151:0:0" - }, - "scope": 33, - "src": "88:97:0", - "stateMutability": "pure", - "virtual": false, - "visibility": "internal" - }, - { - "body": - { - "id": 31, - "nodeType": "Block", - "src": "247:29:0", - "statements": - [ - { - "expression": - { - "commonType": - { - "typeIdentifier": "t_int8", - "typeString": "int8" - }, - "id": 29, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": - { - "id": 27, - "name": "a", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 20, - "src": "264:1:0", - "typeDescriptions": - { - "typeIdentifier": "t_int8", - "typeString": "int8" - } - }, - "nodeType": "BinaryOperation", - "operator": "+", - "rightExpression": - { - "id": 28, - "name": "b", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 22, - "src": "268:1:0", - "typeDescriptions": - { - "typeIdentifier": "t_int8", - "typeString": "int8" - } - }, - "src": "264:5:0", - "typeDescriptions": - { - "typeIdentifier": "t_int8", - "typeString": "int8" - } - }, - "functionReturnParameters": 26, - "id": 30, - "nodeType": "Return", - "src": "257:12:0" - } - ] - }, - "functionSelector": "e2666777", - "id": 32, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "add", - "nameLocation": "200:3:0", - "nodeType": "FunctionDefinition", - "parameters": - { - "id": 23, - "nodeType": "ParameterList", - "parameters": - [ - { - "constant": false, - "id": 20, - "mutability": "mutable", - "name": "a", - "nameLocation": "209:1:0", - "nodeType": "VariableDeclaration", - "scope": 32, - "src": "204:6:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_int8", - "typeString": "int8" - }, - "typeName": - { - "id": 19, - "name": "int8", - "nodeType": "ElementaryTypeName", - "src": "204:4:0", - "typeDescriptions": - { - "typeIdentifier": "t_int8", - "typeString": "int8" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 22, - "mutability": "mutable", - "name": "b", - "nameLocation": "217:1:0", - "nodeType": "VariableDeclaration", - "scope": 32, - "src": "212:6:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_int8", - "typeString": "int8" - }, - "typeName": - { - "id": 21, - "name": "int8", - "nodeType": "ElementaryTypeName", - "src": "212:4:0", - "typeDescriptions": - { - "typeIdentifier": "t_int8", - "typeString": "int8" - } - }, - "visibility": "internal" - } - ], - "src": "203:16:0" - }, - "returnParameters": - { - "id": 26, - "nodeType": "ParameterList", - "parameters": - [ - { - "constant": false, - "id": 25, - "mutability": "mutable", - "name": "", - "nameLocation": "-1:-1:-1", - "nodeType": "VariableDeclaration", - "scope": 32, - "src": "241:4:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_int8", - "typeString": "int8" - }, - "typeName": - { - "id": 24, - "name": "int8", - "nodeType": "ElementaryTypeName", - "src": "241:4:0", - "typeDescriptions": - { - "typeIdentifier": "t_int8", - "typeString": "int8" - } - }, - "visibility": "internal" - } - ], - "src": "240:6:0" - }, - "scope": 33, - "src": "191:85:0", - "stateMutability": "pure", - "virtual": false, - "visibility": "public" - } - ], - "scope": 136, - "src": "68:210:0", - "usedErrors": [] - }, - { - "abstract": false, - "baseContracts": [], - "canonicalName": "C", - "contractDependencies": [], - "contractKind": "contract", - "fullyImplemented": true, - "id": 135, - "linearizedBaseContracts": - [ - 135 - ], - "name": "C", - "nameLocation": "289:1:0", - "nodeType": "ContractDefinition", - "nodes": - [ - { - "body": - { - "id": 59, - "nodeType": "Block", - "src": "353:99:0", - "statements": - [ - { - "assignments": - [ - 43 - ], - "declarations": - [ - { - "constant": false, - "id": 43, - "mutability": "mutable", - "name": "a", - "nameLocation": "380:1:0", - "nodeType": "VariableDeclaration", - "scope": 59, - "src": "363:18:0", - "stateVariable": false, - "storageLocation": "memory", - "typeDescriptions": - { - "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", - "typeString": "address[]" - }, - "typeName": - { - "baseType": - { - "id": 41, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "363:7:0", - "typeDescriptions": - { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "id": 42, - "nodeType": "ArrayTypeName", - "src": "363:9:0", - "typeDescriptions": - { - "typeIdentifier": "t_array$_t_address_$dyn_storage_ptr", - "typeString": "address[]" - } - }, - "visibility": "internal" - } - ], - "id": 49, - "initialValue": - { - "arguments": - [ - { - "hexValue": "31", - "id": 47, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "398:1:0", - "typeDescriptions": - { - "typeIdentifier": "t_rational_1_by_1", - "typeString": "int_const 1" - }, - "value": "1" - } - ], - "expression": - { - "argumentTypes": - [ - { - "typeIdentifier": "t_rational_1_by_1", - "typeString": "int_const 1" - } - ], - "id": 46, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "nodeType": "NewExpression", - "src": "384:13:0", - "typeDescriptions": - { - "typeIdentifier": "t_function_objectcreation_pure$_t_uint256_$returns$_t_array$_t_address_$dyn_memory_ptr_$", - "typeString": "function (uint256) pure returns (address[] memory)" - }, - "typeName": - { - "baseType": - { - "id": 44, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "388:7:0", - "stateMutability": "nonpayable", - "typeDescriptions": - { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "id": 45, - "nodeType": "ArrayTypeName", - "src": "388:9:0", - "typeDescriptions": - { - "typeIdentifier": "t_array$_t_address_$dyn_storage_ptr", - "typeString": "address[]" - } - } - }, - "id": 48, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "384:16:0", - "tryCall": false, - "typeDescriptions": - { - "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", - "typeString": "address[] memory" - } - }, - "nodeType": "VariableDeclarationStatement", - "src": "363:37:0" - }, - { - "expression": - { - "id": 55, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": - { - "baseExpression": - { - "id": 50, - "name": "a", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 43, - "src": "410:1:0", - "typeDescriptions": - { - "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", - "typeString": "address[] memory" - } - }, - "id": 52, - "indexExpression": - { - "hexValue": "30", - "id": 51, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "412:1:0", - "typeDescriptions": - { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - }, - "value": "0" - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": true, - "nodeType": "IndexAccess", - "src": "410:4:0", - "typeDescriptions": - { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": - { - "expression": - { - "id": 53, - "name": "msg", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": -15, - "src": "417:3:0", - "typeDescriptions": - { - "typeIdentifier": "t_magic_message", - "typeString": "msg" - } - }, - "id": 54, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "sender", - "nodeType": "MemberAccess", - "src": "417:10:0", - "typeDescriptions": - { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "src": "410:17:0", - "typeDescriptions": - { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "id": 56, - "nodeType": "ExpressionStatement", - "src": "410:17:0" - }, - { - "expression": - { - "id": 57, - "name": "a", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 43, - "src": "444:1:0", - "typeDescriptions": - { - "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", - "typeString": "address[] memory" - } - }, - "functionReturnParameters": 38, - "id": 58, - "nodeType": "Return", - "src": "437:8:0" - } - ] - }, - "functionSelector": "c2985578", - "id": 60, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "foo", - "nameLocation": "306:3:0", - "nodeType": "FunctionDefinition", - "parameters": - { - "id": 34, - "nodeType": "ParameterList", - "parameters": [], - "src": "309:2:0" - }, - "returnParameters": - { - "id": 38, - "nodeType": "ParameterList", - "parameters": - [ - { - "constant": false, - "id": 37, - "mutability": "mutable", - "name": "", - "nameLocation": "-1:-1:-1", - "nodeType": "VariableDeclaration", - "scope": 60, - "src": "335:16:0", - "stateVariable": false, - "storageLocation": "memory", - "typeDescriptions": - { - "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", - "typeString": "address[]" - }, - "typeName": - { - "baseType": - { - "id": 35, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "335:7:0", - "stateMutability": "nonpayable", - "typeDescriptions": - { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "id": 36, - "nodeType": "ArrayTypeName", - "src": "335:9:0", - "typeDescriptions": - { - "typeIdentifier": "t_array$_t_address_$dyn_storage_ptr", - "typeString": "address[]" - } - }, - "visibility": "internal" - } - ], - "src": "334:18:0" - }, - "scope": 135, - "src": "297:155:0", - "stateMutability": "view", - "virtual": false, - "visibility": "external" - }, - { - "body": - { - "id": 79, - "nodeType": "Block", - "src": "532:88:0", - "statements": - [ - { - "assignments": - [ - 68 - ], - "declarations": - [ - { - "constant": false, - "id": 68, - "mutability": "mutable", - "name": "a", - "nameLocation": "550:1:0", - "nodeType": "VariableDeclaration", - "scope": 79, - "src": "542:9:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": - { - "id": 67, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "542:7:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - } - ], - "id": 70, - "initialValue": - { - "hexValue": "3130", - "id": 69, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "554:2:0", - "typeDescriptions": - { - "typeIdentifier": "t_rational_10_by_1", - "typeString": "int_const 10" - }, - "value": "10" - }, - "nodeType": "VariableDeclarationStatement", - "src": "542:14:0" - }, - { - "assignments": - [ - 72 - ], - "declarations": - [ - { - "constant": false, - "id": 72, - "mutability": "mutable", - "name": "res", - "nameLocation": "574:3:0", - "nodeType": "VariableDeclaration", - "scope": 79, - "src": "566:11:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": - { - "id": 71, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "566:7:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - } - ], - "id": 76, - "initialValue": - { - "commonType": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 75, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": - { - "id": 73, - "name": "a", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 68, - "src": "580:1:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "**", - "rightExpression": - { - "id": 74, - "name": "decimals", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 62, - "src": "585:8:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - } - }, - "src": "580:13:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "VariableDeclarationStatement", - "src": "566:27:0" - }, - { - "expression": - { - "id": 77, - "name": "res", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 72, - "src": "610:3:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "functionReturnParameters": 66, - "id": 78, - "nodeType": "Return", - "src": "603:10:0" - } - ] - }, - "functionSelector": "eb79f1be", - "id": 80, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "get10PowerDecimals", - "nameLocation": "467:18:0", - "nodeType": "FunctionDefinition", - "parameters": - { - "id": 63, - "nodeType": "ParameterList", - "parameters": - [ - { - "constant": false, - "id": 62, - "mutability": "mutable", - "name": "decimals", - "nameLocation": "492:8:0", - "nodeType": "VariableDeclaration", - "scope": 80, - "src": "486:14:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - }, - "typeName": - { - "id": 61, - "name": "uint8", - "nodeType": "ElementaryTypeName", - "src": "486:5:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - } - }, - "visibility": "internal" - } - ], - "src": "485:16:0" - }, - "returnParameters": - { - "id": 66, - "nodeType": "ParameterList", - "parameters": - [ - { - "constant": false, - "id": 65, - "mutability": "mutable", - "name": "", - "nameLocation": "-1:-1:-1", - "nodeType": "VariableDeclaration", - "scope": 80, - "src": "523:7:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": - { - "id": 64, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "523:7:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - } - ], - "src": "522:9:0" - }, - "scope": 135, - "src": "458:162:0", - "stateMutability": "pure", - "virtual": false, - "visibility": "public" - }, - { - "body": - { - "id": 96, - "nodeType": "Block", - "src": "687:34:0", - "statements": - [ - { - "expression": - { - "arguments": - [ - { - "commonType": - { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "id": 93, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": - { - "baseExpression": - { - "id": 89, - "name": "c", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 83, - "src": "704:1:0", - "typeDescriptions": - { - "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", - "typeString": "address[] memory" - } - }, - "id": 91, - "indexExpression": - { - "hexValue": "30", - "id": 90, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "706:1:0", - "typeDescriptions": - { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - }, - "value": "0" - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "704:4:0", - "typeDescriptions": - { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "nodeType": "BinaryOperation", - "operator": "==", - "rightExpression": - { - "id": 92, - "name": "e", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 85, - "src": "712:1:0", - "typeDescriptions": - { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "src": "704:9:0", - "typeDescriptions": - { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - } - ], - "expression": - { - "argumentTypes": - [ - { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - ], - "id": 88, - "name": "assert", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": -3, - "src": "697:6:0", - "typeDescriptions": - { - "typeIdentifier": "t_function_assert_pure$_t_bool_$returns$__$", - "typeString": "function (bool) pure" - } - }, - "id": 94, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "697:17:0", - "tryCall": false, - "typeDescriptions": - { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 95, - "nodeType": "ExpressionStatement", - "src": "697:17:0" - } - ] - }, - "functionSelector": "e5b2857b", - "id": 97, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "getarray", - "nameLocation": "635:8:0", - "nodeType": "FunctionDefinition", - "parameters": - { - "id": 86, - "nodeType": "ParameterList", - "parameters": - [ - { - "constant": false, - "id": 83, - "mutability": "mutable", - "name": "c", - "nameLocation": "661:1:0", - "nodeType": "VariableDeclaration", - "scope": 97, - "src": "644:18:0", - "stateVariable": false, - "storageLocation": "memory", - "typeDescriptions": - { - "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", - "typeString": "address[]" - }, - "typeName": - { - "baseType": - { - "id": 81, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "644:7:0", - "stateMutability": "nonpayable", - "typeDescriptions": - { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "id": 82, - "nodeType": "ArrayTypeName", - "src": "644:9:0", - "typeDescriptions": - { - "typeIdentifier": "t_array$_t_address_$dyn_storage_ptr", - "typeString": "address[]" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 85, - "mutability": "mutable", - "name": "e", - "nameLocation": "672:1:0", - "nodeType": "VariableDeclaration", - "scope": 97, - "src": "664:9:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": - { - "id": 84, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "664:7:0", - "stateMutability": "nonpayable", - "typeDescriptions": - { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "visibility": "internal" - } - ], - "src": "643:31:0" - }, - "returnParameters": - { - "id": 87, - "nodeType": "ParameterList", - "parameters": [], - "src": "687:0:0" - }, - "scope": 135, - "src": "626:95:0", - "stateMutability": "pure", - "virtual": false, - "visibility": "public" - }, - { - "body": - { - "id": 119, - "nodeType": "Block", - "src": "763:90:0", - "statements": - [ - { - "assignments": - [ - 104 - ], - "declarations": - [ - { - "constant": false, - "id": 104, - "mutability": "mutable", - "name": "b", - "nameLocation": "790:1:0", - "nodeType": "VariableDeclaration", - "scope": 119, - "src": "773:18:0", - "stateVariable": false, - "storageLocation": "memory", - "typeDescriptions": - { - "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", - "typeString": "address[]" - }, - "typeName": - { - "baseType": - { - "id": 102, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "773:7:0", - "typeDescriptions": - { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "id": 103, - "nodeType": "ArrayTypeName", - "src": "773:9:0", - "typeDescriptions": - { - "typeIdentifier": "t_array$_t_address_$dyn_storage_ptr", - "typeString": "address[]" - } - }, - "visibility": "internal" - } - ], - "id": 108, - "initialValue": - { - "arguments": [], - "expression": - { - "argumentTypes": [], - "expression": - { - "id": 105, - "name": "this", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": -28, - "src": "794:4:0", - "typeDescriptions": - { - "typeIdentifier": "t_contract$_C_$135", - "typeString": "contract C" - } - }, - "id": 106, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "foo", - "nodeType": "MemberAccess", - "referencedDeclaration": 60, - "src": "794:8:0", - "typeDescriptions": - { - "typeIdentifier": "t_function_external_view$__$returns$_t_array$_t_address_$dyn_memory_ptr_$", - "typeString": "function () view external returns (address[] memory)" - } - }, - "id": 107, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "794:10:0", - "tryCall": false, - "typeDescriptions": - { - "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", - "typeString": "address[] memory" - } - }, - "nodeType": "VariableDeclarationStatement", - "src": "773:31:0" - }, - { - "expression": - { - "arguments": - [ - { - "id": 112, - "name": "b", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 104, - "src": "829:1:0", - "typeDescriptions": - { - "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", - "typeString": "address[] memory" - } - }, - { - "arguments": - [ - { - "id": 115, - "name": "this", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": -28, - "src": "840:4:0", - "typeDescriptions": - { - "typeIdentifier": "t_contract$_C_$135", - "typeString": "contract C" - } - } - ], - "expression": - { - "argumentTypes": - [ - { - "typeIdentifier": "t_contract$_C_$135", - "typeString": "contract C" - } - ], - "id": 114, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "nodeType": "ElementaryTypeNameExpression", - "src": "832:7:0", - "typeDescriptions": - { - "typeIdentifier": "t_type$_t_address_$", - "typeString": "type(address)" - }, - "typeName": - { - "id": 113, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "832:7:0", - "typeDescriptions": {} - } - }, - "id": 116, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "typeConversion", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "832:13:0", - "tryCall": false, - "typeDescriptions": - { - "typeIdentifier": "t_address", - "typeString": "address" - } - } - ], - "expression": - { - "argumentTypes": - [ - { - "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", - "typeString": "address[] memory" - }, - { - "typeIdentifier": "t_address", - "typeString": "address" - } - ], - "expression": - { - "id": 109, - "name": "Utils", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 33, - "src": "814:5:0", - "typeDescriptions": - { - "typeIdentifier": "t_type$_t_contract$_Utils_$33_$", - "typeString": "type(library Utils)" - } - }, - "id": 111, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "getarray", - "nodeType": "MemberAccess", - "referencedDeclaration": 18, - "src": "814:14:0", - "typeDescriptions": - { - "typeIdentifier": "t_function_internal_pure$_t_array$_t_address_$dyn_memory_ptr_$_t_address_$returns$__$", - "typeString": "function (address[] memory,address) pure" - } - }, - "id": 117, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "814:32:0", - "tryCall": false, - "typeDescriptions": - { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 118, - "nodeType": "ExpressionStatement", - "src": "814:32:0" - } - ] - }, - "functionSelector": "d3ab473b", - "id": 120, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "callmyself", - "nameLocation": "736:10:0", - "nodeType": "FunctionDefinition", - "parameters": - { - "id": 98, - "nodeType": "ParameterList", - "parameters": [], - "src": "746:2:0" - }, - "returnParameters": - { - "id": 99, - "nodeType": "ParameterList", - "parameters": [], - "src": "763:0:0" - }, - "scope": 135, - "src": "727:126:0", - "stateMutability": "view", - "virtual": false, - "visibility": "external" - }, - { - "body": - { - "id": 133, - "nodeType": "Block", - "src": "915:29:0", - "statements": - [ - { - "expression": - { - "commonType": - { - "typeIdentifier": "t_int8", - "typeString": "int8" - }, - "id": 131, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": - { - "id": 129, - "name": "c", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 122, - "src": "932:1:0", - "typeDescriptions": - { - "typeIdentifier": "t_int8", - "typeString": "int8" - } - }, - "nodeType": "BinaryOperation", - "operator": "+", - "rightExpression": - { - "id": 130, - "name": "d", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 124, - "src": "936:1:0", - "typeDescriptions": - { - "typeIdentifier": "t_int8", - "typeString": "int8" - } - }, - "src": "932:5:0", - "typeDescriptions": - { - "typeIdentifier": "t_int8", - "typeString": "int8" - } - }, - "functionReturnParameters": 128, - "id": 132, - "nodeType": "Return", - "src": "925:12:0" - } - ] - }, - "functionSelector": "e2666777", - "id": 134, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "add", - "nameLocation": "868:3:0", - "nodeType": "FunctionDefinition", - "parameters": - { - "id": 125, - "nodeType": "ParameterList", - "parameters": - [ - { - "constant": false, - "id": 122, - "mutability": "mutable", - "name": "c", - "nameLocation": "877:1:0", - "nodeType": "VariableDeclaration", - "scope": 134, - "src": "872:6:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_int8", - "typeString": "int8" - }, - "typeName": - { - "id": 121, - "name": "int8", - "nodeType": "ElementaryTypeName", - "src": "872:4:0", - "typeDescriptions": - { - "typeIdentifier": "t_int8", - "typeString": "int8" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 124, - "mutability": "mutable", - "name": "d", - "nameLocation": "885:1:0", - "nodeType": "VariableDeclaration", - "scope": 134, - "src": "880:6:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_int8", - "typeString": "int8" - }, - "typeName": - { - "id": 123, - "name": "int8", - "nodeType": "ElementaryTypeName", - "src": "880:4:0", - "typeDescriptions": - { - "typeIdentifier": "t_int8", - "typeString": "int8" - } - }, - "visibility": "internal" - } - ], - "src": "871:16:0" - }, - "returnParameters": - { - "id": 128, - "nodeType": "ParameterList", - "parameters": - [ - { - "constant": false, - "id": 127, - "mutability": "mutable", - "name": "", - "nameLocation": "-1:-1:-1", - "nodeType": "VariableDeclaration", - "scope": 134, - "src": "909:4:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_int8", - "typeString": "int8" - }, - "typeName": - { - "id": 126, - "name": "int8", - "nodeType": "ElementaryTypeName", - "src": "909:4:0", - "typeDescriptions": - { - "typeIdentifier": "t_int8", - "typeString": "int8" - } - }, - "visibility": "internal" - } - ], - "src": "908:6:0" - }, - "scope": 135, - "src": "859:85:0", - "stateMutability": "pure", - "virtual": false, - "visibility": "public" - } - ], - "scope": 136, - "src": "280:666:0", - "usedErrors": [] - } - ], - "src": "42:905:0" -} \ No newline at end of file diff --git a/resources/regressions/multiple-contracts-4.json/mutants.log b/resources/regressions/multiple-contracts-4.json/mutants.log deleted file mode 100644 index 826b78c..0000000 --- a/resources/regressions/multiple-contracts-4.json/mutants.log +++ /dev/null @@ -1,8 +0,0 @@ -1,BinaryOpMutation,MultipleContracts/C.sol,11:17, + ,- -2,BinaryOpMutation,MultipleContracts/C.sol,11:17, + ,* -3,BinaryOpMutation,MultipleContracts/C.sol,11:17, + ,/ -4,BinaryOpMutation,MultipleContracts/C.sol,11:17, + ,% -5,BinaryOpMutation,MultipleContracts/C.sol,38:17, + ,- -6,BinaryOpMutation,MultipleContracts/C.sol,38:17, + ,* -7,BinaryOpMutation,MultipleContracts/C.sol,38:17, + ,/ -8,BinaryOpMutation,MultipleContracts/C.sol,38:17, + ,% diff --git a/resources/regressions/multiple-contracts-4.json/mutants/1/MultipleContracts/C.sol b/resources/regressions/multiple-contracts-4.json/mutants/1/MultipleContracts/C.sol deleted file mode 100644 index a514961..0000000 --- a/resources/regressions/multiple-contracts-4.json/mutants/1/MultipleContracts/C.sol +++ /dev/null @@ -1,41 +0,0 @@ -// SPDX-License-Identifier: GPL-3.0-only - -pragma solidity ^0.8.13; - -library Utils { - function getarray(address[] memory c, address e) internal pure { - assert(c[0] == e); - } - - function add(int8 a, int8 b) public pure returns (int8) { - /// BinaryOpMutation(`+` |==> `-`) of: `return a + b;` - return a-b; - } -} - -contract C { - function foo() external view returns (address[] memory) { - address[] memory a = new address[](1); - a[0] = msg.sender; - return a; - } - - function get10PowerDecimals(uint8 decimals) public pure returns (uint256) { - uint256 a = 10; - uint256 res = a ** decimals; - return res; - } - - function getarray(address[] memory c, address e) public pure { - assert(c[0] == e); - } - - function callmyself() external view { - address[] memory b = this.foo(); - Utils.getarray(b, address(this)); - } - - function add(int8 c, int8 d) public pure returns (int8) { - return c + d; - } -} diff --git a/resources/regressions/multiple-contracts-4.json/mutants/2/MultipleContracts/C.sol b/resources/regressions/multiple-contracts-4.json/mutants/2/MultipleContracts/C.sol deleted file mode 100644 index b85149e..0000000 --- a/resources/regressions/multiple-contracts-4.json/mutants/2/MultipleContracts/C.sol +++ /dev/null @@ -1,41 +0,0 @@ -// SPDX-License-Identifier: GPL-3.0-only - -pragma solidity ^0.8.13; - -library Utils { - function getarray(address[] memory c, address e) internal pure { - assert(c[0] == e); - } - - function add(int8 a, int8 b) public pure returns (int8) { - /// BinaryOpMutation(`+` |==> `*`) of: `return a + b;` - return a*b; - } -} - -contract C { - function foo() external view returns (address[] memory) { - address[] memory a = new address[](1); - a[0] = msg.sender; - return a; - } - - function get10PowerDecimals(uint8 decimals) public pure returns (uint256) { - uint256 a = 10; - uint256 res = a ** decimals; - return res; - } - - function getarray(address[] memory c, address e) public pure { - assert(c[0] == e); - } - - function callmyself() external view { - address[] memory b = this.foo(); - Utils.getarray(b, address(this)); - } - - function add(int8 c, int8 d) public pure returns (int8) { - return c + d; - } -} diff --git a/resources/regressions/multiple-contracts-4.json/mutants/3/MultipleContracts/C.sol b/resources/regressions/multiple-contracts-4.json/mutants/3/MultipleContracts/C.sol deleted file mode 100644 index a5819d3..0000000 --- a/resources/regressions/multiple-contracts-4.json/mutants/3/MultipleContracts/C.sol +++ /dev/null @@ -1,41 +0,0 @@ -// SPDX-License-Identifier: GPL-3.0-only - -pragma solidity ^0.8.13; - -library Utils { - function getarray(address[] memory c, address e) internal pure { - assert(c[0] == e); - } - - function add(int8 a, int8 b) public pure returns (int8) { - /// BinaryOpMutation(`+` |==> `/`) of: `return a + b;` - return a/b; - } -} - -contract C { - function foo() external view returns (address[] memory) { - address[] memory a = new address[](1); - a[0] = msg.sender; - return a; - } - - function get10PowerDecimals(uint8 decimals) public pure returns (uint256) { - uint256 a = 10; - uint256 res = a ** decimals; - return res; - } - - function getarray(address[] memory c, address e) public pure { - assert(c[0] == e); - } - - function callmyself() external view { - address[] memory b = this.foo(); - Utils.getarray(b, address(this)); - } - - function add(int8 c, int8 d) public pure returns (int8) { - return c + d; - } -} diff --git a/resources/regressions/multiple-contracts-4.json/mutants/4/MultipleContracts/C.sol b/resources/regressions/multiple-contracts-4.json/mutants/4/MultipleContracts/C.sol deleted file mode 100644 index 530045e..0000000 --- a/resources/regressions/multiple-contracts-4.json/mutants/4/MultipleContracts/C.sol +++ /dev/null @@ -1,41 +0,0 @@ -// SPDX-License-Identifier: GPL-3.0-only - -pragma solidity ^0.8.13; - -library Utils { - function getarray(address[] memory c, address e) internal pure { - assert(c[0] == e); - } - - function add(int8 a, int8 b) public pure returns (int8) { - /// BinaryOpMutation(`+` |==> `%`) of: `return a + b;` - return a%b; - } -} - -contract C { - function foo() external view returns (address[] memory) { - address[] memory a = new address[](1); - a[0] = msg.sender; - return a; - } - - function get10PowerDecimals(uint8 decimals) public pure returns (uint256) { - uint256 a = 10; - uint256 res = a ** decimals; - return res; - } - - function getarray(address[] memory c, address e) public pure { - assert(c[0] == e); - } - - function callmyself() external view { - address[] memory b = this.foo(); - Utils.getarray(b, address(this)); - } - - function add(int8 c, int8 d) public pure returns (int8) { - return c + d; - } -} diff --git a/resources/regressions/multiple-contracts-4.json/mutants/5/MultipleContracts/C.sol b/resources/regressions/multiple-contracts-4.json/mutants/5/MultipleContracts/C.sol deleted file mode 100644 index 6568d8b..0000000 --- a/resources/regressions/multiple-contracts-4.json/mutants/5/MultipleContracts/C.sol +++ /dev/null @@ -1,41 +0,0 @@ -// SPDX-License-Identifier: GPL-3.0-only - -pragma solidity ^0.8.13; - -library Utils { - function getarray(address[] memory c, address e) internal pure { - assert(c[0] == e); - } - - function add(int8 a, int8 b) public pure returns (int8) { - return a + b; - } -} - -contract C { - function foo() external view returns (address[] memory) { - address[] memory a = new address[](1); - a[0] = msg.sender; - return a; - } - - function get10PowerDecimals(uint8 decimals) public pure returns (uint256) { - uint256 a = 10; - uint256 res = a ** decimals; - return res; - } - - function getarray(address[] memory c, address e) public pure { - assert(c[0] == e); - } - - function callmyself() external view { - address[] memory b = this.foo(); - Utils.getarray(b, address(this)); - } - - function add(int8 c, int8 d) public pure returns (int8) { - /// BinaryOpMutation(`+` |==> `-`) of: `return c + d;` - return c-d; - } -} diff --git a/resources/regressions/multiple-contracts-4.json/mutants/6/MultipleContracts/C.sol b/resources/regressions/multiple-contracts-4.json/mutants/6/MultipleContracts/C.sol deleted file mode 100644 index b4f749d..0000000 --- a/resources/regressions/multiple-contracts-4.json/mutants/6/MultipleContracts/C.sol +++ /dev/null @@ -1,41 +0,0 @@ -// SPDX-License-Identifier: GPL-3.0-only - -pragma solidity ^0.8.13; - -library Utils { - function getarray(address[] memory c, address e) internal pure { - assert(c[0] == e); - } - - function add(int8 a, int8 b) public pure returns (int8) { - return a + b; - } -} - -contract C { - function foo() external view returns (address[] memory) { - address[] memory a = new address[](1); - a[0] = msg.sender; - return a; - } - - function get10PowerDecimals(uint8 decimals) public pure returns (uint256) { - uint256 a = 10; - uint256 res = a ** decimals; - return res; - } - - function getarray(address[] memory c, address e) public pure { - assert(c[0] == e); - } - - function callmyself() external view { - address[] memory b = this.foo(); - Utils.getarray(b, address(this)); - } - - function add(int8 c, int8 d) public pure returns (int8) { - /// BinaryOpMutation(`+` |==> `*`) of: `return c + d;` - return c*d; - } -} diff --git a/resources/regressions/multiple-contracts-4.json/mutants/7/MultipleContracts/C.sol b/resources/regressions/multiple-contracts-4.json/mutants/7/MultipleContracts/C.sol deleted file mode 100644 index 206e0f6..0000000 --- a/resources/regressions/multiple-contracts-4.json/mutants/7/MultipleContracts/C.sol +++ /dev/null @@ -1,41 +0,0 @@ -// SPDX-License-Identifier: GPL-3.0-only - -pragma solidity ^0.8.13; - -library Utils { - function getarray(address[] memory c, address e) internal pure { - assert(c[0] == e); - } - - function add(int8 a, int8 b) public pure returns (int8) { - return a + b; - } -} - -contract C { - function foo() external view returns (address[] memory) { - address[] memory a = new address[](1); - a[0] = msg.sender; - return a; - } - - function get10PowerDecimals(uint8 decimals) public pure returns (uint256) { - uint256 a = 10; - uint256 res = a ** decimals; - return res; - } - - function getarray(address[] memory c, address e) public pure { - assert(c[0] == e); - } - - function callmyself() external view { - address[] memory b = this.foo(); - Utils.getarray(b, address(this)); - } - - function add(int8 c, int8 d) public pure returns (int8) { - /// BinaryOpMutation(`+` |==> `/`) of: `return c + d;` - return c/d; - } -} diff --git a/resources/regressions/multiple-contracts-4.json/mutants/8/MultipleContracts/C.sol b/resources/regressions/multiple-contracts-4.json/mutants/8/MultipleContracts/C.sol deleted file mode 100644 index 2d95fad..0000000 --- a/resources/regressions/multiple-contracts-4.json/mutants/8/MultipleContracts/C.sol +++ /dev/null @@ -1,41 +0,0 @@ -// SPDX-License-Identifier: GPL-3.0-only - -pragma solidity ^0.8.13; - -library Utils { - function getarray(address[] memory c, address e) internal pure { - assert(c[0] == e); - } - - function add(int8 a, int8 b) public pure returns (int8) { - return a + b; - } -} - -contract C { - function foo() external view returns (address[] memory) { - address[] memory a = new address[](1); - a[0] = msg.sender; - return a; - } - - function get10PowerDecimals(uint8 decimals) public pure returns (uint256) { - uint256 a = 10; - uint256 res = a ** decimals; - return res; - } - - function getarray(address[] memory c, address e) public pure { - assert(c[0] == e); - } - - function callmyself() external view { - address[] memory b = this.foo(); - Utils.getarray(b, address(this)); - } - - function add(int8 c, int8 d) public pure returns (int8) { - /// BinaryOpMutation(`+` |==> `%`) of: `return c + d;` - return c%d; - } -} diff --git a/resources/regressions/no_import_path.json/gambit_results.json b/resources/regressions/no_import_path.json/gambit_results.json new file mode 100644 index 0000000..fe40432 --- /dev/null +++ b/resources/regressions/no_import_path.json/gambit_results.json @@ -0,0 +1,362 @@ +[ + { + "col": 9, + "description": "StatementDeletion", + "diff": "--- original\n+++ mutant\n@@ -5,8 +5,9 @@\n import \"contracts/Imported.sol\";\n \n library Utils {\n+ /// StatementDeletion(`assert(c[0] == e)` |==> `assert(true)`) of: `assert(c[0] == e);`\n function getarray(address[] memory c, address e) internal pure {\n- assert(c[0] == e);\n+ assert(true);\n }\n \n function add(int8 a, int8 b) public pure returns (int8) {\n", + "id": "1", + "line": 9, + "name": "mutants/1/contracts/C.sol", + "op": "STD", + "orig": "assert(c[0] == e)", + "original": "contracts/C.sol", + "repl": "assert(true)" + }, + { + "col": 16, + "description": "RelationalOperatorReplacement", + "diff": "--- original\n+++ mutant\n@@ -5,8 +5,9 @@\n import \"contracts/Imported.sol\";\n \n library Utils {\n+ /// RelationalOperatorReplacement(`c[0] == e` |==> `false`) of: `assert(c[0] == e);`\n function getarray(address[] memory c, address e) internal pure {\n- assert(c[0] == e);\n+ assert(false);\n }\n \n function add(int8 a, int8 b) public pure returns (int8) {\n", + "id": "2", + "line": 9, + "name": "mutants/2/contracts/C.sol", + "op": "ROR", + "orig": "c[0] == e", + "original": "contracts/C.sol", + "repl": "false" + }, + { + "col": 18, + "description": "LiteralValueReplacement", + "diff": "--- original\n+++ mutant\n@@ -5,8 +5,9 @@\n import \"contracts/Imported.sol\";\n \n library Utils {\n+ /// LiteralValueReplacement(`0` |==> `1`) of: `assert(c[0] == e);`\n function getarray(address[] memory c, address e) internal pure {\n- assert(c[0] == e);\n+ assert(c[1] == e);\n }\n \n function add(int8 a, int8 b) public pure returns (int8) {\n", + "id": "3", + "line": 9, + "name": "mutants/3/contracts/C.sol", + "op": "LVR", + "orig": "0", + "original": "contracts/C.sol", + "repl": "1" + }, + { + "col": 9, + "description": "StatementDeletion", + "diff": "--- original\n+++ mutant\n@@ -9,8 +9,9 @@\n assert(c[0] == e);\n }\n \n+ /// StatementDeletion(`return a + b` |==> `assert(true)`) of: `return a + b;`\n function add(int8 a, int8 b) public pure returns (int8) {\n- return a + b;\n+ assert(true);\n }\n }\n \n", + "id": "4", + "line": 13, + "name": "mutants/4/contracts/C.sol", + "op": "STD", + "orig": "return a + b", + "original": "contracts/C.sol", + "repl": "assert(true)" + }, + { + "col": 18, + "description": "ArithmeticOperatorReplacement", + "diff": "--- original\n+++ mutant\n@@ -9,8 +9,9 @@\n assert(c[0] == e);\n }\n \n+ /// ArithmeticOperatorReplacement(`+` |==> `-`) of: `return a + b;`\n function add(int8 a, int8 b) public pure returns (int8) {\n- return a + b;\n+ return a - b;\n }\n }\n \n", + "id": "5", + "line": 13, + "name": "mutants/5/contracts/C.sol", + "op": "AOR", + "orig": "+", + "original": "contracts/C.sol", + "repl": "-" + }, + { + "col": 18, + "description": "ArithmeticOperatorReplacement", + "diff": "--- original\n+++ mutant\n@@ -9,8 +9,9 @@\n assert(c[0] == e);\n }\n \n+ /// ArithmeticOperatorReplacement(`+` |==> `*`) of: `return a + b;`\n function add(int8 a, int8 b) public pure returns (int8) {\n- return a + b;\n+ return a * b;\n }\n }\n \n", + "id": "6", + "line": 13, + "name": "mutants/6/contracts/C.sol", + "op": "AOR", + "orig": "+", + "original": "contracts/C.sol", + "repl": "*" + }, + { + "col": 18, + "description": "ArithmeticOperatorReplacement", + "diff": "--- original\n+++ mutant\n@@ -9,8 +9,9 @@\n assert(c[0] == e);\n }\n \n+ /// ArithmeticOperatorReplacement(`+` |==> `/`) of: `return a + b;`\n function add(int8 a, int8 b) public pure returns (int8) {\n- return a + b;\n+ return a / b;\n }\n }\n \n", + "id": "7", + "line": 13, + "name": "mutants/7/contracts/C.sol", + "op": "AOR", + "orig": "+", + "original": "contracts/C.sol", + "repl": "/" + }, + { + "col": 18, + "description": "ArithmeticOperatorReplacement", + "diff": "--- original\n+++ mutant\n@@ -9,8 +9,9 @@\n assert(c[0] == e);\n }\n \n+ /// ArithmeticOperatorReplacement(`+` |==> `%`) of: `return a + b;`\n function add(int8 a, int8 b) public pure returns (int8) {\n- return a + b;\n+ return a % b;\n }\n }\n \n", + "id": "8", + "line": 13, + "name": "mutants/8/contracts/C.sol", + "op": "AOR", + "orig": "+", + "original": "contracts/C.sol", + "repl": "%" + }, + { + "col": 44, + "description": "LiteralValueReplacement", + "diff": "--- original\n+++ mutant\n@@ -15,8 +15,9 @@\n }\n \n contract C {\n+ /// LiteralValueReplacement(`1` |==> `0`) of: `address[] memory a = new address[](1);`\n function foo() external view returns (address[] memory) {\n- address[] memory a = new address[](1);\n+ address[] memory a = new address[](0);\n a[0] = msg.sender;\n return a;\n }\n", + "id": "9", + "line": 19, + "name": "mutants/9/contracts/C.sol", + "op": "LVR", + "orig": "1", + "original": "contracts/C.sol", + "repl": "0" + }, + { + "col": 44, + "description": "LiteralValueReplacement", + "diff": "--- original\n+++ mutant\n@@ -15,8 +15,9 @@\n }\n \n contract C {\n+ /// LiteralValueReplacement(`1` |==> `2`) of: `address[] memory a = new address[](1);`\n function foo() external view returns (address[] memory) {\n- address[] memory a = new address[](1);\n+ address[] memory a = new address[](2);\n a[0] = msg.sender;\n return a;\n }\n", + "id": "10", + "line": 19, + "name": "mutants/10/contracts/C.sol", + "op": "LVR", + "orig": "1", + "original": "contracts/C.sol", + "repl": "2" + }, + { + "col": 9, + "description": "StatementDeletion", + "diff": "--- original\n+++ mutant\n@@ -16,8 +16,9 @@\n \n contract C {\n function foo() external view returns (address[] memory) {\n+ /// StatementDeletion(`a[0] = msg.sender` |==> `assert(true)`) of: `a[0] = msg.sender;`\n address[] memory a = new address[](1);\n- a[0] = msg.sender;\n+ assert(true);\n return a;\n }\n \n", + "id": "11", + "line": 20, + "name": "mutants/11/contracts/C.sol", + "op": "STD", + "orig": "a[0] = msg.sender", + "original": "contracts/C.sol", + "repl": "assert(true)" + }, + { + "col": 11, + "description": "LiteralValueReplacement", + "diff": "--- original\n+++ mutant\n@@ -16,8 +16,9 @@\n \n contract C {\n function foo() external view returns (address[] memory) {\n+ /// LiteralValueReplacement(`0` |==> `1`) of: `a[0] = msg.sender;`\n address[] memory a = new address[](1);\n- a[0] = msg.sender;\n+ a[1] = msg.sender;\n return a;\n }\n \n", + "id": "12", + "line": 20, + "name": "mutants/12/contracts/C.sol", + "op": "LVR", + "orig": "0", + "original": "contracts/C.sol", + "repl": "1" + }, + { + "col": 9, + "description": "StatementDeletion", + "diff": "--- original\n+++ mutant\n@@ -17,8 +17,9 @@\n contract C {\n function foo() external view returns (address[] memory) {\n address[] memory a = new address[](1);\n+ /// StatementDeletion(`return a` |==> `assert(true)`) of: `return a;`\n a[0] = msg.sender;\n- return a;\n+ assert(true);\n }\n \n function get10PowerDecimals(uint8 decimals) public pure returns (uint256) {\n", + "id": "13", + "line": 21, + "name": "mutants/13/contracts/C.sol", + "op": "STD", + "orig": "return a", + "original": "contracts/C.sol", + "repl": "assert(true)" + }, + { + "col": 21, + "description": "LiteralValueReplacement", + "diff": "--- original\n+++ mutant\n@@ -21,8 +21,9 @@\n return a;\n }\n \n+ /// LiteralValueReplacement(`10` |==> `0`) of: `uint256 a = 10;`\n function get10PowerDecimals(uint8 decimals) public pure returns (uint256) {\n- uint256 a = 10;\n+ uint256 a = 0;\n uint256 res = a ** decimals;\n return res;\n }\n", + "id": "14", + "line": 25, + "name": "mutants/14/contracts/C.sol", + "op": "LVR", + "orig": "10", + "original": "contracts/C.sol", + "repl": "0" + }, + { + "col": 21, + "description": "LiteralValueReplacement", + "diff": "--- original\n+++ mutant\n@@ -21,8 +21,9 @@\n return a;\n }\n \n+ /// LiteralValueReplacement(`10` |==> `11`) of: `uint256 a = 10;`\n function get10PowerDecimals(uint8 decimals) public pure returns (uint256) {\n- uint256 a = 10;\n+ uint256 a = 11;\n uint256 res = a ** decimals;\n return res;\n }\n", + "id": "15", + "line": 25, + "name": "mutants/15/contracts/C.sol", + "op": "LVR", + "orig": "10", + "original": "contracts/C.sol", + "repl": "11" + }, + { + "col": 25, + "description": "ArithmeticOperatorReplacement", + "diff": "--- original\n+++ mutant\n@@ -22,8 +22,9 @@\n }\n \n function get10PowerDecimals(uint8 decimals) public pure returns (uint256) {\n+ /// ArithmeticOperatorReplacement(`**` |==> `+`) of: `uint256 res = a ** decimals;`\n uint256 a = 10;\n- uint256 res = a ** decimals;\n+ uint256 res = a + decimals;\n return res;\n }\n \n", + "id": "16", + "line": 26, + "name": "mutants/16/contracts/C.sol", + "op": "AOR", + "orig": "**", + "original": "contracts/C.sol", + "repl": "+" + }, + { + "col": 25, + "description": "ArithmeticOperatorReplacement", + "diff": "--- original\n+++ mutant\n@@ -22,8 +22,9 @@\n }\n \n function get10PowerDecimals(uint8 decimals) public pure returns (uint256) {\n+ /// ArithmeticOperatorReplacement(`**` |==> `-`) of: `uint256 res = a ** decimals;`\n uint256 a = 10;\n- uint256 res = a ** decimals;\n+ uint256 res = a - decimals;\n return res;\n }\n \n", + "id": "17", + "line": 26, + "name": "mutants/17/contracts/C.sol", + "op": "AOR", + "orig": "**", + "original": "contracts/C.sol", + "repl": "-" + }, + { + "col": 25, + "description": "ArithmeticOperatorReplacement", + "diff": "--- original\n+++ mutant\n@@ -22,8 +22,9 @@\n }\n \n function get10PowerDecimals(uint8 decimals) public pure returns (uint256) {\n+ /// ArithmeticOperatorReplacement(`**` |==> `*`) of: `uint256 res = a ** decimals;`\n uint256 a = 10;\n- uint256 res = a ** decimals;\n+ uint256 res = a * decimals;\n return res;\n }\n \n", + "id": "18", + "line": 26, + "name": "mutants/18/contracts/C.sol", + "op": "AOR", + "orig": "**", + "original": "contracts/C.sol", + "repl": "*" + }, + { + "col": 25, + "description": "ArithmeticOperatorReplacement", + "diff": "--- original\n+++ mutant\n@@ -22,8 +22,9 @@\n }\n \n function get10PowerDecimals(uint8 decimals) public pure returns (uint256) {\n+ /// ArithmeticOperatorReplacement(`**` |==> `/`) of: `uint256 res = a ** decimals;`\n uint256 a = 10;\n- uint256 res = a ** decimals;\n+ uint256 res = a / decimals;\n return res;\n }\n \n", + "id": "19", + "line": 26, + "name": "mutants/19/contracts/C.sol", + "op": "AOR", + "orig": "**", + "original": "contracts/C.sol", + "repl": "/" + }, + { + "col": 25, + "description": "ArithmeticOperatorReplacement", + "diff": "--- original\n+++ mutant\n@@ -22,8 +22,9 @@\n }\n \n function get10PowerDecimals(uint8 decimals) public pure returns (uint256) {\n+ /// ArithmeticOperatorReplacement(`**` |==> `%`) of: `uint256 res = a ** decimals;`\n uint256 a = 10;\n- uint256 res = a ** decimals;\n+ uint256 res = a % decimals;\n return res;\n }\n \n", + "id": "20", + "line": 26, + "name": "mutants/20/contracts/C.sol", + "op": "AOR", + "orig": "**", + "original": "contracts/C.sol", + "repl": "%" + }, + { + "col": 9, + "description": "StatementDeletion", + "diff": "--- original\n+++ mutant\n@@ -23,8 +23,9 @@\n \n function get10PowerDecimals(uint8 decimals) public pure returns (uint256) {\n uint256 a = 10;\n+ /// StatementDeletion(`return res` |==> `assert(true)`) of: `return res;`\n uint256 res = a ** decimals;\n- return res;\n+ assert(true);\n }\n \n function getarray(address[] memory c, address e) public pure {\n", + "id": "21", + "line": 27, + "name": "mutants/21/contracts/C.sol", + "op": "STD", + "orig": "return res", + "original": "contracts/C.sol", + "repl": "assert(true)" + }, + { + "col": 9, + "description": "StatementDeletion", + "diff": "--- original\n+++ mutant\n@@ -27,8 +27,9 @@\n return res;\n }\n \n+ /// StatementDeletion(`assert(c[0] == e)` |==> `assert(true)`) of: `assert(c[0] == e);`\n function getarray(address[] memory c, address e) public pure {\n- assert(c[0] == e);\n+ assert(true);\n }\n \n function callmyself() external view {\n", + "id": "22", + "line": 31, + "name": "mutants/22/contracts/C.sol", + "op": "STD", + "orig": "assert(c[0] == e)", + "original": "contracts/C.sol", + "repl": "assert(true)" + }, + { + "col": 16, + "description": "RelationalOperatorReplacement", + "diff": "--- original\n+++ mutant\n@@ -27,8 +27,9 @@\n return res;\n }\n \n+ /// RelationalOperatorReplacement(`c[0] == e` |==> `false`) of: `assert(c[0] == e);`\n function getarray(address[] memory c, address e) public pure {\n- assert(c[0] == e);\n+ assert(false);\n }\n \n function callmyself() external view {\n", + "id": "23", + "line": 31, + "name": "mutants/23/contracts/C.sol", + "op": "ROR", + "orig": "c[0] == e", + "original": "contracts/C.sol", + "repl": "false" + }, + { + "col": 18, + "description": "LiteralValueReplacement", + "diff": "--- original\n+++ mutant\n@@ -27,8 +27,9 @@\n return res;\n }\n \n+ /// LiteralValueReplacement(`0` |==> `1`) of: `assert(c[0] == e);`\n function getarray(address[] memory c, address e) public pure {\n- assert(c[0] == e);\n+ assert(c[1] == e);\n }\n \n function callmyself() external view {\n", + "id": "24", + "line": 31, + "name": "mutants/24/contracts/C.sol", + "op": "LVR", + "orig": "0", + "original": "contracts/C.sol", + "repl": "1" + }, + { + "col": 9, + "description": "StatementDeletion", + "diff": "--- original\n+++ mutant\n@@ -32,8 +32,9 @@\n }\n \n function callmyself() external view {\n+ /// StatementDeletion(`Utils.getarray(b, address(this))` |==> `assert(true)`) of: `Utils.getarray(b, address(this));`\n address[] memory b = this.foo();\n- Utils.getarray(b, address(this));\n+ assert(true);\n }\n \n function add(int8 c, int8 d) public pure returns (int8) {\n", + "id": "25", + "line": 36, + "name": "mutants/25/contracts/C.sol", + "op": "STD", + "orig": "Utils.getarray(b, address(this))", + "original": "contracts/C.sol", + "repl": "assert(true)" + }, + { + "col": 9, + "description": "StatementDeletion", + "diff": "--- original\n+++ mutant\n@@ -36,7 +36,8 @@\n Utils.getarray(b, address(this));\n }\n \n+ /// StatementDeletion(`return c + d` |==> `assert(true)`) of: `return c + d;`\n function add(int8 c, int8 d) public pure returns (int8) {\n- return c + d;\n+ assert(true);\n }\n }\n", + "id": "26", + "line": 40, + "name": "mutants/26/contracts/C.sol", + "op": "STD", + "orig": "return c + d", + "original": "contracts/C.sol", + "repl": "assert(true)" + }, + { + "col": 18, + "description": "ArithmeticOperatorReplacement", + "diff": "--- original\n+++ mutant\n@@ -36,7 +36,8 @@\n Utils.getarray(b, address(this));\n }\n \n+ /// ArithmeticOperatorReplacement(`+` |==> `-`) of: `return c + d;`\n function add(int8 c, int8 d) public pure returns (int8) {\n- return c + d;\n+ return c - d;\n }\n }\n", + "id": "27", + "line": 40, + "name": "mutants/27/contracts/C.sol", + "op": "AOR", + "orig": "+", + "original": "contracts/C.sol", + "repl": "-" + }, + { + "col": 18, + "description": "ArithmeticOperatorReplacement", + "diff": "--- original\n+++ mutant\n@@ -36,7 +36,8 @@\n Utils.getarray(b, address(this));\n }\n \n+ /// ArithmeticOperatorReplacement(`+` |==> `*`) of: `return c + d;`\n function add(int8 c, int8 d) public pure returns (int8) {\n- return c + d;\n+ return c * d;\n }\n }\n", + "id": "28", + "line": 40, + "name": "mutants/28/contracts/C.sol", + "op": "AOR", + "orig": "+", + "original": "contracts/C.sol", + "repl": "*" + }, + { + "col": 18, + "description": "ArithmeticOperatorReplacement", + "diff": "--- original\n+++ mutant\n@@ -36,7 +36,8 @@\n Utils.getarray(b, address(this));\n }\n \n+ /// ArithmeticOperatorReplacement(`+` |==> `/`) of: `return c + d;`\n function add(int8 c, int8 d) public pure returns (int8) {\n- return c + d;\n+ return c / d;\n }\n }\n", + "id": "29", + "line": 40, + "name": "mutants/29/contracts/C.sol", + "op": "AOR", + "orig": "+", + "original": "contracts/C.sol", + "repl": "/" + }, + { + "col": 18, + "description": "ArithmeticOperatorReplacement", + "diff": "--- original\n+++ mutant\n@@ -36,7 +36,8 @@\n Utils.getarray(b, address(this));\n }\n \n+ /// ArithmeticOperatorReplacement(`+` |==> `%`) of: `return c + d;`\n function add(int8 c, int8 d) public pure returns (int8) {\n- return c + d;\n+ return c % d;\n }\n }\n", + "id": "30", + "line": 40, + "name": "mutants/30/contracts/C.sol", + "op": "AOR", + "orig": "+", + "original": "contracts/C.sol", + "repl": "%" + } +] \ No newline at end of file diff --git a/resources/regressions/no_import_path.json/mutants.log b/resources/regressions/no_import_path.json/mutants.log new file mode 100644 index 0000000..de5c3a2 --- /dev/null +++ b/resources/regressions/no_import_path.json/mutants.log @@ -0,0 +1,30 @@ +1,STD,contracts/C.sol,9:9,assert(c[0] == e),assert(true) +2,ROR,contracts/C.sol,9:16,c[0] == e,false +3,LVR,contracts/C.sol,9:18,0,1 +4,STD,contracts/C.sol,13:9,return a + b,assert(true) +5,AOR,contracts/C.sol,13:18,+,- +6,AOR,contracts/C.sol,13:18,+,* +7,AOR,contracts/C.sol,13:18,+,/ +8,AOR,contracts/C.sol,13:18,+,% +9,LVR,contracts/C.sol,19:44,1,0 +10,LVR,contracts/C.sol,19:44,1,2 +11,STD,contracts/C.sol,20:9,a[0] = msg.sender,assert(true) +12,LVR,contracts/C.sol,20:11,0,1 +13,STD,contracts/C.sol,21:9,return a,assert(true) +14,LVR,contracts/C.sol,25:21,10,0 +15,LVR,contracts/C.sol,25:21,10,11 +16,AOR,contracts/C.sol,26:25,**,+ +17,AOR,contracts/C.sol,26:25,**,- +18,AOR,contracts/C.sol,26:25,**,* +19,AOR,contracts/C.sol,26:25,**,/ +20,AOR,contracts/C.sol,26:25,**,% +21,STD,contracts/C.sol,27:9,return res,assert(true) +22,STD,contracts/C.sol,31:9,assert(c[0] == e),assert(true) +23,ROR,contracts/C.sol,31:16,c[0] == e,false +24,LVR,contracts/C.sol,31:18,0,1 +25,STD,contracts/C.sol,36:9,"Utils.getarray(b, address(this))",assert(true) +26,STD,contracts/C.sol,40:9,return c + d,assert(true) +27,AOR,contracts/C.sol,40:18,+,- +28,AOR,contracts/C.sol,40:18,+,* +29,AOR,contracts/C.sol,40:18,+,/ +30,AOR,contracts/C.sol,40:18,+,% diff --git a/resources/regressions/no_import_path.json/mutants/1/contracts/C.sol b/resources/regressions/no_import_path.json/mutants/1/contracts/C.sol new file mode 100644 index 0000000..53921f1 --- /dev/null +++ b/resources/regressions/no_import_path.json/mutants/1/contracts/C.sol @@ -0,0 +1,43 @@ +// SPDX-License-Identifier: GPL-3.0-only + +pragma solidity ^0.8.13; + +import "contracts/Imported.sol"; + +library Utils { + /// StatementDeletion(`assert(c[0] == e)` |==> `assert(true)`) of: `assert(c[0] == e);` + function getarray(address[] memory c, address e) internal pure { + assert(true); + } + + function add(int8 a, int8 b) public pure returns (int8) { + return a + b; + } +} + +contract C { + function foo() external view returns (address[] memory) { + address[] memory a = new address[](1); + a[0] = msg.sender; + return a; + } + + function get10PowerDecimals(uint8 decimals) public pure returns (uint256) { + uint256 a = 10; + uint256 res = a ** decimals; + return res; + } + + function getarray(address[] memory c, address e) public pure { + assert(c[0] == e); + } + + function callmyself() external view { + address[] memory b = this.foo(); + Utils.getarray(b, address(this)); + } + + function add(int8 c, int8 d) public pure returns (int8) { + return c + d; + } +} diff --git a/resources/regressions/no_import_path.json/mutants/10/contracts/C.sol b/resources/regressions/no_import_path.json/mutants/10/contracts/C.sol new file mode 100644 index 0000000..eab6041 --- /dev/null +++ b/resources/regressions/no_import_path.json/mutants/10/contracts/C.sol @@ -0,0 +1,43 @@ +// SPDX-License-Identifier: GPL-3.0-only + +pragma solidity ^0.8.13; + +import "contracts/Imported.sol"; + +library Utils { + function getarray(address[] memory c, address e) internal pure { + assert(c[0] == e); + } + + function add(int8 a, int8 b) public pure returns (int8) { + return a + b; + } +} + +contract C { + /// LiteralValueReplacement(`1` |==> `2`) of: `address[] memory a = new address[](1);` + function foo() external view returns (address[] memory) { + address[] memory a = new address[](2); + a[0] = msg.sender; + return a; + } + + function get10PowerDecimals(uint8 decimals) public pure returns (uint256) { + uint256 a = 10; + uint256 res = a ** decimals; + return res; + } + + function getarray(address[] memory c, address e) public pure { + assert(c[0] == e); + } + + function callmyself() external view { + address[] memory b = this.foo(); + Utils.getarray(b, address(this)); + } + + function add(int8 c, int8 d) public pure returns (int8) { + return c + d; + } +} diff --git a/resources/regressions/no_import_path.json/mutants/11/contracts/C.sol b/resources/regressions/no_import_path.json/mutants/11/contracts/C.sol new file mode 100644 index 0000000..c112a1f --- /dev/null +++ b/resources/regressions/no_import_path.json/mutants/11/contracts/C.sol @@ -0,0 +1,43 @@ +// SPDX-License-Identifier: GPL-3.0-only + +pragma solidity ^0.8.13; + +import "contracts/Imported.sol"; + +library Utils { + function getarray(address[] memory c, address e) internal pure { + assert(c[0] == e); + } + + function add(int8 a, int8 b) public pure returns (int8) { + return a + b; + } +} + +contract C { + function foo() external view returns (address[] memory) { + /// StatementDeletion(`a[0] = msg.sender` |==> `assert(true)`) of: `a[0] = msg.sender;` + address[] memory a = new address[](1); + assert(true); + return a; + } + + function get10PowerDecimals(uint8 decimals) public pure returns (uint256) { + uint256 a = 10; + uint256 res = a ** decimals; + return res; + } + + function getarray(address[] memory c, address e) public pure { + assert(c[0] == e); + } + + function callmyself() external view { + address[] memory b = this.foo(); + Utils.getarray(b, address(this)); + } + + function add(int8 c, int8 d) public pure returns (int8) { + return c + d; + } +} diff --git a/resources/regressions/no_import_path.json/mutants/12/contracts/C.sol b/resources/regressions/no_import_path.json/mutants/12/contracts/C.sol new file mode 100644 index 0000000..97b84a0 --- /dev/null +++ b/resources/regressions/no_import_path.json/mutants/12/contracts/C.sol @@ -0,0 +1,43 @@ +// SPDX-License-Identifier: GPL-3.0-only + +pragma solidity ^0.8.13; + +import "contracts/Imported.sol"; + +library Utils { + function getarray(address[] memory c, address e) internal pure { + assert(c[0] == e); + } + + function add(int8 a, int8 b) public pure returns (int8) { + return a + b; + } +} + +contract C { + function foo() external view returns (address[] memory) { + /// LiteralValueReplacement(`0` |==> `1`) of: `a[0] = msg.sender;` + address[] memory a = new address[](1); + a[1] = msg.sender; + return a; + } + + function get10PowerDecimals(uint8 decimals) public pure returns (uint256) { + uint256 a = 10; + uint256 res = a ** decimals; + return res; + } + + function getarray(address[] memory c, address e) public pure { + assert(c[0] == e); + } + + function callmyself() external view { + address[] memory b = this.foo(); + Utils.getarray(b, address(this)); + } + + function add(int8 c, int8 d) public pure returns (int8) { + return c + d; + } +} diff --git a/resources/regressions/no_import_path.json/mutants/13/contracts/C.sol b/resources/regressions/no_import_path.json/mutants/13/contracts/C.sol new file mode 100644 index 0000000..8321873 --- /dev/null +++ b/resources/regressions/no_import_path.json/mutants/13/contracts/C.sol @@ -0,0 +1,43 @@ +// SPDX-License-Identifier: GPL-3.0-only + +pragma solidity ^0.8.13; + +import "contracts/Imported.sol"; + +library Utils { + function getarray(address[] memory c, address e) internal pure { + assert(c[0] == e); + } + + function add(int8 a, int8 b) public pure returns (int8) { + return a + b; + } +} + +contract C { + function foo() external view returns (address[] memory) { + address[] memory a = new address[](1); + /// StatementDeletion(`return a` |==> `assert(true)`) of: `return a;` + a[0] = msg.sender; + assert(true); + } + + function get10PowerDecimals(uint8 decimals) public pure returns (uint256) { + uint256 a = 10; + uint256 res = a ** decimals; + return res; + } + + function getarray(address[] memory c, address e) public pure { + assert(c[0] == e); + } + + function callmyself() external view { + address[] memory b = this.foo(); + Utils.getarray(b, address(this)); + } + + function add(int8 c, int8 d) public pure returns (int8) { + return c + d; + } +} diff --git a/resources/regressions/no_import_path.json/mutants/14/contracts/C.sol b/resources/regressions/no_import_path.json/mutants/14/contracts/C.sol new file mode 100644 index 0000000..60a4db1 --- /dev/null +++ b/resources/regressions/no_import_path.json/mutants/14/contracts/C.sol @@ -0,0 +1,43 @@ +// SPDX-License-Identifier: GPL-3.0-only + +pragma solidity ^0.8.13; + +import "contracts/Imported.sol"; + +library Utils { + function getarray(address[] memory c, address e) internal pure { + assert(c[0] == e); + } + + function add(int8 a, int8 b) public pure returns (int8) { + return a + b; + } +} + +contract C { + function foo() external view returns (address[] memory) { + address[] memory a = new address[](1); + a[0] = msg.sender; + return a; + } + + /// LiteralValueReplacement(`10` |==> `0`) of: `uint256 a = 10;` + function get10PowerDecimals(uint8 decimals) public pure returns (uint256) { + uint256 a = 0; + uint256 res = a ** decimals; + return res; + } + + function getarray(address[] memory c, address e) public pure { + assert(c[0] == e); + } + + function callmyself() external view { + address[] memory b = this.foo(); + Utils.getarray(b, address(this)); + } + + function add(int8 c, int8 d) public pure returns (int8) { + return c + d; + } +} diff --git a/resources/regressions/no_import_path.json/mutants/15/contracts/C.sol b/resources/regressions/no_import_path.json/mutants/15/contracts/C.sol new file mode 100644 index 0000000..2567941 --- /dev/null +++ b/resources/regressions/no_import_path.json/mutants/15/contracts/C.sol @@ -0,0 +1,43 @@ +// SPDX-License-Identifier: GPL-3.0-only + +pragma solidity ^0.8.13; + +import "contracts/Imported.sol"; + +library Utils { + function getarray(address[] memory c, address e) internal pure { + assert(c[0] == e); + } + + function add(int8 a, int8 b) public pure returns (int8) { + return a + b; + } +} + +contract C { + function foo() external view returns (address[] memory) { + address[] memory a = new address[](1); + a[0] = msg.sender; + return a; + } + + /// LiteralValueReplacement(`10` |==> `11`) of: `uint256 a = 10;` + function get10PowerDecimals(uint8 decimals) public pure returns (uint256) { + uint256 a = 11; + uint256 res = a ** decimals; + return res; + } + + function getarray(address[] memory c, address e) public pure { + assert(c[0] == e); + } + + function callmyself() external view { + address[] memory b = this.foo(); + Utils.getarray(b, address(this)); + } + + function add(int8 c, int8 d) public pure returns (int8) { + return c + d; + } +} diff --git a/resources/regressions/no_import_path.json/mutants/16/contracts/C.sol b/resources/regressions/no_import_path.json/mutants/16/contracts/C.sol new file mode 100644 index 0000000..3e40995 --- /dev/null +++ b/resources/regressions/no_import_path.json/mutants/16/contracts/C.sol @@ -0,0 +1,43 @@ +// SPDX-License-Identifier: GPL-3.0-only + +pragma solidity ^0.8.13; + +import "contracts/Imported.sol"; + +library Utils { + function getarray(address[] memory c, address e) internal pure { + assert(c[0] == e); + } + + function add(int8 a, int8 b) public pure returns (int8) { + return a + b; + } +} + +contract C { + function foo() external view returns (address[] memory) { + address[] memory a = new address[](1); + a[0] = msg.sender; + return a; + } + + function get10PowerDecimals(uint8 decimals) public pure returns (uint256) { + /// ArithmeticOperatorReplacement(`**` |==> `+`) of: `uint256 res = a ** decimals;` + uint256 a = 10; + uint256 res = a + decimals; + return res; + } + + function getarray(address[] memory c, address e) public pure { + assert(c[0] == e); + } + + function callmyself() external view { + address[] memory b = this.foo(); + Utils.getarray(b, address(this)); + } + + function add(int8 c, int8 d) public pure returns (int8) { + return c + d; + } +} diff --git a/resources/regressions/no_import_path.json/mutants/17/contracts/C.sol b/resources/regressions/no_import_path.json/mutants/17/contracts/C.sol new file mode 100644 index 0000000..71f2d2c --- /dev/null +++ b/resources/regressions/no_import_path.json/mutants/17/contracts/C.sol @@ -0,0 +1,43 @@ +// SPDX-License-Identifier: GPL-3.0-only + +pragma solidity ^0.8.13; + +import "contracts/Imported.sol"; + +library Utils { + function getarray(address[] memory c, address e) internal pure { + assert(c[0] == e); + } + + function add(int8 a, int8 b) public pure returns (int8) { + return a + b; + } +} + +contract C { + function foo() external view returns (address[] memory) { + address[] memory a = new address[](1); + a[0] = msg.sender; + return a; + } + + function get10PowerDecimals(uint8 decimals) public pure returns (uint256) { + /// ArithmeticOperatorReplacement(`**` |==> `-`) of: `uint256 res = a ** decimals;` + uint256 a = 10; + uint256 res = a - decimals; + return res; + } + + function getarray(address[] memory c, address e) public pure { + assert(c[0] == e); + } + + function callmyself() external view { + address[] memory b = this.foo(); + Utils.getarray(b, address(this)); + } + + function add(int8 c, int8 d) public pure returns (int8) { + return c + d; + } +} diff --git a/resources/regressions/no_import_path.json/mutants/18/contracts/C.sol b/resources/regressions/no_import_path.json/mutants/18/contracts/C.sol new file mode 100644 index 0000000..43c3a73 --- /dev/null +++ b/resources/regressions/no_import_path.json/mutants/18/contracts/C.sol @@ -0,0 +1,43 @@ +// SPDX-License-Identifier: GPL-3.0-only + +pragma solidity ^0.8.13; + +import "contracts/Imported.sol"; + +library Utils { + function getarray(address[] memory c, address e) internal pure { + assert(c[0] == e); + } + + function add(int8 a, int8 b) public pure returns (int8) { + return a + b; + } +} + +contract C { + function foo() external view returns (address[] memory) { + address[] memory a = new address[](1); + a[0] = msg.sender; + return a; + } + + function get10PowerDecimals(uint8 decimals) public pure returns (uint256) { + /// ArithmeticOperatorReplacement(`**` |==> `*`) of: `uint256 res = a ** decimals;` + uint256 a = 10; + uint256 res = a * decimals; + return res; + } + + function getarray(address[] memory c, address e) public pure { + assert(c[0] == e); + } + + function callmyself() external view { + address[] memory b = this.foo(); + Utils.getarray(b, address(this)); + } + + function add(int8 c, int8 d) public pure returns (int8) { + return c + d; + } +} diff --git a/resources/regressions/no_import_path.json/mutants/19/contracts/C.sol b/resources/regressions/no_import_path.json/mutants/19/contracts/C.sol new file mode 100644 index 0000000..697ef1c --- /dev/null +++ b/resources/regressions/no_import_path.json/mutants/19/contracts/C.sol @@ -0,0 +1,43 @@ +// SPDX-License-Identifier: GPL-3.0-only + +pragma solidity ^0.8.13; + +import "contracts/Imported.sol"; + +library Utils { + function getarray(address[] memory c, address e) internal pure { + assert(c[0] == e); + } + + function add(int8 a, int8 b) public pure returns (int8) { + return a + b; + } +} + +contract C { + function foo() external view returns (address[] memory) { + address[] memory a = new address[](1); + a[0] = msg.sender; + return a; + } + + function get10PowerDecimals(uint8 decimals) public pure returns (uint256) { + /// ArithmeticOperatorReplacement(`**` |==> `/`) of: `uint256 res = a ** decimals;` + uint256 a = 10; + uint256 res = a / decimals; + return res; + } + + function getarray(address[] memory c, address e) public pure { + assert(c[0] == e); + } + + function callmyself() external view { + address[] memory b = this.foo(); + Utils.getarray(b, address(this)); + } + + function add(int8 c, int8 d) public pure returns (int8) { + return c + d; + } +} diff --git a/resources/regressions/no_import_path.json/mutants/2/contracts/C.sol b/resources/regressions/no_import_path.json/mutants/2/contracts/C.sol new file mode 100644 index 0000000..9b4e8ff --- /dev/null +++ b/resources/regressions/no_import_path.json/mutants/2/contracts/C.sol @@ -0,0 +1,43 @@ +// SPDX-License-Identifier: GPL-3.0-only + +pragma solidity ^0.8.13; + +import "contracts/Imported.sol"; + +library Utils { + /// RelationalOperatorReplacement(`c[0] == e` |==> `false`) of: `assert(c[0] == e);` + function getarray(address[] memory c, address e) internal pure { + assert(false); + } + + function add(int8 a, int8 b) public pure returns (int8) { + return a + b; + } +} + +contract C { + function foo() external view returns (address[] memory) { + address[] memory a = new address[](1); + a[0] = msg.sender; + return a; + } + + function get10PowerDecimals(uint8 decimals) public pure returns (uint256) { + uint256 a = 10; + uint256 res = a ** decimals; + return res; + } + + function getarray(address[] memory c, address e) public pure { + assert(c[0] == e); + } + + function callmyself() external view { + address[] memory b = this.foo(); + Utils.getarray(b, address(this)); + } + + function add(int8 c, int8 d) public pure returns (int8) { + return c + d; + } +} diff --git a/resources/regressions/no_import_path.json/mutants/20/contracts/C.sol b/resources/regressions/no_import_path.json/mutants/20/contracts/C.sol new file mode 100644 index 0000000..cdaa331 --- /dev/null +++ b/resources/regressions/no_import_path.json/mutants/20/contracts/C.sol @@ -0,0 +1,43 @@ +// SPDX-License-Identifier: GPL-3.0-only + +pragma solidity ^0.8.13; + +import "contracts/Imported.sol"; + +library Utils { + function getarray(address[] memory c, address e) internal pure { + assert(c[0] == e); + } + + function add(int8 a, int8 b) public pure returns (int8) { + return a + b; + } +} + +contract C { + function foo() external view returns (address[] memory) { + address[] memory a = new address[](1); + a[0] = msg.sender; + return a; + } + + function get10PowerDecimals(uint8 decimals) public pure returns (uint256) { + /// ArithmeticOperatorReplacement(`**` |==> `%`) of: `uint256 res = a ** decimals;` + uint256 a = 10; + uint256 res = a % decimals; + return res; + } + + function getarray(address[] memory c, address e) public pure { + assert(c[0] == e); + } + + function callmyself() external view { + address[] memory b = this.foo(); + Utils.getarray(b, address(this)); + } + + function add(int8 c, int8 d) public pure returns (int8) { + return c + d; + } +} diff --git a/resources/regressions/no_import_path.json/mutants/21/contracts/C.sol b/resources/regressions/no_import_path.json/mutants/21/contracts/C.sol new file mode 100644 index 0000000..ca8a4da --- /dev/null +++ b/resources/regressions/no_import_path.json/mutants/21/contracts/C.sol @@ -0,0 +1,43 @@ +// SPDX-License-Identifier: GPL-3.0-only + +pragma solidity ^0.8.13; + +import "contracts/Imported.sol"; + +library Utils { + function getarray(address[] memory c, address e) internal pure { + assert(c[0] == e); + } + + function add(int8 a, int8 b) public pure returns (int8) { + return a + b; + } +} + +contract C { + function foo() external view returns (address[] memory) { + address[] memory a = new address[](1); + a[0] = msg.sender; + return a; + } + + function get10PowerDecimals(uint8 decimals) public pure returns (uint256) { + uint256 a = 10; + /// StatementDeletion(`return res` |==> `assert(true)`) of: `return res;` + uint256 res = a ** decimals; + assert(true); + } + + function getarray(address[] memory c, address e) public pure { + assert(c[0] == e); + } + + function callmyself() external view { + address[] memory b = this.foo(); + Utils.getarray(b, address(this)); + } + + function add(int8 c, int8 d) public pure returns (int8) { + return c + d; + } +} diff --git a/resources/regressions/no_import_path.json/mutants/22/contracts/C.sol b/resources/regressions/no_import_path.json/mutants/22/contracts/C.sol new file mode 100644 index 0000000..3fe88f1 --- /dev/null +++ b/resources/regressions/no_import_path.json/mutants/22/contracts/C.sol @@ -0,0 +1,43 @@ +// SPDX-License-Identifier: GPL-3.0-only + +pragma solidity ^0.8.13; + +import "contracts/Imported.sol"; + +library Utils { + function getarray(address[] memory c, address e) internal pure { + assert(c[0] == e); + } + + function add(int8 a, int8 b) public pure returns (int8) { + return a + b; + } +} + +contract C { + function foo() external view returns (address[] memory) { + address[] memory a = new address[](1); + a[0] = msg.sender; + return a; + } + + function get10PowerDecimals(uint8 decimals) public pure returns (uint256) { + uint256 a = 10; + uint256 res = a ** decimals; + return res; + } + + /// StatementDeletion(`assert(c[0] == e)` |==> `assert(true)`) of: `assert(c[0] == e);` + function getarray(address[] memory c, address e) public pure { + assert(true); + } + + function callmyself() external view { + address[] memory b = this.foo(); + Utils.getarray(b, address(this)); + } + + function add(int8 c, int8 d) public pure returns (int8) { + return c + d; + } +} diff --git a/resources/regressions/no_import_path.json/mutants/23/contracts/C.sol b/resources/regressions/no_import_path.json/mutants/23/contracts/C.sol new file mode 100644 index 0000000..3767f98 --- /dev/null +++ b/resources/regressions/no_import_path.json/mutants/23/contracts/C.sol @@ -0,0 +1,43 @@ +// SPDX-License-Identifier: GPL-3.0-only + +pragma solidity ^0.8.13; + +import "contracts/Imported.sol"; + +library Utils { + function getarray(address[] memory c, address e) internal pure { + assert(c[0] == e); + } + + function add(int8 a, int8 b) public pure returns (int8) { + return a + b; + } +} + +contract C { + function foo() external view returns (address[] memory) { + address[] memory a = new address[](1); + a[0] = msg.sender; + return a; + } + + function get10PowerDecimals(uint8 decimals) public pure returns (uint256) { + uint256 a = 10; + uint256 res = a ** decimals; + return res; + } + + /// RelationalOperatorReplacement(`c[0] == e` |==> `false`) of: `assert(c[0] == e);` + function getarray(address[] memory c, address e) public pure { + assert(false); + } + + function callmyself() external view { + address[] memory b = this.foo(); + Utils.getarray(b, address(this)); + } + + function add(int8 c, int8 d) public pure returns (int8) { + return c + d; + } +} diff --git a/resources/regressions/no_import_path.json/mutants/24/contracts/C.sol b/resources/regressions/no_import_path.json/mutants/24/contracts/C.sol new file mode 100644 index 0000000..63ab601 --- /dev/null +++ b/resources/regressions/no_import_path.json/mutants/24/contracts/C.sol @@ -0,0 +1,43 @@ +// SPDX-License-Identifier: GPL-3.0-only + +pragma solidity ^0.8.13; + +import "contracts/Imported.sol"; + +library Utils { + function getarray(address[] memory c, address e) internal pure { + assert(c[0] == e); + } + + function add(int8 a, int8 b) public pure returns (int8) { + return a + b; + } +} + +contract C { + function foo() external view returns (address[] memory) { + address[] memory a = new address[](1); + a[0] = msg.sender; + return a; + } + + function get10PowerDecimals(uint8 decimals) public pure returns (uint256) { + uint256 a = 10; + uint256 res = a ** decimals; + return res; + } + + /// LiteralValueReplacement(`0` |==> `1`) of: `assert(c[0] == e);` + function getarray(address[] memory c, address e) public pure { + assert(c[1] == e); + } + + function callmyself() external view { + address[] memory b = this.foo(); + Utils.getarray(b, address(this)); + } + + function add(int8 c, int8 d) public pure returns (int8) { + return c + d; + } +} diff --git a/resources/regressions/no_import_path.json/mutants/25/contracts/C.sol b/resources/regressions/no_import_path.json/mutants/25/contracts/C.sol new file mode 100644 index 0000000..165e099 --- /dev/null +++ b/resources/regressions/no_import_path.json/mutants/25/contracts/C.sol @@ -0,0 +1,43 @@ +// SPDX-License-Identifier: GPL-3.0-only + +pragma solidity ^0.8.13; + +import "contracts/Imported.sol"; + +library Utils { + function getarray(address[] memory c, address e) internal pure { + assert(c[0] == e); + } + + function add(int8 a, int8 b) public pure returns (int8) { + return a + b; + } +} + +contract C { + function foo() external view returns (address[] memory) { + address[] memory a = new address[](1); + a[0] = msg.sender; + return a; + } + + function get10PowerDecimals(uint8 decimals) public pure returns (uint256) { + uint256 a = 10; + uint256 res = a ** decimals; + return res; + } + + function getarray(address[] memory c, address e) public pure { + assert(c[0] == e); + } + + function callmyself() external view { + /// StatementDeletion(`Utils.getarray(b, address(this))` |==> `assert(true)`) of: `Utils.getarray(b, address(this));` + address[] memory b = this.foo(); + assert(true); + } + + function add(int8 c, int8 d) public pure returns (int8) { + return c + d; + } +} diff --git a/resources/regressions/no_import_path.json/mutants/26/contracts/C.sol b/resources/regressions/no_import_path.json/mutants/26/contracts/C.sol new file mode 100644 index 0000000..1a619f4 --- /dev/null +++ b/resources/regressions/no_import_path.json/mutants/26/contracts/C.sol @@ -0,0 +1,43 @@ +// SPDX-License-Identifier: GPL-3.0-only + +pragma solidity ^0.8.13; + +import "contracts/Imported.sol"; + +library Utils { + function getarray(address[] memory c, address e) internal pure { + assert(c[0] == e); + } + + function add(int8 a, int8 b) public pure returns (int8) { + return a + b; + } +} + +contract C { + function foo() external view returns (address[] memory) { + address[] memory a = new address[](1); + a[0] = msg.sender; + return a; + } + + function get10PowerDecimals(uint8 decimals) public pure returns (uint256) { + uint256 a = 10; + uint256 res = a ** decimals; + return res; + } + + function getarray(address[] memory c, address e) public pure { + assert(c[0] == e); + } + + function callmyself() external view { + address[] memory b = this.foo(); + Utils.getarray(b, address(this)); + } + + /// StatementDeletion(`return c + d` |==> `assert(true)`) of: `return c + d;` + function add(int8 c, int8 d) public pure returns (int8) { + assert(true); + } +} diff --git a/resources/regressions/no_import_path.json/mutants/27/contracts/C.sol b/resources/regressions/no_import_path.json/mutants/27/contracts/C.sol new file mode 100644 index 0000000..a68b62f --- /dev/null +++ b/resources/regressions/no_import_path.json/mutants/27/contracts/C.sol @@ -0,0 +1,43 @@ +// SPDX-License-Identifier: GPL-3.0-only + +pragma solidity ^0.8.13; + +import "contracts/Imported.sol"; + +library Utils { + function getarray(address[] memory c, address e) internal pure { + assert(c[0] == e); + } + + function add(int8 a, int8 b) public pure returns (int8) { + return a + b; + } +} + +contract C { + function foo() external view returns (address[] memory) { + address[] memory a = new address[](1); + a[0] = msg.sender; + return a; + } + + function get10PowerDecimals(uint8 decimals) public pure returns (uint256) { + uint256 a = 10; + uint256 res = a ** decimals; + return res; + } + + function getarray(address[] memory c, address e) public pure { + assert(c[0] == e); + } + + function callmyself() external view { + address[] memory b = this.foo(); + Utils.getarray(b, address(this)); + } + + /// ArithmeticOperatorReplacement(`+` |==> `-`) of: `return c + d;` + function add(int8 c, int8 d) public pure returns (int8) { + return c - d; + } +} diff --git a/resources/regressions/no_import_path.json/mutants/28/contracts/C.sol b/resources/regressions/no_import_path.json/mutants/28/contracts/C.sol new file mode 100644 index 0000000..e909410 --- /dev/null +++ b/resources/regressions/no_import_path.json/mutants/28/contracts/C.sol @@ -0,0 +1,43 @@ +// SPDX-License-Identifier: GPL-3.0-only + +pragma solidity ^0.8.13; + +import "contracts/Imported.sol"; + +library Utils { + function getarray(address[] memory c, address e) internal pure { + assert(c[0] == e); + } + + function add(int8 a, int8 b) public pure returns (int8) { + return a + b; + } +} + +contract C { + function foo() external view returns (address[] memory) { + address[] memory a = new address[](1); + a[0] = msg.sender; + return a; + } + + function get10PowerDecimals(uint8 decimals) public pure returns (uint256) { + uint256 a = 10; + uint256 res = a ** decimals; + return res; + } + + function getarray(address[] memory c, address e) public pure { + assert(c[0] == e); + } + + function callmyself() external view { + address[] memory b = this.foo(); + Utils.getarray(b, address(this)); + } + + /// ArithmeticOperatorReplacement(`+` |==> `*`) of: `return c + d;` + function add(int8 c, int8 d) public pure returns (int8) { + return c * d; + } +} diff --git a/resources/regressions/no_import_path.json/mutants/29/contracts/C.sol b/resources/regressions/no_import_path.json/mutants/29/contracts/C.sol new file mode 100644 index 0000000..c884f37 --- /dev/null +++ b/resources/regressions/no_import_path.json/mutants/29/contracts/C.sol @@ -0,0 +1,43 @@ +// SPDX-License-Identifier: GPL-3.0-only + +pragma solidity ^0.8.13; + +import "contracts/Imported.sol"; + +library Utils { + function getarray(address[] memory c, address e) internal pure { + assert(c[0] == e); + } + + function add(int8 a, int8 b) public pure returns (int8) { + return a + b; + } +} + +contract C { + function foo() external view returns (address[] memory) { + address[] memory a = new address[](1); + a[0] = msg.sender; + return a; + } + + function get10PowerDecimals(uint8 decimals) public pure returns (uint256) { + uint256 a = 10; + uint256 res = a ** decimals; + return res; + } + + function getarray(address[] memory c, address e) public pure { + assert(c[0] == e); + } + + function callmyself() external view { + address[] memory b = this.foo(); + Utils.getarray(b, address(this)); + } + + /// ArithmeticOperatorReplacement(`+` |==> `/`) of: `return c + d;` + function add(int8 c, int8 d) public pure returns (int8) { + return c / d; + } +} diff --git a/resources/regressions/no_import_path.json/mutants/3/contracts/C.sol b/resources/regressions/no_import_path.json/mutants/3/contracts/C.sol new file mode 100644 index 0000000..25bd0cd --- /dev/null +++ b/resources/regressions/no_import_path.json/mutants/3/contracts/C.sol @@ -0,0 +1,43 @@ +// SPDX-License-Identifier: GPL-3.0-only + +pragma solidity ^0.8.13; + +import "contracts/Imported.sol"; + +library Utils { + /// LiteralValueReplacement(`0` |==> `1`) of: `assert(c[0] == e);` + function getarray(address[] memory c, address e) internal pure { + assert(c[1] == e); + } + + function add(int8 a, int8 b) public pure returns (int8) { + return a + b; + } +} + +contract C { + function foo() external view returns (address[] memory) { + address[] memory a = new address[](1); + a[0] = msg.sender; + return a; + } + + function get10PowerDecimals(uint8 decimals) public pure returns (uint256) { + uint256 a = 10; + uint256 res = a ** decimals; + return res; + } + + function getarray(address[] memory c, address e) public pure { + assert(c[0] == e); + } + + function callmyself() external view { + address[] memory b = this.foo(); + Utils.getarray(b, address(this)); + } + + function add(int8 c, int8 d) public pure returns (int8) { + return c + d; + } +} diff --git a/resources/regressions/no_import_path.json/mutants/30/contracts/C.sol b/resources/regressions/no_import_path.json/mutants/30/contracts/C.sol new file mode 100644 index 0000000..01a3dfd --- /dev/null +++ b/resources/regressions/no_import_path.json/mutants/30/contracts/C.sol @@ -0,0 +1,43 @@ +// SPDX-License-Identifier: GPL-3.0-only + +pragma solidity ^0.8.13; + +import "contracts/Imported.sol"; + +library Utils { + function getarray(address[] memory c, address e) internal pure { + assert(c[0] == e); + } + + function add(int8 a, int8 b) public pure returns (int8) { + return a + b; + } +} + +contract C { + function foo() external view returns (address[] memory) { + address[] memory a = new address[](1); + a[0] = msg.sender; + return a; + } + + function get10PowerDecimals(uint8 decimals) public pure returns (uint256) { + uint256 a = 10; + uint256 res = a ** decimals; + return res; + } + + function getarray(address[] memory c, address e) public pure { + assert(c[0] == e); + } + + function callmyself() external view { + address[] memory b = this.foo(); + Utils.getarray(b, address(this)); + } + + /// ArithmeticOperatorReplacement(`+` |==> `%`) of: `return c + d;` + function add(int8 c, int8 d) public pure returns (int8) { + return c % d; + } +} diff --git a/resources/regressions/no_import_path.json/mutants/4/contracts/C.sol b/resources/regressions/no_import_path.json/mutants/4/contracts/C.sol new file mode 100644 index 0000000..fd6e5b9 --- /dev/null +++ b/resources/regressions/no_import_path.json/mutants/4/contracts/C.sol @@ -0,0 +1,43 @@ +// SPDX-License-Identifier: GPL-3.0-only + +pragma solidity ^0.8.13; + +import "contracts/Imported.sol"; + +library Utils { + function getarray(address[] memory c, address e) internal pure { + assert(c[0] == e); + } + + /// StatementDeletion(`return a + b` |==> `assert(true)`) of: `return a + b;` + function add(int8 a, int8 b) public pure returns (int8) { + assert(true); + } +} + +contract C { + function foo() external view returns (address[] memory) { + address[] memory a = new address[](1); + a[0] = msg.sender; + return a; + } + + function get10PowerDecimals(uint8 decimals) public pure returns (uint256) { + uint256 a = 10; + uint256 res = a ** decimals; + return res; + } + + function getarray(address[] memory c, address e) public pure { + assert(c[0] == e); + } + + function callmyself() external view { + address[] memory b = this.foo(); + Utils.getarray(b, address(this)); + } + + function add(int8 c, int8 d) public pure returns (int8) { + return c + d; + } +} diff --git a/resources/regressions/no_import_path.json/mutants/5/contracts/C.sol b/resources/regressions/no_import_path.json/mutants/5/contracts/C.sol new file mode 100644 index 0000000..d9f773c --- /dev/null +++ b/resources/regressions/no_import_path.json/mutants/5/contracts/C.sol @@ -0,0 +1,43 @@ +// SPDX-License-Identifier: GPL-3.0-only + +pragma solidity ^0.8.13; + +import "contracts/Imported.sol"; + +library Utils { + function getarray(address[] memory c, address e) internal pure { + assert(c[0] == e); + } + + /// ArithmeticOperatorReplacement(`+` |==> `-`) of: `return a + b;` + function add(int8 a, int8 b) public pure returns (int8) { + return a - b; + } +} + +contract C { + function foo() external view returns (address[] memory) { + address[] memory a = new address[](1); + a[0] = msg.sender; + return a; + } + + function get10PowerDecimals(uint8 decimals) public pure returns (uint256) { + uint256 a = 10; + uint256 res = a ** decimals; + return res; + } + + function getarray(address[] memory c, address e) public pure { + assert(c[0] == e); + } + + function callmyself() external view { + address[] memory b = this.foo(); + Utils.getarray(b, address(this)); + } + + function add(int8 c, int8 d) public pure returns (int8) { + return c + d; + } +} diff --git a/resources/regressions/no_import_path.json/mutants/6/contracts/C.sol b/resources/regressions/no_import_path.json/mutants/6/contracts/C.sol new file mode 100644 index 0000000..5ca3a37 --- /dev/null +++ b/resources/regressions/no_import_path.json/mutants/6/contracts/C.sol @@ -0,0 +1,43 @@ +// SPDX-License-Identifier: GPL-3.0-only + +pragma solidity ^0.8.13; + +import "contracts/Imported.sol"; + +library Utils { + function getarray(address[] memory c, address e) internal pure { + assert(c[0] == e); + } + + /// ArithmeticOperatorReplacement(`+` |==> `*`) of: `return a + b;` + function add(int8 a, int8 b) public pure returns (int8) { + return a * b; + } +} + +contract C { + function foo() external view returns (address[] memory) { + address[] memory a = new address[](1); + a[0] = msg.sender; + return a; + } + + function get10PowerDecimals(uint8 decimals) public pure returns (uint256) { + uint256 a = 10; + uint256 res = a ** decimals; + return res; + } + + function getarray(address[] memory c, address e) public pure { + assert(c[0] == e); + } + + function callmyself() external view { + address[] memory b = this.foo(); + Utils.getarray(b, address(this)); + } + + function add(int8 c, int8 d) public pure returns (int8) { + return c + d; + } +} diff --git a/resources/regressions/no_import_path.json/mutants/7/contracts/C.sol b/resources/regressions/no_import_path.json/mutants/7/contracts/C.sol new file mode 100644 index 0000000..74e195f --- /dev/null +++ b/resources/regressions/no_import_path.json/mutants/7/contracts/C.sol @@ -0,0 +1,43 @@ +// SPDX-License-Identifier: GPL-3.0-only + +pragma solidity ^0.8.13; + +import "contracts/Imported.sol"; + +library Utils { + function getarray(address[] memory c, address e) internal pure { + assert(c[0] == e); + } + + /// ArithmeticOperatorReplacement(`+` |==> `/`) of: `return a + b;` + function add(int8 a, int8 b) public pure returns (int8) { + return a / b; + } +} + +contract C { + function foo() external view returns (address[] memory) { + address[] memory a = new address[](1); + a[0] = msg.sender; + return a; + } + + function get10PowerDecimals(uint8 decimals) public pure returns (uint256) { + uint256 a = 10; + uint256 res = a ** decimals; + return res; + } + + function getarray(address[] memory c, address e) public pure { + assert(c[0] == e); + } + + function callmyself() external view { + address[] memory b = this.foo(); + Utils.getarray(b, address(this)); + } + + function add(int8 c, int8 d) public pure returns (int8) { + return c + d; + } +} diff --git a/resources/regressions/no_import_path.json/mutants/8/contracts/C.sol b/resources/regressions/no_import_path.json/mutants/8/contracts/C.sol new file mode 100644 index 0000000..2c42d82 --- /dev/null +++ b/resources/regressions/no_import_path.json/mutants/8/contracts/C.sol @@ -0,0 +1,43 @@ +// SPDX-License-Identifier: GPL-3.0-only + +pragma solidity ^0.8.13; + +import "contracts/Imported.sol"; + +library Utils { + function getarray(address[] memory c, address e) internal pure { + assert(c[0] == e); + } + + /// ArithmeticOperatorReplacement(`+` |==> `%`) of: `return a + b;` + function add(int8 a, int8 b) public pure returns (int8) { + return a % b; + } +} + +contract C { + function foo() external view returns (address[] memory) { + address[] memory a = new address[](1); + a[0] = msg.sender; + return a; + } + + function get10PowerDecimals(uint8 decimals) public pure returns (uint256) { + uint256 a = 10; + uint256 res = a ** decimals; + return res; + } + + function getarray(address[] memory c, address e) public pure { + assert(c[0] == e); + } + + function callmyself() external view { + address[] memory b = this.foo(); + Utils.getarray(b, address(this)); + } + + function add(int8 c, int8 d) public pure returns (int8) { + return c + d; + } +} diff --git a/resources/regressions/no_import_path.json/mutants/9/contracts/C.sol b/resources/regressions/no_import_path.json/mutants/9/contracts/C.sol new file mode 100644 index 0000000..6f3eacd --- /dev/null +++ b/resources/regressions/no_import_path.json/mutants/9/contracts/C.sol @@ -0,0 +1,43 @@ +// SPDX-License-Identifier: GPL-3.0-only + +pragma solidity ^0.8.13; + +import "contracts/Imported.sol"; + +library Utils { + function getarray(address[] memory c, address e) internal pure { + assert(c[0] == e); + } + + function add(int8 a, int8 b) public pure returns (int8) { + return a + b; + } +} + +contract C { + /// LiteralValueReplacement(`1` |==> `0`) of: `address[] memory a = new address[](1);` + function foo() external view returns (address[] memory) { + address[] memory a = new address[](0); + a[0] = msg.sender; + return a; + } + + function get10PowerDecimals(uint8 decimals) public pure returns (uint256) { + uint256 a = 10; + uint256 res = a ** decimals; + return res; + } + + function getarray(address[] memory c, address e) public pure { + assert(c[0] == e); + } + + function callmyself() external view { + address[] memory b = this.foo(); + Utils.getarray(b, address(this)); + } + + function add(int8 c, int8 d) public pure returns (int8) { + return c + d; + } +} diff --git a/resources/regressions/ror.json/gambit_results.json b/resources/regressions/ror.json/gambit_results.json new file mode 100644 index 0000000..e2be531 --- /dev/null +++ b/resources/regressions/ror.json/gambit_results.json @@ -0,0 +1,314 @@ +[ + { + "col": 18, + "description": "RelationalOperatorReplacement", + "diff": "--- original\n+++ mutant\n@@ -5,8 +5,9 @@\n // This contract provides test functions for relational operator replacement (ROR)\n contract ROR {\n // Expect 3 mutants: x <= y, x != y, false\n+ /// RelationalOperatorReplacement(`<` |==> `<=`) of: `return x < y;`\n function less(uint256 x, uint256 y) public pure returns (bool) {\n- return x < y;\n+ return x <= y;\n }\n \n // Expect 3 mutants: x < y, x == y, true\n", + "id": "1", + "line": 9, + "name": "mutants/1/Ops/ROR/ROR.sol", + "op": "ROR", + "orig": "<", + "original": "Ops/ROR/ROR.sol", + "repl": "<=" + }, + { + "col": 18, + "description": "RelationalOperatorReplacement", + "diff": "--- original\n+++ mutant\n@@ -5,8 +5,9 @@\n // This contract provides test functions for relational operator replacement (ROR)\n contract ROR {\n // Expect 3 mutants: x <= y, x != y, false\n+ /// RelationalOperatorReplacement(`<` |==> `!=`) of: `return x < y;`\n function less(uint256 x, uint256 y) public pure returns (bool) {\n- return x < y;\n+ return x != y;\n }\n \n // Expect 3 mutants: x < y, x == y, true\n", + "id": "2", + "line": 9, + "name": "mutants/2/Ops/ROR/ROR.sol", + "op": "ROR", + "orig": "<", + "original": "Ops/ROR/ROR.sol", + "repl": "!=" + }, + { + "col": 16, + "description": "RelationalOperatorReplacement", + "diff": "--- original\n+++ mutant\n@@ -5,8 +5,9 @@\n // This contract provides test functions for relational operator replacement (ROR)\n contract ROR {\n // Expect 3 mutants: x <= y, x != y, false\n+ /// RelationalOperatorReplacement(`x < y` |==> `false`) of: `return x < y;`\n function less(uint256 x, uint256 y) public pure returns (bool) {\n- return x < y;\n+ return false;\n }\n \n // Expect 3 mutants: x < y, x == y, true\n", + "id": "3", + "line": 9, + "name": "mutants/3/Ops/ROR/ROR.sol", + "op": "ROR", + "orig": "x < y", + "original": "Ops/ROR/ROR.sol", + "repl": "false" + }, + { + "col": 18, + "description": "RelationalOperatorReplacement", + "diff": "--- original\n+++ mutant\n@@ -10,8 +10,9 @@\n }\n \n // Expect 3 mutants: x < y, x == y, true\n+ /// RelationalOperatorReplacement(`<=` |==> `<`) of: `return x <= y;`\n function less_equal(uint256 x, uint256 y) public pure returns (bool) {\n- return x <= y;\n+ return x < y;\n }\n \n // Expect 3 mutants: x >= y, x != y, false\n", + "id": "4", + "line": 14, + "name": "mutants/4/Ops/ROR/ROR.sol", + "op": "ROR", + "orig": "<=", + "original": "Ops/ROR/ROR.sol", + "repl": "<" + }, + { + "col": 18, + "description": "RelationalOperatorReplacement", + "diff": "--- original\n+++ mutant\n@@ -10,8 +10,9 @@\n }\n \n // Expect 3 mutants: x < y, x == y, true\n+ /// RelationalOperatorReplacement(`<=` |==> `==`) of: `return x <= y;`\n function less_equal(uint256 x, uint256 y) public pure returns (bool) {\n- return x <= y;\n+ return x == y;\n }\n \n // Expect 3 mutants: x >= y, x != y, false\n", + "id": "5", + "line": 14, + "name": "mutants/5/Ops/ROR/ROR.sol", + "op": "ROR", + "orig": "<=", + "original": "Ops/ROR/ROR.sol", + "repl": "==" + }, + { + "col": 16, + "description": "RelationalOperatorReplacement", + "diff": "--- original\n+++ mutant\n@@ -10,8 +10,9 @@\n }\n \n // Expect 3 mutants: x < y, x == y, true\n+ /// RelationalOperatorReplacement(`x <= y` |==> `true`) of: `return x <= y;`\n function less_equal(uint256 x, uint256 y) public pure returns (bool) {\n- return x <= y;\n+ return true;\n }\n \n // Expect 3 mutants: x >= y, x != y, false\n", + "id": "6", + "line": 14, + "name": "mutants/6/Ops/ROR/ROR.sol", + "op": "ROR", + "orig": "x <= y", + "original": "Ops/ROR/ROR.sol", + "repl": "true" + }, + { + "col": 18, + "description": "RelationalOperatorReplacement", + "diff": "--- original\n+++ mutant\n@@ -15,8 +15,9 @@\n }\n \n // Expect 3 mutants: x >= y, x != y, false\n+ /// RelationalOperatorReplacement(`>` |==> `>=`) of: `return x > y;`\n function more(uint256 x, uint256 y) public pure returns (bool) {\n- return x > y;\n+ return x >= y;\n }\n \n // Expect 3 mutants: x > y, x == y, true\n", + "id": "7", + "line": 19, + "name": "mutants/7/Ops/ROR/ROR.sol", + "op": "ROR", + "orig": ">", + "original": "Ops/ROR/ROR.sol", + "repl": ">=" + }, + { + "col": 18, + "description": "RelationalOperatorReplacement", + "diff": "--- original\n+++ mutant\n@@ -15,8 +15,9 @@\n }\n \n // Expect 3 mutants: x >= y, x != y, false\n+ /// RelationalOperatorReplacement(`>` |==> `!=`) of: `return x > y;`\n function more(uint256 x, uint256 y) public pure returns (bool) {\n- return x > y;\n+ return x != y;\n }\n \n // Expect 3 mutants: x > y, x == y, true\n", + "id": "8", + "line": 19, + "name": "mutants/8/Ops/ROR/ROR.sol", + "op": "ROR", + "orig": ">", + "original": "Ops/ROR/ROR.sol", + "repl": "!=" + }, + { + "col": 16, + "description": "RelationalOperatorReplacement", + "diff": "--- original\n+++ mutant\n@@ -15,8 +15,9 @@\n }\n \n // Expect 3 mutants: x >= y, x != y, false\n+ /// RelationalOperatorReplacement(`x > y` |==> `false`) of: `return x > y;`\n function more(uint256 x, uint256 y) public pure returns (bool) {\n- return x > y;\n+ return false;\n }\n \n // Expect 3 mutants: x > y, x == y, true\n", + "id": "9", + "line": 19, + "name": "mutants/9/Ops/ROR/ROR.sol", + "op": "ROR", + "orig": "x > y", + "original": "Ops/ROR/ROR.sol", + "repl": "false" + }, + { + "col": 18, + "description": "RelationalOperatorReplacement", + "diff": "--- original\n+++ mutant\n@@ -20,8 +20,9 @@\n }\n \n // Expect 3 mutants: x > y, x == y, true\n+ /// RelationalOperatorReplacement(`>=` |==> `>`) of: `return x >= y;`\n function more_equal(uint256 x, uint256 y) public pure returns (bool) {\n- return x >= y;\n+ return x > y;\n }\n \n // Expect 3 mutants: x >= y, x <= y, false\n", + "id": "10", + "line": 24, + "name": "mutants/10/Ops/ROR/ROR.sol", + "op": "ROR", + "orig": ">=", + "original": "Ops/ROR/ROR.sol", + "repl": ">" + }, + { + "col": 18, + "description": "RelationalOperatorReplacement", + "diff": "--- original\n+++ mutant\n@@ -20,8 +20,9 @@\n }\n \n // Expect 3 mutants: x > y, x == y, true\n+ /// RelationalOperatorReplacement(`>=` |==> `==`) of: `return x >= y;`\n function more_equal(uint256 x, uint256 y) public pure returns (bool) {\n- return x >= y;\n+ return x == y;\n }\n \n // Expect 3 mutants: x >= y, x <= y, false\n", + "id": "11", + "line": 24, + "name": "mutants/11/Ops/ROR/ROR.sol", + "op": "ROR", + "orig": ">=", + "original": "Ops/ROR/ROR.sol", + "repl": "==" + }, + { + "col": 16, + "description": "RelationalOperatorReplacement", + "diff": "--- original\n+++ mutant\n@@ -20,8 +20,9 @@\n }\n \n // Expect 3 mutants: x > y, x == y, true\n+ /// RelationalOperatorReplacement(`x >= y` |==> `true`) of: `return x >= y;`\n function more_equal(uint256 x, uint256 y) public pure returns (bool) {\n- return x >= y;\n+ return true;\n }\n \n // Expect 3 mutants: x >= y, x <= y, false\n", + "id": "12", + "line": 24, + "name": "mutants/12/Ops/ROR/ROR.sol", + "op": "ROR", + "orig": "x >= y", + "original": "Ops/ROR/ROR.sol", + "repl": "true" + }, + { + "col": 18, + "description": "RelationalOperatorReplacement", + "diff": "--- original\n+++ mutant\n@@ -25,8 +25,9 @@\n }\n \n // Expect 3 mutants: x >= y, x <= y, false\n+ /// RelationalOperatorReplacement(`==` |==> `<=`) of: `return x == y;`\n function equal_ord(uint256 x, uint256 y) public pure returns (bool) {\n- return x == y;\n+ return x <= y;\n }\n \n // Expect 2 mutants: true, false\n", + "id": "13", + "line": 29, + "name": "mutants/13/Ops/ROR/ROR.sol", + "op": "ROR", + "orig": "==", + "original": "Ops/ROR/ROR.sol", + "repl": "<=" + }, + { + "col": 18, + "description": "RelationalOperatorReplacement", + "diff": "--- original\n+++ mutant\n@@ -25,8 +25,9 @@\n }\n \n // Expect 3 mutants: x >= y, x <= y, false\n+ /// RelationalOperatorReplacement(`==` |==> `>=`) of: `return x == y;`\n function equal_ord(uint256 x, uint256 y) public pure returns (bool) {\n- return x == y;\n+ return x >= y;\n }\n \n // Expect 2 mutants: true, false\n", + "id": "14", + "line": 29, + "name": "mutants/14/Ops/ROR/ROR.sol", + "op": "ROR", + "orig": "==", + "original": "Ops/ROR/ROR.sol", + "repl": ">=" + }, + { + "col": 16, + "description": "RelationalOperatorReplacement", + "diff": "--- original\n+++ mutant\n@@ -25,8 +25,9 @@\n }\n \n // Expect 3 mutants: x >= y, x <= y, false\n+ /// RelationalOperatorReplacement(`x == y` |==> `false`) of: `return x == y;`\n function equal_ord(uint256 x, uint256 y) public pure returns (bool) {\n- return x == y;\n+ return false;\n }\n \n // Expect 2 mutants: true, false\n", + "id": "15", + "line": 29, + "name": "mutants/15/Ops/ROR/ROR.sol", + "op": "ROR", + "orig": "x == y", + "original": "Ops/ROR/ROR.sol", + "repl": "false" + }, + { + "col": 16, + "description": "RelationalOperatorReplacement", + "diff": "--- original\n+++ mutant\n@@ -30,8 +30,9 @@\n }\n \n // Expect 2 mutants: true, false\n+ /// RelationalOperatorReplacement(`x == y` |==> `false`) of: `return x == y;`\n function equal_not_ord(bool x, bool y) public pure returns (bool) {\n- return x == y;\n+ return false;\n }\n \n // Expect 3 mutants: x > y, x < y, true\n", + "id": "16", + "line": 34, + "name": "mutants/16/Ops/ROR/ROR.sol", + "op": "ROR", + "orig": "x == y", + "original": "Ops/ROR/ROR.sol", + "repl": "false" + }, + { + "col": 18, + "description": "RelationalOperatorReplacement", + "diff": "--- original\n+++ mutant\n@@ -35,8 +35,9 @@\n }\n \n // Expect 3 mutants: x > y, x < y, true\n+ /// RelationalOperatorReplacement(`!=` |==> `<`) of: `return x != y;`\n function not_equal_ord(uint256 x, uint256 y) public pure returns (bool) {\n- return x != y;\n+ return x < y;\n }\n \n // Expect 2 mutants: true, false\n", + "id": "17", + "line": 39, + "name": "mutants/17/Ops/ROR/ROR.sol", + "op": "ROR", + "orig": "!=", + "original": "Ops/ROR/ROR.sol", + "repl": "<" + }, + { + "col": 18, + "description": "RelationalOperatorReplacement", + "diff": "--- original\n+++ mutant\n@@ -35,8 +35,9 @@\n }\n \n // Expect 3 mutants: x > y, x < y, true\n+ /// RelationalOperatorReplacement(`!=` |==> `>`) of: `return x != y;`\n function not_equal_ord(uint256 x, uint256 y) public pure returns (bool) {\n- return x != y;\n+ return x > y;\n }\n \n // Expect 2 mutants: true, false\n", + "id": "18", + "line": 39, + "name": "mutants/18/Ops/ROR/ROR.sol", + "op": "ROR", + "orig": "!=", + "original": "Ops/ROR/ROR.sol", + "repl": ">" + }, + { + "col": 16, + "description": "RelationalOperatorReplacement", + "diff": "--- original\n+++ mutant\n@@ -35,8 +35,9 @@\n }\n \n // Expect 3 mutants: x > y, x < y, true\n+ /// RelationalOperatorReplacement(`x != y` |==> `true`) of: `return x != y;`\n function not_equal_ord(uint256 x, uint256 y) public pure returns (bool) {\n- return x != y;\n+ return true;\n }\n \n // Expect 2 mutants: true, false\n", + "id": "19", + "line": 39, + "name": "mutants/19/Ops/ROR/ROR.sol", + "op": "ROR", + "orig": "x != y", + "original": "Ops/ROR/ROR.sol", + "repl": "true" + }, + { + "col": 16, + "description": "RelationalOperatorReplacement", + "diff": "--- original\n+++ mutant\n@@ -40,8 +40,9 @@\n }\n \n // Expect 2 mutants: true, false\n+ /// RelationalOperatorReplacement(`x != y` |==> `true`) of: `return x != y;`\n function not_equal_not_ord(bool x, bool y) public pure returns (bool) {\n- return x != y;\n+ return true;\n }\n \n // Expect 3 mutants: (x + y) > z, (x + y) == z, true\n", + "id": "20", + "line": 44, + "name": "mutants/20/Ops/ROR/ROR.sol", + "op": "ROR", + "orig": "x != y", + "original": "Ops/ROR/ROR.sol", + "repl": "true" + }, + { + "col": 24, + "description": "RelationalOperatorReplacement", + "diff": "--- original\n+++ mutant\n@@ -49,8 +49,9 @@\n uint256 x,\n uint256 y,\n uint256 z\n+ /// RelationalOperatorReplacement(`>=` |==> `>`) of: `return (x + y) >= z;`\n ) public pure returns (bool) {\n- return (x + y) >= z;\n+ return (x + y) > z;\n }\n \n // Expect 3 mutants: (x + y) > z, (x + y) < z, true\n", + "id": "21", + "line": 53, + "name": "mutants/21/Ops/ROR/ROR.sol", + "op": "ROR", + "orig": ">=", + "original": "Ops/ROR/ROR.sol", + "repl": ">" + }, + { + "col": 24, + "description": "RelationalOperatorReplacement", + "diff": "--- original\n+++ mutant\n@@ -49,8 +49,9 @@\n uint256 x,\n uint256 y,\n uint256 z\n+ /// RelationalOperatorReplacement(`>=` |==> `==`) of: `return (x + y) >= z;`\n ) public pure returns (bool) {\n- return (x + y) >= z;\n+ return (x + y) == z;\n }\n \n // Expect 3 mutants: (x + y) > z, (x + y) < z, true\n", + "id": "22", + "line": 53, + "name": "mutants/22/Ops/ROR/ROR.sol", + "op": "ROR", + "orig": ">=", + "original": "Ops/ROR/ROR.sol", + "repl": "==" + }, + { + "col": 16, + "description": "RelationalOperatorReplacement", + "diff": "--- original\n+++ mutant\n@@ -49,8 +49,9 @@\n uint256 x,\n uint256 y,\n uint256 z\n+ /// RelationalOperatorReplacement(`(x + y) >= z` |==> `true`) of: `return (x + y) >= z;`\n ) public pure returns (bool) {\n- return (x + y) >= z;\n+ return true;\n }\n \n // Expect 3 mutants: (x + y) > z, (x + y) < z, true\n", + "id": "23", + "line": 53, + "name": "mutants/23/Ops/ROR/ROR.sol", + "op": "ROR", + "orig": "(x + y) >= z", + "original": "Ops/ROR/ROR.sol", + "repl": "true" + }, + { + "col": 24, + "description": "RelationalOperatorReplacement", + "diff": "--- original\n+++ mutant\n@@ -58,7 +58,8 @@\n uint256 x,\n uint256 y,\n uint256 z\n+ /// RelationalOperatorReplacement(`!=` |==> `<`) of: `return (x + y) != z;`\n ) public pure returns (bool) {\n- return (x + y) != z;\n+ return (x + y) < z;\n }\n }\n", + "id": "24", + "line": 62, + "name": "mutants/24/Ops/ROR/ROR.sol", + "op": "ROR", + "orig": "!=", + "original": "Ops/ROR/ROR.sol", + "repl": "<" + }, + { + "col": 24, + "description": "RelationalOperatorReplacement", + "diff": "--- original\n+++ mutant\n@@ -58,7 +58,8 @@\n uint256 x,\n uint256 y,\n uint256 z\n+ /// RelationalOperatorReplacement(`!=` |==> `>`) of: `return (x + y) != z;`\n ) public pure returns (bool) {\n- return (x + y) != z;\n+ return (x + y) > z;\n }\n }\n", + "id": "25", + "line": 62, + "name": "mutants/25/Ops/ROR/ROR.sol", + "op": "ROR", + "orig": "!=", + "original": "Ops/ROR/ROR.sol", + "repl": ">" + }, + { + "col": 16, + "description": "RelationalOperatorReplacement", + "diff": "--- original\n+++ mutant\n@@ -58,7 +58,8 @@\n uint256 x,\n uint256 y,\n uint256 z\n+ /// RelationalOperatorReplacement(`(x + y) != z` |==> `true`) of: `return (x + y) != z;`\n ) public pure returns (bool) {\n- return (x + y) != z;\n+ return true;\n }\n }\n", + "id": "26", + "line": 62, + "name": "mutants/26/Ops/ROR/ROR.sol", + "op": "ROR", + "orig": "(x + y) != z", + "original": "Ops/ROR/ROR.sol", + "repl": "true" + } +] \ No newline at end of file diff --git a/resources/regressions/ror.json/mutants.log b/resources/regressions/ror.json/mutants.log new file mode 100644 index 0000000..5d07acb --- /dev/null +++ b/resources/regressions/ror.json/mutants.log @@ -0,0 +1,26 @@ +1,ROR,Ops/ROR/ROR.sol,9:18,<,<= +2,ROR,Ops/ROR/ROR.sol,9:18,<,!= +3,ROR,Ops/ROR/ROR.sol,9:16,x < y,false +4,ROR,Ops/ROR/ROR.sol,14:18,<=,< +5,ROR,Ops/ROR/ROR.sol,14:18,<=,== +6,ROR,Ops/ROR/ROR.sol,14:16,x <= y,true +7,ROR,Ops/ROR/ROR.sol,19:18,>,>= +8,ROR,Ops/ROR/ROR.sol,19:18,>,!= +9,ROR,Ops/ROR/ROR.sol,19:16,x > y,false +10,ROR,Ops/ROR/ROR.sol,24:18,>=,> +11,ROR,Ops/ROR/ROR.sol,24:18,>=,== +12,ROR,Ops/ROR/ROR.sol,24:16,x >= y,true +13,ROR,Ops/ROR/ROR.sol,29:18,==,<= +14,ROR,Ops/ROR/ROR.sol,29:18,==,>= +15,ROR,Ops/ROR/ROR.sol,29:16,x == y,false +16,ROR,Ops/ROR/ROR.sol,34:16,x == y,false +17,ROR,Ops/ROR/ROR.sol,39:18,!=,< +18,ROR,Ops/ROR/ROR.sol,39:18,!=,> +19,ROR,Ops/ROR/ROR.sol,39:16,x != y,true +20,ROR,Ops/ROR/ROR.sol,44:16,x != y,true +21,ROR,Ops/ROR/ROR.sol,53:24,>=,> +22,ROR,Ops/ROR/ROR.sol,53:24,>=,== +23,ROR,Ops/ROR/ROR.sol,53:16,(x + y) >= z,true +24,ROR,Ops/ROR/ROR.sol,62:24,!=,< +25,ROR,Ops/ROR/ROR.sol,62:24,!=,> +26,ROR,Ops/ROR/ROR.sol,62:16,(x + y) != z,true diff --git a/resources/regressions/ror.json/mutants/1/Ops/ROR/ROR.sol b/resources/regressions/ror.json/mutants/1/Ops/ROR/ROR.sol new file mode 100644 index 0000000..dec84f2 --- /dev/null +++ b/resources/regressions/ror.json/mutants/1/Ops/ROR/ROR.sol @@ -0,0 +1,65 @@ +// SPDX-License-Identifier: GPL-3.0-only +pragma solidity >0.7.0; +pragma experimental ABIEncoderV2; + +// This contract provides test functions for relational operator replacement (ROR) +contract ROR { + // Expect 3 mutants: x <= y, x != y, false + /// RelationalOperatorReplacement(`<` |==> `<=`) of: `return x < y;` + function less(uint256 x, uint256 y) public pure returns (bool) { + return x <= y; + } + + // Expect 3 mutants: x < y, x == y, true + function less_equal(uint256 x, uint256 y) public pure returns (bool) { + return x <= y; + } + + // Expect 3 mutants: x >= y, x != y, false + function more(uint256 x, uint256 y) public pure returns (bool) { + return x > y; + } + + // Expect 3 mutants: x > y, x == y, true + function more_equal(uint256 x, uint256 y) public pure returns (bool) { + return x >= y; + } + + // Expect 3 mutants: x >= y, x <= y, false + function equal_ord(uint256 x, uint256 y) public pure returns (bool) { + return x == y; + } + + // Expect 2 mutants: true, false + function equal_not_ord(bool x, bool y) public pure returns (bool) { + return x == y; + } + + // Expect 3 mutants: x > y, x < y, true + function not_equal_ord(uint256 x, uint256 y) public pure returns (bool) { + return x != y; + } + + // Expect 2 mutants: true, false + function not_equal_not_ord(bool x, bool y) public pure returns (bool) { + return x != y; + } + + // Expect 3 mutants: (x + y) > z, (x + y) == z, true + function more_equal_over_aor( + uint256 x, + uint256 y, + uint256 z + ) public pure returns (bool) { + return (x + y) >= z; + } + + // Expect 3 mutants: (x + y) > z, (x + y) < z, true + function not_equal_over_aor( + uint256 x, + uint256 y, + uint256 z + ) public pure returns (bool) { + return (x + y) != z; + } +} diff --git a/resources/regressions/ror.json/mutants/10/Ops/ROR/ROR.sol b/resources/regressions/ror.json/mutants/10/Ops/ROR/ROR.sol new file mode 100644 index 0000000..337c9a9 --- /dev/null +++ b/resources/regressions/ror.json/mutants/10/Ops/ROR/ROR.sol @@ -0,0 +1,65 @@ +// SPDX-License-Identifier: GPL-3.0-only +pragma solidity >0.7.0; +pragma experimental ABIEncoderV2; + +// This contract provides test functions for relational operator replacement (ROR) +contract ROR { + // Expect 3 mutants: x <= y, x != y, false + function less(uint256 x, uint256 y) public pure returns (bool) { + return x < y; + } + + // Expect 3 mutants: x < y, x == y, true + function less_equal(uint256 x, uint256 y) public pure returns (bool) { + return x <= y; + } + + // Expect 3 mutants: x >= y, x != y, false + function more(uint256 x, uint256 y) public pure returns (bool) { + return x > y; + } + + // Expect 3 mutants: x > y, x == y, true + /// RelationalOperatorReplacement(`>=` |==> `>`) of: `return x >= y;` + function more_equal(uint256 x, uint256 y) public pure returns (bool) { + return x > y; + } + + // Expect 3 mutants: x >= y, x <= y, false + function equal_ord(uint256 x, uint256 y) public pure returns (bool) { + return x == y; + } + + // Expect 2 mutants: true, false + function equal_not_ord(bool x, bool y) public pure returns (bool) { + return x == y; + } + + // Expect 3 mutants: x > y, x < y, true + function not_equal_ord(uint256 x, uint256 y) public pure returns (bool) { + return x != y; + } + + // Expect 2 mutants: true, false + function not_equal_not_ord(bool x, bool y) public pure returns (bool) { + return x != y; + } + + // Expect 3 mutants: (x + y) > z, (x + y) == z, true + function more_equal_over_aor( + uint256 x, + uint256 y, + uint256 z + ) public pure returns (bool) { + return (x + y) >= z; + } + + // Expect 3 mutants: (x + y) > z, (x + y) < z, true + function not_equal_over_aor( + uint256 x, + uint256 y, + uint256 z + ) public pure returns (bool) { + return (x + y) != z; + } +} diff --git a/resources/regressions/ror.json/mutants/11/Ops/ROR/ROR.sol b/resources/regressions/ror.json/mutants/11/Ops/ROR/ROR.sol new file mode 100644 index 0000000..7c02b73 --- /dev/null +++ b/resources/regressions/ror.json/mutants/11/Ops/ROR/ROR.sol @@ -0,0 +1,65 @@ +// SPDX-License-Identifier: GPL-3.0-only +pragma solidity >0.7.0; +pragma experimental ABIEncoderV2; + +// This contract provides test functions for relational operator replacement (ROR) +contract ROR { + // Expect 3 mutants: x <= y, x != y, false + function less(uint256 x, uint256 y) public pure returns (bool) { + return x < y; + } + + // Expect 3 mutants: x < y, x == y, true + function less_equal(uint256 x, uint256 y) public pure returns (bool) { + return x <= y; + } + + // Expect 3 mutants: x >= y, x != y, false + function more(uint256 x, uint256 y) public pure returns (bool) { + return x > y; + } + + // Expect 3 mutants: x > y, x == y, true + /// RelationalOperatorReplacement(`>=` |==> `==`) of: `return x >= y;` + function more_equal(uint256 x, uint256 y) public pure returns (bool) { + return x == y; + } + + // Expect 3 mutants: x >= y, x <= y, false + function equal_ord(uint256 x, uint256 y) public pure returns (bool) { + return x == y; + } + + // Expect 2 mutants: true, false + function equal_not_ord(bool x, bool y) public pure returns (bool) { + return x == y; + } + + // Expect 3 mutants: x > y, x < y, true + function not_equal_ord(uint256 x, uint256 y) public pure returns (bool) { + return x != y; + } + + // Expect 2 mutants: true, false + function not_equal_not_ord(bool x, bool y) public pure returns (bool) { + return x != y; + } + + // Expect 3 mutants: (x + y) > z, (x + y) == z, true + function more_equal_over_aor( + uint256 x, + uint256 y, + uint256 z + ) public pure returns (bool) { + return (x + y) >= z; + } + + // Expect 3 mutants: (x + y) > z, (x + y) < z, true + function not_equal_over_aor( + uint256 x, + uint256 y, + uint256 z + ) public pure returns (bool) { + return (x + y) != z; + } +} diff --git a/resources/regressions/ror.json/mutants/12/Ops/ROR/ROR.sol b/resources/regressions/ror.json/mutants/12/Ops/ROR/ROR.sol new file mode 100644 index 0000000..3d299df --- /dev/null +++ b/resources/regressions/ror.json/mutants/12/Ops/ROR/ROR.sol @@ -0,0 +1,65 @@ +// SPDX-License-Identifier: GPL-3.0-only +pragma solidity >0.7.0; +pragma experimental ABIEncoderV2; + +// This contract provides test functions for relational operator replacement (ROR) +contract ROR { + // Expect 3 mutants: x <= y, x != y, false + function less(uint256 x, uint256 y) public pure returns (bool) { + return x < y; + } + + // Expect 3 mutants: x < y, x == y, true + function less_equal(uint256 x, uint256 y) public pure returns (bool) { + return x <= y; + } + + // Expect 3 mutants: x >= y, x != y, false + function more(uint256 x, uint256 y) public pure returns (bool) { + return x > y; + } + + // Expect 3 mutants: x > y, x == y, true + /// RelationalOperatorReplacement(`x >= y` |==> `true`) of: `return x >= y;` + function more_equal(uint256 x, uint256 y) public pure returns (bool) { + return true; + } + + // Expect 3 mutants: x >= y, x <= y, false + function equal_ord(uint256 x, uint256 y) public pure returns (bool) { + return x == y; + } + + // Expect 2 mutants: true, false + function equal_not_ord(bool x, bool y) public pure returns (bool) { + return x == y; + } + + // Expect 3 mutants: x > y, x < y, true + function not_equal_ord(uint256 x, uint256 y) public pure returns (bool) { + return x != y; + } + + // Expect 2 mutants: true, false + function not_equal_not_ord(bool x, bool y) public pure returns (bool) { + return x != y; + } + + // Expect 3 mutants: (x + y) > z, (x + y) == z, true + function more_equal_over_aor( + uint256 x, + uint256 y, + uint256 z + ) public pure returns (bool) { + return (x + y) >= z; + } + + // Expect 3 mutants: (x + y) > z, (x + y) < z, true + function not_equal_over_aor( + uint256 x, + uint256 y, + uint256 z + ) public pure returns (bool) { + return (x + y) != z; + } +} diff --git a/resources/regressions/ror.json/mutants/13/Ops/ROR/ROR.sol b/resources/regressions/ror.json/mutants/13/Ops/ROR/ROR.sol new file mode 100644 index 0000000..c865469 --- /dev/null +++ b/resources/regressions/ror.json/mutants/13/Ops/ROR/ROR.sol @@ -0,0 +1,65 @@ +// SPDX-License-Identifier: GPL-3.0-only +pragma solidity >0.7.0; +pragma experimental ABIEncoderV2; + +// This contract provides test functions for relational operator replacement (ROR) +contract ROR { + // Expect 3 mutants: x <= y, x != y, false + function less(uint256 x, uint256 y) public pure returns (bool) { + return x < y; + } + + // Expect 3 mutants: x < y, x == y, true + function less_equal(uint256 x, uint256 y) public pure returns (bool) { + return x <= y; + } + + // Expect 3 mutants: x >= y, x != y, false + function more(uint256 x, uint256 y) public pure returns (bool) { + return x > y; + } + + // Expect 3 mutants: x > y, x == y, true + function more_equal(uint256 x, uint256 y) public pure returns (bool) { + return x >= y; + } + + // Expect 3 mutants: x >= y, x <= y, false + /// RelationalOperatorReplacement(`==` |==> `<=`) of: `return x == y;` + function equal_ord(uint256 x, uint256 y) public pure returns (bool) { + return x <= y; + } + + // Expect 2 mutants: true, false + function equal_not_ord(bool x, bool y) public pure returns (bool) { + return x == y; + } + + // Expect 3 mutants: x > y, x < y, true + function not_equal_ord(uint256 x, uint256 y) public pure returns (bool) { + return x != y; + } + + // Expect 2 mutants: true, false + function not_equal_not_ord(bool x, bool y) public pure returns (bool) { + return x != y; + } + + // Expect 3 mutants: (x + y) > z, (x + y) == z, true + function more_equal_over_aor( + uint256 x, + uint256 y, + uint256 z + ) public pure returns (bool) { + return (x + y) >= z; + } + + // Expect 3 mutants: (x + y) > z, (x + y) < z, true + function not_equal_over_aor( + uint256 x, + uint256 y, + uint256 z + ) public pure returns (bool) { + return (x + y) != z; + } +} diff --git a/resources/regressions/ror.json/mutants/14/Ops/ROR/ROR.sol b/resources/regressions/ror.json/mutants/14/Ops/ROR/ROR.sol new file mode 100644 index 0000000..8cdc1c1 --- /dev/null +++ b/resources/regressions/ror.json/mutants/14/Ops/ROR/ROR.sol @@ -0,0 +1,65 @@ +// SPDX-License-Identifier: GPL-3.0-only +pragma solidity >0.7.0; +pragma experimental ABIEncoderV2; + +// This contract provides test functions for relational operator replacement (ROR) +contract ROR { + // Expect 3 mutants: x <= y, x != y, false + function less(uint256 x, uint256 y) public pure returns (bool) { + return x < y; + } + + // Expect 3 mutants: x < y, x == y, true + function less_equal(uint256 x, uint256 y) public pure returns (bool) { + return x <= y; + } + + // Expect 3 mutants: x >= y, x != y, false + function more(uint256 x, uint256 y) public pure returns (bool) { + return x > y; + } + + // Expect 3 mutants: x > y, x == y, true + function more_equal(uint256 x, uint256 y) public pure returns (bool) { + return x >= y; + } + + // Expect 3 mutants: x >= y, x <= y, false + /// RelationalOperatorReplacement(`==` |==> `>=`) of: `return x == y;` + function equal_ord(uint256 x, uint256 y) public pure returns (bool) { + return x >= y; + } + + // Expect 2 mutants: true, false + function equal_not_ord(bool x, bool y) public pure returns (bool) { + return x == y; + } + + // Expect 3 mutants: x > y, x < y, true + function not_equal_ord(uint256 x, uint256 y) public pure returns (bool) { + return x != y; + } + + // Expect 2 mutants: true, false + function not_equal_not_ord(bool x, bool y) public pure returns (bool) { + return x != y; + } + + // Expect 3 mutants: (x + y) > z, (x + y) == z, true + function more_equal_over_aor( + uint256 x, + uint256 y, + uint256 z + ) public pure returns (bool) { + return (x + y) >= z; + } + + // Expect 3 mutants: (x + y) > z, (x + y) < z, true + function not_equal_over_aor( + uint256 x, + uint256 y, + uint256 z + ) public pure returns (bool) { + return (x + y) != z; + } +} diff --git a/resources/regressions/ror.json/mutants/15/Ops/ROR/ROR.sol b/resources/regressions/ror.json/mutants/15/Ops/ROR/ROR.sol new file mode 100644 index 0000000..de6a436 --- /dev/null +++ b/resources/regressions/ror.json/mutants/15/Ops/ROR/ROR.sol @@ -0,0 +1,65 @@ +// SPDX-License-Identifier: GPL-3.0-only +pragma solidity >0.7.0; +pragma experimental ABIEncoderV2; + +// This contract provides test functions for relational operator replacement (ROR) +contract ROR { + // Expect 3 mutants: x <= y, x != y, false + function less(uint256 x, uint256 y) public pure returns (bool) { + return x < y; + } + + // Expect 3 mutants: x < y, x == y, true + function less_equal(uint256 x, uint256 y) public pure returns (bool) { + return x <= y; + } + + // Expect 3 mutants: x >= y, x != y, false + function more(uint256 x, uint256 y) public pure returns (bool) { + return x > y; + } + + // Expect 3 mutants: x > y, x == y, true + function more_equal(uint256 x, uint256 y) public pure returns (bool) { + return x >= y; + } + + // Expect 3 mutants: x >= y, x <= y, false + /// RelationalOperatorReplacement(`x == y` |==> `false`) of: `return x == y;` + function equal_ord(uint256 x, uint256 y) public pure returns (bool) { + return false; + } + + // Expect 2 mutants: true, false + function equal_not_ord(bool x, bool y) public pure returns (bool) { + return x == y; + } + + // Expect 3 mutants: x > y, x < y, true + function not_equal_ord(uint256 x, uint256 y) public pure returns (bool) { + return x != y; + } + + // Expect 2 mutants: true, false + function not_equal_not_ord(bool x, bool y) public pure returns (bool) { + return x != y; + } + + // Expect 3 mutants: (x + y) > z, (x + y) == z, true + function more_equal_over_aor( + uint256 x, + uint256 y, + uint256 z + ) public pure returns (bool) { + return (x + y) >= z; + } + + // Expect 3 mutants: (x + y) > z, (x + y) < z, true + function not_equal_over_aor( + uint256 x, + uint256 y, + uint256 z + ) public pure returns (bool) { + return (x + y) != z; + } +} diff --git a/resources/regressions/ror.json/mutants/16/Ops/ROR/ROR.sol b/resources/regressions/ror.json/mutants/16/Ops/ROR/ROR.sol new file mode 100644 index 0000000..ab40e6c --- /dev/null +++ b/resources/regressions/ror.json/mutants/16/Ops/ROR/ROR.sol @@ -0,0 +1,65 @@ +// SPDX-License-Identifier: GPL-3.0-only +pragma solidity >0.7.0; +pragma experimental ABIEncoderV2; + +// This contract provides test functions for relational operator replacement (ROR) +contract ROR { + // Expect 3 mutants: x <= y, x != y, false + function less(uint256 x, uint256 y) public pure returns (bool) { + return x < y; + } + + // Expect 3 mutants: x < y, x == y, true + function less_equal(uint256 x, uint256 y) public pure returns (bool) { + return x <= y; + } + + // Expect 3 mutants: x >= y, x != y, false + function more(uint256 x, uint256 y) public pure returns (bool) { + return x > y; + } + + // Expect 3 mutants: x > y, x == y, true + function more_equal(uint256 x, uint256 y) public pure returns (bool) { + return x >= y; + } + + // Expect 3 mutants: x >= y, x <= y, false + function equal_ord(uint256 x, uint256 y) public pure returns (bool) { + return x == y; + } + + // Expect 2 mutants: true, false + /// RelationalOperatorReplacement(`x == y` |==> `false`) of: `return x == y;` + function equal_not_ord(bool x, bool y) public pure returns (bool) { + return false; + } + + // Expect 3 mutants: x > y, x < y, true + function not_equal_ord(uint256 x, uint256 y) public pure returns (bool) { + return x != y; + } + + // Expect 2 mutants: true, false + function not_equal_not_ord(bool x, bool y) public pure returns (bool) { + return x != y; + } + + // Expect 3 mutants: (x + y) > z, (x + y) == z, true + function more_equal_over_aor( + uint256 x, + uint256 y, + uint256 z + ) public pure returns (bool) { + return (x + y) >= z; + } + + // Expect 3 mutants: (x + y) > z, (x + y) < z, true + function not_equal_over_aor( + uint256 x, + uint256 y, + uint256 z + ) public pure returns (bool) { + return (x + y) != z; + } +} diff --git a/resources/regressions/ror.json/mutants/17/Ops/ROR/ROR.sol b/resources/regressions/ror.json/mutants/17/Ops/ROR/ROR.sol new file mode 100644 index 0000000..f42e7b7 --- /dev/null +++ b/resources/regressions/ror.json/mutants/17/Ops/ROR/ROR.sol @@ -0,0 +1,65 @@ +// SPDX-License-Identifier: GPL-3.0-only +pragma solidity >0.7.0; +pragma experimental ABIEncoderV2; + +// This contract provides test functions for relational operator replacement (ROR) +contract ROR { + // Expect 3 mutants: x <= y, x != y, false + function less(uint256 x, uint256 y) public pure returns (bool) { + return x < y; + } + + // Expect 3 mutants: x < y, x == y, true + function less_equal(uint256 x, uint256 y) public pure returns (bool) { + return x <= y; + } + + // Expect 3 mutants: x >= y, x != y, false + function more(uint256 x, uint256 y) public pure returns (bool) { + return x > y; + } + + // Expect 3 mutants: x > y, x == y, true + function more_equal(uint256 x, uint256 y) public pure returns (bool) { + return x >= y; + } + + // Expect 3 mutants: x >= y, x <= y, false + function equal_ord(uint256 x, uint256 y) public pure returns (bool) { + return x == y; + } + + // Expect 2 mutants: true, false + function equal_not_ord(bool x, bool y) public pure returns (bool) { + return x == y; + } + + // Expect 3 mutants: x > y, x < y, true + /// RelationalOperatorReplacement(`!=` |==> `<`) of: `return x != y;` + function not_equal_ord(uint256 x, uint256 y) public pure returns (bool) { + return x < y; + } + + // Expect 2 mutants: true, false + function not_equal_not_ord(bool x, bool y) public pure returns (bool) { + return x != y; + } + + // Expect 3 mutants: (x + y) > z, (x + y) == z, true + function more_equal_over_aor( + uint256 x, + uint256 y, + uint256 z + ) public pure returns (bool) { + return (x + y) >= z; + } + + // Expect 3 mutants: (x + y) > z, (x + y) < z, true + function not_equal_over_aor( + uint256 x, + uint256 y, + uint256 z + ) public pure returns (bool) { + return (x + y) != z; + } +} diff --git a/resources/regressions/ror.json/mutants/18/Ops/ROR/ROR.sol b/resources/regressions/ror.json/mutants/18/Ops/ROR/ROR.sol new file mode 100644 index 0000000..e5f5032 --- /dev/null +++ b/resources/regressions/ror.json/mutants/18/Ops/ROR/ROR.sol @@ -0,0 +1,65 @@ +// SPDX-License-Identifier: GPL-3.0-only +pragma solidity >0.7.0; +pragma experimental ABIEncoderV2; + +// This contract provides test functions for relational operator replacement (ROR) +contract ROR { + // Expect 3 mutants: x <= y, x != y, false + function less(uint256 x, uint256 y) public pure returns (bool) { + return x < y; + } + + // Expect 3 mutants: x < y, x == y, true + function less_equal(uint256 x, uint256 y) public pure returns (bool) { + return x <= y; + } + + // Expect 3 mutants: x >= y, x != y, false + function more(uint256 x, uint256 y) public pure returns (bool) { + return x > y; + } + + // Expect 3 mutants: x > y, x == y, true + function more_equal(uint256 x, uint256 y) public pure returns (bool) { + return x >= y; + } + + // Expect 3 mutants: x >= y, x <= y, false + function equal_ord(uint256 x, uint256 y) public pure returns (bool) { + return x == y; + } + + // Expect 2 mutants: true, false + function equal_not_ord(bool x, bool y) public pure returns (bool) { + return x == y; + } + + // Expect 3 mutants: x > y, x < y, true + /// RelationalOperatorReplacement(`!=` |==> `>`) of: `return x != y;` + function not_equal_ord(uint256 x, uint256 y) public pure returns (bool) { + return x > y; + } + + // Expect 2 mutants: true, false + function not_equal_not_ord(bool x, bool y) public pure returns (bool) { + return x != y; + } + + // Expect 3 mutants: (x + y) > z, (x + y) == z, true + function more_equal_over_aor( + uint256 x, + uint256 y, + uint256 z + ) public pure returns (bool) { + return (x + y) >= z; + } + + // Expect 3 mutants: (x + y) > z, (x + y) < z, true + function not_equal_over_aor( + uint256 x, + uint256 y, + uint256 z + ) public pure returns (bool) { + return (x + y) != z; + } +} diff --git a/resources/regressions/ror.json/mutants/19/Ops/ROR/ROR.sol b/resources/regressions/ror.json/mutants/19/Ops/ROR/ROR.sol new file mode 100644 index 0000000..8368448 --- /dev/null +++ b/resources/regressions/ror.json/mutants/19/Ops/ROR/ROR.sol @@ -0,0 +1,65 @@ +// SPDX-License-Identifier: GPL-3.0-only +pragma solidity >0.7.0; +pragma experimental ABIEncoderV2; + +// This contract provides test functions for relational operator replacement (ROR) +contract ROR { + // Expect 3 mutants: x <= y, x != y, false + function less(uint256 x, uint256 y) public pure returns (bool) { + return x < y; + } + + // Expect 3 mutants: x < y, x == y, true + function less_equal(uint256 x, uint256 y) public pure returns (bool) { + return x <= y; + } + + // Expect 3 mutants: x >= y, x != y, false + function more(uint256 x, uint256 y) public pure returns (bool) { + return x > y; + } + + // Expect 3 mutants: x > y, x == y, true + function more_equal(uint256 x, uint256 y) public pure returns (bool) { + return x >= y; + } + + // Expect 3 mutants: x >= y, x <= y, false + function equal_ord(uint256 x, uint256 y) public pure returns (bool) { + return x == y; + } + + // Expect 2 mutants: true, false + function equal_not_ord(bool x, bool y) public pure returns (bool) { + return x == y; + } + + // Expect 3 mutants: x > y, x < y, true + /// RelationalOperatorReplacement(`x != y` |==> `true`) of: `return x != y;` + function not_equal_ord(uint256 x, uint256 y) public pure returns (bool) { + return true; + } + + // Expect 2 mutants: true, false + function not_equal_not_ord(bool x, bool y) public pure returns (bool) { + return x != y; + } + + // Expect 3 mutants: (x + y) > z, (x + y) == z, true + function more_equal_over_aor( + uint256 x, + uint256 y, + uint256 z + ) public pure returns (bool) { + return (x + y) >= z; + } + + // Expect 3 mutants: (x + y) > z, (x + y) < z, true + function not_equal_over_aor( + uint256 x, + uint256 y, + uint256 z + ) public pure returns (bool) { + return (x + y) != z; + } +} diff --git a/resources/regressions/ror.json/mutants/2/Ops/ROR/ROR.sol b/resources/regressions/ror.json/mutants/2/Ops/ROR/ROR.sol new file mode 100644 index 0000000..0c05265 --- /dev/null +++ b/resources/regressions/ror.json/mutants/2/Ops/ROR/ROR.sol @@ -0,0 +1,65 @@ +// SPDX-License-Identifier: GPL-3.0-only +pragma solidity >0.7.0; +pragma experimental ABIEncoderV2; + +// This contract provides test functions for relational operator replacement (ROR) +contract ROR { + // Expect 3 mutants: x <= y, x != y, false + /// RelationalOperatorReplacement(`<` |==> `!=`) of: `return x < y;` + function less(uint256 x, uint256 y) public pure returns (bool) { + return x != y; + } + + // Expect 3 mutants: x < y, x == y, true + function less_equal(uint256 x, uint256 y) public pure returns (bool) { + return x <= y; + } + + // Expect 3 mutants: x >= y, x != y, false + function more(uint256 x, uint256 y) public pure returns (bool) { + return x > y; + } + + // Expect 3 mutants: x > y, x == y, true + function more_equal(uint256 x, uint256 y) public pure returns (bool) { + return x >= y; + } + + // Expect 3 mutants: x >= y, x <= y, false + function equal_ord(uint256 x, uint256 y) public pure returns (bool) { + return x == y; + } + + // Expect 2 mutants: true, false + function equal_not_ord(bool x, bool y) public pure returns (bool) { + return x == y; + } + + // Expect 3 mutants: x > y, x < y, true + function not_equal_ord(uint256 x, uint256 y) public pure returns (bool) { + return x != y; + } + + // Expect 2 mutants: true, false + function not_equal_not_ord(bool x, bool y) public pure returns (bool) { + return x != y; + } + + // Expect 3 mutants: (x + y) > z, (x + y) == z, true + function more_equal_over_aor( + uint256 x, + uint256 y, + uint256 z + ) public pure returns (bool) { + return (x + y) >= z; + } + + // Expect 3 mutants: (x + y) > z, (x + y) < z, true + function not_equal_over_aor( + uint256 x, + uint256 y, + uint256 z + ) public pure returns (bool) { + return (x + y) != z; + } +} diff --git a/resources/regressions/ror.json/mutants/20/Ops/ROR/ROR.sol b/resources/regressions/ror.json/mutants/20/Ops/ROR/ROR.sol new file mode 100644 index 0000000..3ae9213 --- /dev/null +++ b/resources/regressions/ror.json/mutants/20/Ops/ROR/ROR.sol @@ -0,0 +1,65 @@ +// SPDX-License-Identifier: GPL-3.0-only +pragma solidity >0.7.0; +pragma experimental ABIEncoderV2; + +// This contract provides test functions for relational operator replacement (ROR) +contract ROR { + // Expect 3 mutants: x <= y, x != y, false + function less(uint256 x, uint256 y) public pure returns (bool) { + return x < y; + } + + // Expect 3 mutants: x < y, x == y, true + function less_equal(uint256 x, uint256 y) public pure returns (bool) { + return x <= y; + } + + // Expect 3 mutants: x >= y, x != y, false + function more(uint256 x, uint256 y) public pure returns (bool) { + return x > y; + } + + // Expect 3 mutants: x > y, x == y, true + function more_equal(uint256 x, uint256 y) public pure returns (bool) { + return x >= y; + } + + // Expect 3 mutants: x >= y, x <= y, false + function equal_ord(uint256 x, uint256 y) public pure returns (bool) { + return x == y; + } + + // Expect 2 mutants: true, false + function equal_not_ord(bool x, bool y) public pure returns (bool) { + return x == y; + } + + // Expect 3 mutants: x > y, x < y, true + function not_equal_ord(uint256 x, uint256 y) public pure returns (bool) { + return x != y; + } + + // Expect 2 mutants: true, false + /// RelationalOperatorReplacement(`x != y` |==> `true`) of: `return x != y;` + function not_equal_not_ord(bool x, bool y) public pure returns (bool) { + return true; + } + + // Expect 3 mutants: (x + y) > z, (x + y) == z, true + function more_equal_over_aor( + uint256 x, + uint256 y, + uint256 z + ) public pure returns (bool) { + return (x + y) >= z; + } + + // Expect 3 mutants: (x + y) > z, (x + y) < z, true + function not_equal_over_aor( + uint256 x, + uint256 y, + uint256 z + ) public pure returns (bool) { + return (x + y) != z; + } +} diff --git a/resources/regressions/ror.json/mutants/21/Ops/ROR/ROR.sol b/resources/regressions/ror.json/mutants/21/Ops/ROR/ROR.sol new file mode 100644 index 0000000..bdeac3a --- /dev/null +++ b/resources/regressions/ror.json/mutants/21/Ops/ROR/ROR.sol @@ -0,0 +1,65 @@ +// SPDX-License-Identifier: GPL-3.0-only +pragma solidity >0.7.0; +pragma experimental ABIEncoderV2; + +// This contract provides test functions for relational operator replacement (ROR) +contract ROR { + // Expect 3 mutants: x <= y, x != y, false + function less(uint256 x, uint256 y) public pure returns (bool) { + return x < y; + } + + // Expect 3 mutants: x < y, x == y, true + function less_equal(uint256 x, uint256 y) public pure returns (bool) { + return x <= y; + } + + // Expect 3 mutants: x >= y, x != y, false + function more(uint256 x, uint256 y) public pure returns (bool) { + return x > y; + } + + // Expect 3 mutants: x > y, x == y, true + function more_equal(uint256 x, uint256 y) public pure returns (bool) { + return x >= y; + } + + // Expect 3 mutants: x >= y, x <= y, false + function equal_ord(uint256 x, uint256 y) public pure returns (bool) { + return x == y; + } + + // Expect 2 mutants: true, false + function equal_not_ord(bool x, bool y) public pure returns (bool) { + return x == y; + } + + // Expect 3 mutants: x > y, x < y, true + function not_equal_ord(uint256 x, uint256 y) public pure returns (bool) { + return x != y; + } + + // Expect 2 mutants: true, false + function not_equal_not_ord(bool x, bool y) public pure returns (bool) { + return x != y; + } + + // Expect 3 mutants: (x + y) > z, (x + y) == z, true + function more_equal_over_aor( + uint256 x, + uint256 y, + uint256 z + /// RelationalOperatorReplacement(`>=` |==> `>`) of: `return (x + y) >= z;` + ) public pure returns (bool) { + return (x + y) > z; + } + + // Expect 3 mutants: (x + y) > z, (x + y) < z, true + function not_equal_over_aor( + uint256 x, + uint256 y, + uint256 z + ) public pure returns (bool) { + return (x + y) != z; + } +} diff --git a/resources/regressions/ror.json/mutants/22/Ops/ROR/ROR.sol b/resources/regressions/ror.json/mutants/22/Ops/ROR/ROR.sol new file mode 100644 index 0000000..430379f --- /dev/null +++ b/resources/regressions/ror.json/mutants/22/Ops/ROR/ROR.sol @@ -0,0 +1,65 @@ +// SPDX-License-Identifier: GPL-3.0-only +pragma solidity >0.7.0; +pragma experimental ABIEncoderV2; + +// This contract provides test functions for relational operator replacement (ROR) +contract ROR { + // Expect 3 mutants: x <= y, x != y, false + function less(uint256 x, uint256 y) public pure returns (bool) { + return x < y; + } + + // Expect 3 mutants: x < y, x == y, true + function less_equal(uint256 x, uint256 y) public pure returns (bool) { + return x <= y; + } + + // Expect 3 mutants: x >= y, x != y, false + function more(uint256 x, uint256 y) public pure returns (bool) { + return x > y; + } + + // Expect 3 mutants: x > y, x == y, true + function more_equal(uint256 x, uint256 y) public pure returns (bool) { + return x >= y; + } + + // Expect 3 mutants: x >= y, x <= y, false + function equal_ord(uint256 x, uint256 y) public pure returns (bool) { + return x == y; + } + + // Expect 2 mutants: true, false + function equal_not_ord(bool x, bool y) public pure returns (bool) { + return x == y; + } + + // Expect 3 mutants: x > y, x < y, true + function not_equal_ord(uint256 x, uint256 y) public pure returns (bool) { + return x != y; + } + + // Expect 2 mutants: true, false + function not_equal_not_ord(bool x, bool y) public pure returns (bool) { + return x != y; + } + + // Expect 3 mutants: (x + y) > z, (x + y) == z, true + function more_equal_over_aor( + uint256 x, + uint256 y, + uint256 z + /// RelationalOperatorReplacement(`>=` |==> `==`) of: `return (x + y) >= z;` + ) public pure returns (bool) { + return (x + y) == z; + } + + // Expect 3 mutants: (x + y) > z, (x + y) < z, true + function not_equal_over_aor( + uint256 x, + uint256 y, + uint256 z + ) public pure returns (bool) { + return (x + y) != z; + } +} diff --git a/resources/regressions/ror.json/mutants/23/Ops/ROR/ROR.sol b/resources/regressions/ror.json/mutants/23/Ops/ROR/ROR.sol new file mode 100644 index 0000000..3d67c15 --- /dev/null +++ b/resources/regressions/ror.json/mutants/23/Ops/ROR/ROR.sol @@ -0,0 +1,65 @@ +// SPDX-License-Identifier: GPL-3.0-only +pragma solidity >0.7.0; +pragma experimental ABIEncoderV2; + +// This contract provides test functions for relational operator replacement (ROR) +contract ROR { + // Expect 3 mutants: x <= y, x != y, false + function less(uint256 x, uint256 y) public pure returns (bool) { + return x < y; + } + + // Expect 3 mutants: x < y, x == y, true + function less_equal(uint256 x, uint256 y) public pure returns (bool) { + return x <= y; + } + + // Expect 3 mutants: x >= y, x != y, false + function more(uint256 x, uint256 y) public pure returns (bool) { + return x > y; + } + + // Expect 3 mutants: x > y, x == y, true + function more_equal(uint256 x, uint256 y) public pure returns (bool) { + return x >= y; + } + + // Expect 3 mutants: x >= y, x <= y, false + function equal_ord(uint256 x, uint256 y) public pure returns (bool) { + return x == y; + } + + // Expect 2 mutants: true, false + function equal_not_ord(bool x, bool y) public pure returns (bool) { + return x == y; + } + + // Expect 3 mutants: x > y, x < y, true + function not_equal_ord(uint256 x, uint256 y) public pure returns (bool) { + return x != y; + } + + // Expect 2 mutants: true, false + function not_equal_not_ord(bool x, bool y) public pure returns (bool) { + return x != y; + } + + // Expect 3 mutants: (x + y) > z, (x + y) == z, true + function more_equal_over_aor( + uint256 x, + uint256 y, + uint256 z + /// RelationalOperatorReplacement(`(x + y) >= z` |==> `true`) of: `return (x + y) >= z;` + ) public pure returns (bool) { + return true; + } + + // Expect 3 mutants: (x + y) > z, (x + y) < z, true + function not_equal_over_aor( + uint256 x, + uint256 y, + uint256 z + ) public pure returns (bool) { + return (x + y) != z; + } +} diff --git a/resources/regressions/ror.json/mutants/24/Ops/ROR/ROR.sol b/resources/regressions/ror.json/mutants/24/Ops/ROR/ROR.sol new file mode 100644 index 0000000..1361261 --- /dev/null +++ b/resources/regressions/ror.json/mutants/24/Ops/ROR/ROR.sol @@ -0,0 +1,65 @@ +// SPDX-License-Identifier: GPL-3.0-only +pragma solidity >0.7.0; +pragma experimental ABIEncoderV2; + +// This contract provides test functions for relational operator replacement (ROR) +contract ROR { + // Expect 3 mutants: x <= y, x != y, false + function less(uint256 x, uint256 y) public pure returns (bool) { + return x < y; + } + + // Expect 3 mutants: x < y, x == y, true + function less_equal(uint256 x, uint256 y) public pure returns (bool) { + return x <= y; + } + + // Expect 3 mutants: x >= y, x != y, false + function more(uint256 x, uint256 y) public pure returns (bool) { + return x > y; + } + + // Expect 3 mutants: x > y, x == y, true + function more_equal(uint256 x, uint256 y) public pure returns (bool) { + return x >= y; + } + + // Expect 3 mutants: x >= y, x <= y, false + function equal_ord(uint256 x, uint256 y) public pure returns (bool) { + return x == y; + } + + // Expect 2 mutants: true, false + function equal_not_ord(bool x, bool y) public pure returns (bool) { + return x == y; + } + + // Expect 3 mutants: x > y, x < y, true + function not_equal_ord(uint256 x, uint256 y) public pure returns (bool) { + return x != y; + } + + // Expect 2 mutants: true, false + function not_equal_not_ord(bool x, bool y) public pure returns (bool) { + return x != y; + } + + // Expect 3 mutants: (x + y) > z, (x + y) == z, true + function more_equal_over_aor( + uint256 x, + uint256 y, + uint256 z + ) public pure returns (bool) { + return (x + y) >= z; + } + + // Expect 3 mutants: (x + y) > z, (x + y) < z, true + function not_equal_over_aor( + uint256 x, + uint256 y, + uint256 z + /// RelationalOperatorReplacement(`!=` |==> `<`) of: `return (x + y) != z;` + ) public pure returns (bool) { + return (x + y) < z; + } +} diff --git a/resources/regressions/ror.json/mutants/25/Ops/ROR/ROR.sol b/resources/regressions/ror.json/mutants/25/Ops/ROR/ROR.sol new file mode 100644 index 0000000..dd0c83c --- /dev/null +++ b/resources/regressions/ror.json/mutants/25/Ops/ROR/ROR.sol @@ -0,0 +1,65 @@ +// SPDX-License-Identifier: GPL-3.0-only +pragma solidity >0.7.0; +pragma experimental ABIEncoderV2; + +// This contract provides test functions for relational operator replacement (ROR) +contract ROR { + // Expect 3 mutants: x <= y, x != y, false + function less(uint256 x, uint256 y) public pure returns (bool) { + return x < y; + } + + // Expect 3 mutants: x < y, x == y, true + function less_equal(uint256 x, uint256 y) public pure returns (bool) { + return x <= y; + } + + // Expect 3 mutants: x >= y, x != y, false + function more(uint256 x, uint256 y) public pure returns (bool) { + return x > y; + } + + // Expect 3 mutants: x > y, x == y, true + function more_equal(uint256 x, uint256 y) public pure returns (bool) { + return x >= y; + } + + // Expect 3 mutants: x >= y, x <= y, false + function equal_ord(uint256 x, uint256 y) public pure returns (bool) { + return x == y; + } + + // Expect 2 mutants: true, false + function equal_not_ord(bool x, bool y) public pure returns (bool) { + return x == y; + } + + // Expect 3 mutants: x > y, x < y, true + function not_equal_ord(uint256 x, uint256 y) public pure returns (bool) { + return x != y; + } + + // Expect 2 mutants: true, false + function not_equal_not_ord(bool x, bool y) public pure returns (bool) { + return x != y; + } + + // Expect 3 mutants: (x + y) > z, (x + y) == z, true + function more_equal_over_aor( + uint256 x, + uint256 y, + uint256 z + ) public pure returns (bool) { + return (x + y) >= z; + } + + // Expect 3 mutants: (x + y) > z, (x + y) < z, true + function not_equal_over_aor( + uint256 x, + uint256 y, + uint256 z + /// RelationalOperatorReplacement(`!=` |==> `>`) of: `return (x + y) != z;` + ) public pure returns (bool) { + return (x + y) > z; + } +} diff --git a/resources/regressions/ror.json/mutants/26/Ops/ROR/ROR.sol b/resources/regressions/ror.json/mutants/26/Ops/ROR/ROR.sol new file mode 100644 index 0000000..8488911 --- /dev/null +++ b/resources/regressions/ror.json/mutants/26/Ops/ROR/ROR.sol @@ -0,0 +1,65 @@ +// SPDX-License-Identifier: GPL-3.0-only +pragma solidity >0.7.0; +pragma experimental ABIEncoderV2; + +// This contract provides test functions for relational operator replacement (ROR) +contract ROR { + // Expect 3 mutants: x <= y, x != y, false + function less(uint256 x, uint256 y) public pure returns (bool) { + return x < y; + } + + // Expect 3 mutants: x < y, x == y, true + function less_equal(uint256 x, uint256 y) public pure returns (bool) { + return x <= y; + } + + // Expect 3 mutants: x >= y, x != y, false + function more(uint256 x, uint256 y) public pure returns (bool) { + return x > y; + } + + // Expect 3 mutants: x > y, x == y, true + function more_equal(uint256 x, uint256 y) public pure returns (bool) { + return x >= y; + } + + // Expect 3 mutants: x >= y, x <= y, false + function equal_ord(uint256 x, uint256 y) public pure returns (bool) { + return x == y; + } + + // Expect 2 mutants: true, false + function equal_not_ord(bool x, bool y) public pure returns (bool) { + return x == y; + } + + // Expect 3 mutants: x > y, x < y, true + function not_equal_ord(uint256 x, uint256 y) public pure returns (bool) { + return x != y; + } + + // Expect 2 mutants: true, false + function not_equal_not_ord(bool x, bool y) public pure returns (bool) { + return x != y; + } + + // Expect 3 mutants: (x + y) > z, (x + y) == z, true + function more_equal_over_aor( + uint256 x, + uint256 y, + uint256 z + ) public pure returns (bool) { + return (x + y) >= z; + } + + // Expect 3 mutants: (x + y) > z, (x + y) < z, true + function not_equal_over_aor( + uint256 x, + uint256 y, + uint256 z + /// RelationalOperatorReplacement(`(x + y) != z` |==> `true`) of: `return (x + y) != z;` + ) public pure returns (bool) { + return true; + } +} diff --git a/resources/regressions/ror.json/mutants/3/Ops/ROR/ROR.sol b/resources/regressions/ror.json/mutants/3/Ops/ROR/ROR.sol new file mode 100644 index 0000000..6141947 --- /dev/null +++ b/resources/regressions/ror.json/mutants/3/Ops/ROR/ROR.sol @@ -0,0 +1,65 @@ +// SPDX-License-Identifier: GPL-3.0-only +pragma solidity >0.7.0; +pragma experimental ABIEncoderV2; + +// This contract provides test functions for relational operator replacement (ROR) +contract ROR { + // Expect 3 mutants: x <= y, x != y, false + /// RelationalOperatorReplacement(`x < y` |==> `false`) of: `return x < y;` + function less(uint256 x, uint256 y) public pure returns (bool) { + return false; + } + + // Expect 3 mutants: x < y, x == y, true + function less_equal(uint256 x, uint256 y) public pure returns (bool) { + return x <= y; + } + + // Expect 3 mutants: x >= y, x != y, false + function more(uint256 x, uint256 y) public pure returns (bool) { + return x > y; + } + + // Expect 3 mutants: x > y, x == y, true + function more_equal(uint256 x, uint256 y) public pure returns (bool) { + return x >= y; + } + + // Expect 3 mutants: x >= y, x <= y, false + function equal_ord(uint256 x, uint256 y) public pure returns (bool) { + return x == y; + } + + // Expect 2 mutants: true, false + function equal_not_ord(bool x, bool y) public pure returns (bool) { + return x == y; + } + + // Expect 3 mutants: x > y, x < y, true + function not_equal_ord(uint256 x, uint256 y) public pure returns (bool) { + return x != y; + } + + // Expect 2 mutants: true, false + function not_equal_not_ord(bool x, bool y) public pure returns (bool) { + return x != y; + } + + // Expect 3 mutants: (x + y) > z, (x + y) == z, true + function more_equal_over_aor( + uint256 x, + uint256 y, + uint256 z + ) public pure returns (bool) { + return (x + y) >= z; + } + + // Expect 3 mutants: (x + y) > z, (x + y) < z, true + function not_equal_over_aor( + uint256 x, + uint256 y, + uint256 z + ) public pure returns (bool) { + return (x + y) != z; + } +} diff --git a/resources/regressions/ror.json/mutants/4/Ops/ROR/ROR.sol b/resources/regressions/ror.json/mutants/4/Ops/ROR/ROR.sol new file mode 100644 index 0000000..9f8ccd0 --- /dev/null +++ b/resources/regressions/ror.json/mutants/4/Ops/ROR/ROR.sol @@ -0,0 +1,65 @@ +// SPDX-License-Identifier: GPL-3.0-only +pragma solidity >0.7.0; +pragma experimental ABIEncoderV2; + +// This contract provides test functions for relational operator replacement (ROR) +contract ROR { + // Expect 3 mutants: x <= y, x != y, false + function less(uint256 x, uint256 y) public pure returns (bool) { + return x < y; + } + + // Expect 3 mutants: x < y, x == y, true + /// RelationalOperatorReplacement(`<=` |==> `<`) of: `return x <= y;` + function less_equal(uint256 x, uint256 y) public pure returns (bool) { + return x < y; + } + + // Expect 3 mutants: x >= y, x != y, false + function more(uint256 x, uint256 y) public pure returns (bool) { + return x > y; + } + + // Expect 3 mutants: x > y, x == y, true + function more_equal(uint256 x, uint256 y) public pure returns (bool) { + return x >= y; + } + + // Expect 3 mutants: x >= y, x <= y, false + function equal_ord(uint256 x, uint256 y) public pure returns (bool) { + return x == y; + } + + // Expect 2 mutants: true, false + function equal_not_ord(bool x, bool y) public pure returns (bool) { + return x == y; + } + + // Expect 3 mutants: x > y, x < y, true + function not_equal_ord(uint256 x, uint256 y) public pure returns (bool) { + return x != y; + } + + // Expect 2 mutants: true, false + function not_equal_not_ord(bool x, bool y) public pure returns (bool) { + return x != y; + } + + // Expect 3 mutants: (x + y) > z, (x + y) == z, true + function more_equal_over_aor( + uint256 x, + uint256 y, + uint256 z + ) public pure returns (bool) { + return (x + y) >= z; + } + + // Expect 3 mutants: (x + y) > z, (x + y) < z, true + function not_equal_over_aor( + uint256 x, + uint256 y, + uint256 z + ) public pure returns (bool) { + return (x + y) != z; + } +} diff --git a/resources/regressions/ror.json/mutants/5/Ops/ROR/ROR.sol b/resources/regressions/ror.json/mutants/5/Ops/ROR/ROR.sol new file mode 100644 index 0000000..18e38f3 --- /dev/null +++ b/resources/regressions/ror.json/mutants/5/Ops/ROR/ROR.sol @@ -0,0 +1,65 @@ +// SPDX-License-Identifier: GPL-3.0-only +pragma solidity >0.7.0; +pragma experimental ABIEncoderV2; + +// This contract provides test functions for relational operator replacement (ROR) +contract ROR { + // Expect 3 mutants: x <= y, x != y, false + function less(uint256 x, uint256 y) public pure returns (bool) { + return x < y; + } + + // Expect 3 mutants: x < y, x == y, true + /// RelationalOperatorReplacement(`<=` |==> `==`) of: `return x <= y;` + function less_equal(uint256 x, uint256 y) public pure returns (bool) { + return x == y; + } + + // Expect 3 mutants: x >= y, x != y, false + function more(uint256 x, uint256 y) public pure returns (bool) { + return x > y; + } + + // Expect 3 mutants: x > y, x == y, true + function more_equal(uint256 x, uint256 y) public pure returns (bool) { + return x >= y; + } + + // Expect 3 mutants: x >= y, x <= y, false + function equal_ord(uint256 x, uint256 y) public pure returns (bool) { + return x == y; + } + + // Expect 2 mutants: true, false + function equal_not_ord(bool x, bool y) public pure returns (bool) { + return x == y; + } + + // Expect 3 mutants: x > y, x < y, true + function not_equal_ord(uint256 x, uint256 y) public pure returns (bool) { + return x != y; + } + + // Expect 2 mutants: true, false + function not_equal_not_ord(bool x, bool y) public pure returns (bool) { + return x != y; + } + + // Expect 3 mutants: (x + y) > z, (x + y) == z, true + function more_equal_over_aor( + uint256 x, + uint256 y, + uint256 z + ) public pure returns (bool) { + return (x + y) >= z; + } + + // Expect 3 mutants: (x + y) > z, (x + y) < z, true + function not_equal_over_aor( + uint256 x, + uint256 y, + uint256 z + ) public pure returns (bool) { + return (x + y) != z; + } +} diff --git a/resources/regressions/ror.json/mutants/6/Ops/ROR/ROR.sol b/resources/regressions/ror.json/mutants/6/Ops/ROR/ROR.sol new file mode 100644 index 0000000..55dd7c7 --- /dev/null +++ b/resources/regressions/ror.json/mutants/6/Ops/ROR/ROR.sol @@ -0,0 +1,65 @@ +// SPDX-License-Identifier: GPL-3.0-only +pragma solidity >0.7.0; +pragma experimental ABIEncoderV2; + +// This contract provides test functions for relational operator replacement (ROR) +contract ROR { + // Expect 3 mutants: x <= y, x != y, false + function less(uint256 x, uint256 y) public pure returns (bool) { + return x < y; + } + + // Expect 3 mutants: x < y, x == y, true + /// RelationalOperatorReplacement(`x <= y` |==> `true`) of: `return x <= y;` + function less_equal(uint256 x, uint256 y) public pure returns (bool) { + return true; + } + + // Expect 3 mutants: x >= y, x != y, false + function more(uint256 x, uint256 y) public pure returns (bool) { + return x > y; + } + + // Expect 3 mutants: x > y, x == y, true + function more_equal(uint256 x, uint256 y) public pure returns (bool) { + return x >= y; + } + + // Expect 3 mutants: x >= y, x <= y, false + function equal_ord(uint256 x, uint256 y) public pure returns (bool) { + return x == y; + } + + // Expect 2 mutants: true, false + function equal_not_ord(bool x, bool y) public pure returns (bool) { + return x == y; + } + + // Expect 3 mutants: x > y, x < y, true + function not_equal_ord(uint256 x, uint256 y) public pure returns (bool) { + return x != y; + } + + // Expect 2 mutants: true, false + function not_equal_not_ord(bool x, bool y) public pure returns (bool) { + return x != y; + } + + // Expect 3 mutants: (x + y) > z, (x + y) == z, true + function more_equal_over_aor( + uint256 x, + uint256 y, + uint256 z + ) public pure returns (bool) { + return (x + y) >= z; + } + + // Expect 3 mutants: (x + y) > z, (x + y) < z, true + function not_equal_over_aor( + uint256 x, + uint256 y, + uint256 z + ) public pure returns (bool) { + return (x + y) != z; + } +} diff --git a/resources/regressions/ror.json/mutants/7/Ops/ROR/ROR.sol b/resources/regressions/ror.json/mutants/7/Ops/ROR/ROR.sol new file mode 100644 index 0000000..52949d0 --- /dev/null +++ b/resources/regressions/ror.json/mutants/7/Ops/ROR/ROR.sol @@ -0,0 +1,65 @@ +// SPDX-License-Identifier: GPL-3.0-only +pragma solidity >0.7.0; +pragma experimental ABIEncoderV2; + +// This contract provides test functions for relational operator replacement (ROR) +contract ROR { + // Expect 3 mutants: x <= y, x != y, false + function less(uint256 x, uint256 y) public pure returns (bool) { + return x < y; + } + + // Expect 3 mutants: x < y, x == y, true + function less_equal(uint256 x, uint256 y) public pure returns (bool) { + return x <= y; + } + + // Expect 3 mutants: x >= y, x != y, false + /// RelationalOperatorReplacement(`>` |==> `>=`) of: `return x > y;` + function more(uint256 x, uint256 y) public pure returns (bool) { + return x >= y; + } + + // Expect 3 mutants: x > y, x == y, true + function more_equal(uint256 x, uint256 y) public pure returns (bool) { + return x >= y; + } + + // Expect 3 mutants: x >= y, x <= y, false + function equal_ord(uint256 x, uint256 y) public pure returns (bool) { + return x == y; + } + + // Expect 2 mutants: true, false + function equal_not_ord(bool x, bool y) public pure returns (bool) { + return x == y; + } + + // Expect 3 mutants: x > y, x < y, true + function not_equal_ord(uint256 x, uint256 y) public pure returns (bool) { + return x != y; + } + + // Expect 2 mutants: true, false + function not_equal_not_ord(bool x, bool y) public pure returns (bool) { + return x != y; + } + + // Expect 3 mutants: (x + y) > z, (x + y) == z, true + function more_equal_over_aor( + uint256 x, + uint256 y, + uint256 z + ) public pure returns (bool) { + return (x + y) >= z; + } + + // Expect 3 mutants: (x + y) > z, (x + y) < z, true + function not_equal_over_aor( + uint256 x, + uint256 y, + uint256 z + ) public pure returns (bool) { + return (x + y) != z; + } +} diff --git a/resources/regressions/ror.json/mutants/8/Ops/ROR/ROR.sol b/resources/regressions/ror.json/mutants/8/Ops/ROR/ROR.sol new file mode 100644 index 0000000..a3e1632 --- /dev/null +++ b/resources/regressions/ror.json/mutants/8/Ops/ROR/ROR.sol @@ -0,0 +1,65 @@ +// SPDX-License-Identifier: GPL-3.0-only +pragma solidity >0.7.0; +pragma experimental ABIEncoderV2; + +// This contract provides test functions for relational operator replacement (ROR) +contract ROR { + // Expect 3 mutants: x <= y, x != y, false + function less(uint256 x, uint256 y) public pure returns (bool) { + return x < y; + } + + // Expect 3 mutants: x < y, x == y, true + function less_equal(uint256 x, uint256 y) public pure returns (bool) { + return x <= y; + } + + // Expect 3 mutants: x >= y, x != y, false + /// RelationalOperatorReplacement(`>` |==> `!=`) of: `return x > y;` + function more(uint256 x, uint256 y) public pure returns (bool) { + return x != y; + } + + // Expect 3 mutants: x > y, x == y, true + function more_equal(uint256 x, uint256 y) public pure returns (bool) { + return x >= y; + } + + // Expect 3 mutants: x >= y, x <= y, false + function equal_ord(uint256 x, uint256 y) public pure returns (bool) { + return x == y; + } + + // Expect 2 mutants: true, false + function equal_not_ord(bool x, bool y) public pure returns (bool) { + return x == y; + } + + // Expect 3 mutants: x > y, x < y, true + function not_equal_ord(uint256 x, uint256 y) public pure returns (bool) { + return x != y; + } + + // Expect 2 mutants: true, false + function not_equal_not_ord(bool x, bool y) public pure returns (bool) { + return x != y; + } + + // Expect 3 mutants: (x + y) > z, (x + y) == z, true + function more_equal_over_aor( + uint256 x, + uint256 y, + uint256 z + ) public pure returns (bool) { + return (x + y) >= z; + } + + // Expect 3 mutants: (x + y) > z, (x + y) < z, true + function not_equal_over_aor( + uint256 x, + uint256 y, + uint256 z + ) public pure returns (bool) { + return (x + y) != z; + } +} diff --git a/resources/regressions/ror.json/mutants/9/Ops/ROR/ROR.sol b/resources/regressions/ror.json/mutants/9/Ops/ROR/ROR.sol new file mode 100644 index 0000000..a902442 --- /dev/null +++ b/resources/regressions/ror.json/mutants/9/Ops/ROR/ROR.sol @@ -0,0 +1,65 @@ +// SPDX-License-Identifier: GPL-3.0-only +pragma solidity >0.7.0; +pragma experimental ABIEncoderV2; + +// This contract provides test functions for relational operator replacement (ROR) +contract ROR { + // Expect 3 mutants: x <= y, x != y, false + function less(uint256 x, uint256 y) public pure returns (bool) { + return x < y; + } + + // Expect 3 mutants: x < y, x == y, true + function less_equal(uint256 x, uint256 y) public pure returns (bool) { + return x <= y; + } + + // Expect 3 mutants: x >= y, x != y, false + /// RelationalOperatorReplacement(`x > y` |==> `false`) of: `return x > y;` + function more(uint256 x, uint256 y) public pure returns (bool) { + return false; + } + + // Expect 3 mutants: x > y, x == y, true + function more_equal(uint256 x, uint256 y) public pure returns (bool) { + return x >= y; + } + + // Expect 3 mutants: x >= y, x <= y, false + function equal_ord(uint256 x, uint256 y) public pure returns (bool) { + return x == y; + } + + // Expect 2 mutants: true, false + function equal_not_ord(bool x, bool y) public pure returns (bool) { + return x == y; + } + + // Expect 3 mutants: x > y, x < y, true + function not_equal_ord(uint256 x, uint256 y) public pure returns (bool) { + return x != y; + } + + // Expect 2 mutants: true, false + function not_equal_not_ord(bool x, bool y) public pure returns (bool) { + return x != y; + } + + // Expect 3 mutants: (x + y) > z, (x + y) == z, true + function more_equal_over_aor( + uint256 x, + uint256 y, + uint256 z + ) public pure returns (bool) { + return (x + y) >= z; + } + + // Expect 3 mutants: (x + y) > z, (x + y) < z, true + function not_equal_over_aor( + uint256 x, + uint256 y, + uint256 z + ) public pure returns (bool) { + return (x + y) != z; + } +} diff --git a/resources/regressions/sanity-config.json/gambit_results.json b/resources/regressions/sanity-config.json/gambit_results.json deleted file mode 100644 index 3958608..0000000 --- a/resources/regressions/sanity-config.json/gambit_results.json +++ /dev/null @@ -1,9 +0,0 @@ -[ - { - "description": "BinaryOpMutation", - "diff": "--- original\n+++ mutant\n@@ -20,7 +20,8 @@\n }\n \n function myModulo(uint256 x, uint256 y) public pure returns (uint256) {\n-\treturn x % y;\n+\t/// BinaryOpMutation(`%` |==> `-`) of: `return x % y;`\n+\treturn x-y;\n }\n \n function myExponentiation(uint256 x, uint256 y) public pure returns (uint256) {\n", - "id": "1", - "name": "mutants/1/BinaryOpMutation.sol", - "original": "BinaryOpMutation.sol", - } -] \ No newline at end of file diff --git a/resources/regressions/sanity-config.json/input_json/BinaryOpMutation.sol_json.ast b/resources/regressions/sanity-config.json/input_json/BinaryOpMutation.sol_json.ast deleted file mode 100644 index b02050b..0000000 --- a/resources/regressions/sanity-config.json/input_json/BinaryOpMutation.sol_json.ast +++ /dev/null @@ -1,1183 +0,0 @@ -{ - "absolutePath": "benchmarks/BinaryOpMutation/BinaryOpMutation.sol", - "exportedSymbols": - { - "BinaryOpMutation": - [ - 87 - ] - }, - "id": 88, - "license": "GPL-3.0-only", - "nodeType": "SourceUnit", - "nodes": - [ - { - "id": 1, - "literals": - [ - "solidity", - ">", - "0.7", - ".0" - ], - "nodeType": "PragmaDirective", - "src": "41:23:0" - }, - { - "id": 2, - "literals": - [ - "experimental", - "ABIEncoderV2" - ], - "nodeType": "PragmaDirective", - "src": "65:33:0" - }, - { - "abstract": false, - "baseContracts": [], - "canonicalName": "BinaryOpMutation", - "contractDependencies": [], - "contractKind": "contract", - "fullyImplemented": true, - "id": 87, - "linearizedBaseContracts": - [ - 87 - ], - "name": "BinaryOpMutation", - "nameLocation": "109:16:0", - "nodeType": "ContractDefinition", - "nodes": - [ - { - "body": - { - "id": 15, - "nodeType": "Block", - "src": "204:22:0", - "statements": - [ - { - "expression": - { - "commonType": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 13, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": - { - "id": 11, - "name": "x", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4, - "src": "214:1:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "+", - "rightExpression": - { - "id": 12, - "name": "y", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 6, - "src": "218:1:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "214:5:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "functionReturnParameters": 10, - "id": 14, - "nodeType": "Return", - "src": "207:12:0" - } - ] - }, - "functionSelector": "04b53fe4", - "id": 16, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "myAddition", - "nameLocation": "141:10:0", - "nodeType": "FunctionDefinition", - "parameters": - { - "id": 7, - "nodeType": "ParameterList", - "parameters": - [ - { - "constant": false, - "id": 4, - "mutability": "mutable", - "name": "x", - "nameLocation": "160:1:0", - "nodeType": "VariableDeclaration", - "scope": 16, - "src": "152:9:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": - { - "id": 3, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "152:7:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 6, - "mutability": "mutable", - "name": "y", - "nameLocation": "171:1:0", - "nodeType": "VariableDeclaration", - "scope": 16, - "src": "163:9:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": - { - "id": 5, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "163:7:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - } - ], - "src": "151:22:0" - }, - "returnParameters": - { - "id": 10, - "nodeType": "ParameterList", - "parameters": - [ - { - "constant": false, - "id": 9, - "mutability": "mutable", - "name": "", - "nameLocation": "-1:-1:-1", - "nodeType": "VariableDeclaration", - "scope": 16, - "src": "195:7:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": - { - "id": 8, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "195:7:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - } - ], - "src": "194:9:0" - }, - "scope": 87, - "src": "132:94:0", - "stateMutability": "pure", - "virtual": false, - "visibility": "public" - }, - { - "body": - { - "id": 29, - "nodeType": "Block", - "src": "307:22:0", - "statements": - [ - { - "expression": - { - "commonType": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 27, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": - { - "id": 25, - "name": "x", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 18, - "src": "317:1:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "-", - "rightExpression": - { - "id": 26, - "name": "y", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 20, - "src": "321:1:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "317:5:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "functionReturnParameters": 24, - "id": 28, - "nodeType": "Return", - "src": "310:12:0" - } - ] - }, - "functionSelector": "b3d09aaa", - "id": 30, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "mySubtraction", - "nameLocation": "241:13:0", - "nodeType": "FunctionDefinition", - "parameters": - { - "id": 21, - "nodeType": "ParameterList", - "parameters": - [ - { - "constant": false, - "id": 18, - "mutability": "mutable", - "name": "x", - "nameLocation": "263:1:0", - "nodeType": "VariableDeclaration", - "scope": 30, - "src": "255:9:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": - { - "id": 17, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "255:7:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 20, - "mutability": "mutable", - "name": "y", - "nameLocation": "274:1:0", - "nodeType": "VariableDeclaration", - "scope": 30, - "src": "266:9:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": - { - "id": 19, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "266:7:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - } - ], - "src": "254:22:0" - }, - "returnParameters": - { - "id": 24, - "nodeType": "ParameterList", - "parameters": - [ - { - "constant": false, - "id": 23, - "mutability": "mutable", - "name": "", - "nameLocation": "-1:-1:-1", - "nodeType": "VariableDeclaration", - "scope": 30, - "src": "298:7:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": - { - "id": 22, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "298:7:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - } - ], - "src": "297:9:0" - }, - "scope": 87, - "src": "232:97:0", - "stateMutability": "pure", - "virtual": false, - "visibility": "public" - }, - { - "body": - { - "id": 43, - "nodeType": "Block", - "src": "413:22:0", - "statements": - [ - { - "expression": - { - "commonType": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 41, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": - { - "id": 39, - "name": "x", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 32, - "src": "423:1:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "*", - "rightExpression": - { - "id": 40, - "name": "y", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 34, - "src": "427:1:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "423:5:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "functionReturnParameters": 38, - "id": 42, - "nodeType": "Return", - "src": "416:12:0" - } - ] - }, - "functionSelector": "6831fd12", - "id": 44, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "myMultiplication", - "nameLocation": "344:16:0", - "nodeType": "FunctionDefinition", - "parameters": - { - "id": 35, - "nodeType": "ParameterList", - "parameters": - [ - { - "constant": false, - "id": 32, - "mutability": "mutable", - "name": "x", - "nameLocation": "369:1:0", - "nodeType": "VariableDeclaration", - "scope": 44, - "src": "361:9:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": - { - "id": 31, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "361:7:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 34, - "mutability": "mutable", - "name": "y", - "nameLocation": "380:1:0", - "nodeType": "VariableDeclaration", - "scope": 44, - "src": "372:9:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": - { - "id": 33, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "372:7:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - } - ], - "src": "360:22:0" - }, - "returnParameters": - { - "id": 38, - "nodeType": "ParameterList", - "parameters": - [ - { - "constant": false, - "id": 37, - "mutability": "mutable", - "name": "", - "nameLocation": "-1:-1:-1", - "nodeType": "VariableDeclaration", - "scope": 44, - "src": "404:7:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": - { - "id": 36, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "404:7:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - } - ], - "src": "403:9:0" - }, - "scope": 87, - "src": "335:100:0", - "stateMutability": "pure", - "virtual": false, - "visibility": "public" - }, - { - "body": - { - "id": 57, - "nodeType": "Block", - "src": "513:22:0", - "statements": - [ - { - "expression": - { - "commonType": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 55, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": - { - "id": 53, - "name": "x", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 46, - "src": "523:1:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "/", - "rightExpression": - { - "id": 54, - "name": "y", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 48, - "src": "527:1:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "523:5:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "functionReturnParameters": 52, - "id": 56, - "nodeType": "Return", - "src": "516:12:0" - } - ] - }, - "functionSelector": "9d4f4e60", - "id": 58, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "myDivision", - "nameLocation": "450:10:0", - "nodeType": "FunctionDefinition", - "parameters": - { - "id": 49, - "nodeType": "ParameterList", - "parameters": - [ - { - "constant": false, - "id": 46, - "mutability": "mutable", - "name": "x", - "nameLocation": "469:1:0", - "nodeType": "VariableDeclaration", - "scope": 58, - "src": "461:9:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": - { - "id": 45, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "461:7:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 48, - "mutability": "mutable", - "name": "y", - "nameLocation": "480:1:0", - "nodeType": "VariableDeclaration", - "scope": 58, - "src": "472:9:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": - { - "id": 47, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "472:7:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - } - ], - "src": "460:22:0" - }, - "returnParameters": - { - "id": 52, - "nodeType": "ParameterList", - "parameters": - [ - { - "constant": false, - "id": 51, - "mutability": "mutable", - "name": "", - "nameLocation": "-1:-1:-1", - "nodeType": "VariableDeclaration", - "scope": 58, - "src": "504:7:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": - { - "id": 50, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "504:7:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - } - ], - "src": "503:9:0" - }, - "scope": 87, - "src": "441:94:0", - "stateMutability": "pure", - "virtual": false, - "visibility": "public" - }, - { - "body": - { - "id": 71, - "nodeType": "Block", - "src": "611:22:0", - "statements": - [ - { - "expression": - { - "commonType": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 69, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": - { - "id": 67, - "name": "x", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 60, - "src": "621:1:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "%", - "rightExpression": - { - "id": 68, - "name": "y", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 62, - "src": "625:1:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "621:5:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "functionReturnParameters": 66, - "id": 70, - "nodeType": "Return", - "src": "614:12:0" - } - ] - }, - "functionSelector": "dc6092a8", - "id": 72, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "myModulo", - "nameLocation": "550:8:0", - "nodeType": "FunctionDefinition", - "parameters": - { - "id": 63, - "nodeType": "ParameterList", - "parameters": - [ - { - "constant": false, - "id": 60, - "mutability": "mutable", - "name": "x", - "nameLocation": "567:1:0", - "nodeType": "VariableDeclaration", - "scope": 72, - "src": "559:9:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": - { - "id": 59, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "559:7:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 62, - "mutability": "mutable", - "name": "y", - "nameLocation": "578:1:0", - "nodeType": "VariableDeclaration", - "scope": 72, - "src": "570:9:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": - { - "id": 61, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "570:7:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - } - ], - "src": "558:22:0" - }, - "returnParameters": - { - "id": 66, - "nodeType": "ParameterList", - "parameters": - [ - { - "constant": false, - "id": 65, - "mutability": "mutable", - "name": "", - "nameLocation": "-1:-1:-1", - "nodeType": "VariableDeclaration", - "scope": 72, - "src": "602:7:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": - { - "id": 64, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "602:7:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - } - ], - "src": "601:9:0" - }, - "scope": 87, - "src": "541:92:0", - "stateMutability": "pure", - "virtual": false, - "visibility": "public" - }, - { - "body": - { - "id": 85, - "nodeType": "Block", - "src": "717:23:0", - "statements": - [ - { - "expression": - { - "commonType": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 83, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": - { - "id": 81, - "name": "x", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 74, - "src": "727:1:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "**", - "rightExpression": - { - "id": 82, - "name": "y", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 76, - "src": "732:1:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "727:6:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "functionReturnParameters": 80, - "id": 84, - "nodeType": "Return", - "src": "720:13:0" - } - ] - }, - "functionSelector": "df159c7b", - "id": 86, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "myExponentiation", - "nameLocation": "648:16:0", - "nodeType": "FunctionDefinition", - "parameters": - { - "id": 77, - "nodeType": "ParameterList", - "parameters": - [ - { - "constant": false, - "id": 74, - "mutability": "mutable", - "name": "x", - "nameLocation": "673:1:0", - "nodeType": "VariableDeclaration", - "scope": 86, - "src": "665:9:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": - { - "id": 73, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "665:7:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 76, - "mutability": "mutable", - "name": "y", - "nameLocation": "684:1:0", - "nodeType": "VariableDeclaration", - "scope": 86, - "src": "676:9:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": - { - "id": 75, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "676:7:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - } - ], - "src": "664:22:0" - }, - "returnParameters": - { - "id": 80, - "nodeType": "ParameterList", - "parameters": - [ - { - "constant": false, - "id": 79, - "mutability": "mutable", - "name": "", - "nameLocation": "-1:-1:-1", - "nodeType": "VariableDeclaration", - "scope": 86, - "src": "708:7:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": - { - "id": 78, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "708:7:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - } - ], - "src": "707:9:0" - }, - "scope": 87, - "src": "639:101:0", - "stateMutability": "pure", - "virtual": false, - "visibility": "public" - } - ], - "scope": 88, - "src": "100:643:0", - "usedErrors": [] - } - ], - "src": "41:703:0" -} \ No newline at end of file diff --git a/resources/regressions/sanity-config.json/input_json/BinaryOpMutation.sol_json.ast.json b/resources/regressions/sanity-config.json/input_json/BinaryOpMutation.sol_json.ast.json deleted file mode 100644 index b02050b..0000000 --- a/resources/regressions/sanity-config.json/input_json/BinaryOpMutation.sol_json.ast.json +++ /dev/null @@ -1,1183 +0,0 @@ -{ - "absolutePath": "benchmarks/BinaryOpMutation/BinaryOpMutation.sol", - "exportedSymbols": - { - "BinaryOpMutation": - [ - 87 - ] - }, - "id": 88, - "license": "GPL-3.0-only", - "nodeType": "SourceUnit", - "nodes": - [ - { - "id": 1, - "literals": - [ - "solidity", - ">", - "0.7", - ".0" - ], - "nodeType": "PragmaDirective", - "src": "41:23:0" - }, - { - "id": 2, - "literals": - [ - "experimental", - "ABIEncoderV2" - ], - "nodeType": "PragmaDirective", - "src": "65:33:0" - }, - { - "abstract": false, - "baseContracts": [], - "canonicalName": "BinaryOpMutation", - "contractDependencies": [], - "contractKind": "contract", - "fullyImplemented": true, - "id": 87, - "linearizedBaseContracts": - [ - 87 - ], - "name": "BinaryOpMutation", - "nameLocation": "109:16:0", - "nodeType": "ContractDefinition", - "nodes": - [ - { - "body": - { - "id": 15, - "nodeType": "Block", - "src": "204:22:0", - "statements": - [ - { - "expression": - { - "commonType": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 13, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": - { - "id": 11, - "name": "x", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4, - "src": "214:1:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "+", - "rightExpression": - { - "id": 12, - "name": "y", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 6, - "src": "218:1:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "214:5:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "functionReturnParameters": 10, - "id": 14, - "nodeType": "Return", - "src": "207:12:0" - } - ] - }, - "functionSelector": "04b53fe4", - "id": 16, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "myAddition", - "nameLocation": "141:10:0", - "nodeType": "FunctionDefinition", - "parameters": - { - "id": 7, - "nodeType": "ParameterList", - "parameters": - [ - { - "constant": false, - "id": 4, - "mutability": "mutable", - "name": "x", - "nameLocation": "160:1:0", - "nodeType": "VariableDeclaration", - "scope": 16, - "src": "152:9:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": - { - "id": 3, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "152:7:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 6, - "mutability": "mutable", - "name": "y", - "nameLocation": "171:1:0", - "nodeType": "VariableDeclaration", - "scope": 16, - "src": "163:9:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": - { - "id": 5, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "163:7:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - } - ], - "src": "151:22:0" - }, - "returnParameters": - { - "id": 10, - "nodeType": "ParameterList", - "parameters": - [ - { - "constant": false, - "id": 9, - "mutability": "mutable", - "name": "", - "nameLocation": "-1:-1:-1", - "nodeType": "VariableDeclaration", - "scope": 16, - "src": "195:7:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": - { - "id": 8, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "195:7:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - } - ], - "src": "194:9:0" - }, - "scope": 87, - "src": "132:94:0", - "stateMutability": "pure", - "virtual": false, - "visibility": "public" - }, - { - "body": - { - "id": 29, - "nodeType": "Block", - "src": "307:22:0", - "statements": - [ - { - "expression": - { - "commonType": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 27, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": - { - "id": 25, - "name": "x", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 18, - "src": "317:1:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "-", - "rightExpression": - { - "id": 26, - "name": "y", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 20, - "src": "321:1:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "317:5:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "functionReturnParameters": 24, - "id": 28, - "nodeType": "Return", - "src": "310:12:0" - } - ] - }, - "functionSelector": "b3d09aaa", - "id": 30, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "mySubtraction", - "nameLocation": "241:13:0", - "nodeType": "FunctionDefinition", - "parameters": - { - "id": 21, - "nodeType": "ParameterList", - "parameters": - [ - { - "constant": false, - "id": 18, - "mutability": "mutable", - "name": "x", - "nameLocation": "263:1:0", - "nodeType": "VariableDeclaration", - "scope": 30, - "src": "255:9:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": - { - "id": 17, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "255:7:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 20, - "mutability": "mutable", - "name": "y", - "nameLocation": "274:1:0", - "nodeType": "VariableDeclaration", - "scope": 30, - "src": "266:9:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": - { - "id": 19, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "266:7:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - } - ], - "src": "254:22:0" - }, - "returnParameters": - { - "id": 24, - "nodeType": "ParameterList", - "parameters": - [ - { - "constant": false, - "id": 23, - "mutability": "mutable", - "name": "", - "nameLocation": "-1:-1:-1", - "nodeType": "VariableDeclaration", - "scope": 30, - "src": "298:7:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": - { - "id": 22, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "298:7:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - } - ], - "src": "297:9:0" - }, - "scope": 87, - "src": "232:97:0", - "stateMutability": "pure", - "virtual": false, - "visibility": "public" - }, - { - "body": - { - "id": 43, - "nodeType": "Block", - "src": "413:22:0", - "statements": - [ - { - "expression": - { - "commonType": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 41, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": - { - "id": 39, - "name": "x", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 32, - "src": "423:1:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "*", - "rightExpression": - { - "id": 40, - "name": "y", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 34, - "src": "427:1:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "423:5:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "functionReturnParameters": 38, - "id": 42, - "nodeType": "Return", - "src": "416:12:0" - } - ] - }, - "functionSelector": "6831fd12", - "id": 44, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "myMultiplication", - "nameLocation": "344:16:0", - "nodeType": "FunctionDefinition", - "parameters": - { - "id": 35, - "nodeType": "ParameterList", - "parameters": - [ - { - "constant": false, - "id": 32, - "mutability": "mutable", - "name": "x", - "nameLocation": "369:1:0", - "nodeType": "VariableDeclaration", - "scope": 44, - "src": "361:9:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": - { - "id": 31, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "361:7:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 34, - "mutability": "mutable", - "name": "y", - "nameLocation": "380:1:0", - "nodeType": "VariableDeclaration", - "scope": 44, - "src": "372:9:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": - { - "id": 33, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "372:7:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - } - ], - "src": "360:22:0" - }, - "returnParameters": - { - "id": 38, - "nodeType": "ParameterList", - "parameters": - [ - { - "constant": false, - "id": 37, - "mutability": "mutable", - "name": "", - "nameLocation": "-1:-1:-1", - "nodeType": "VariableDeclaration", - "scope": 44, - "src": "404:7:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": - { - "id": 36, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "404:7:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - } - ], - "src": "403:9:0" - }, - "scope": 87, - "src": "335:100:0", - "stateMutability": "pure", - "virtual": false, - "visibility": "public" - }, - { - "body": - { - "id": 57, - "nodeType": "Block", - "src": "513:22:0", - "statements": - [ - { - "expression": - { - "commonType": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 55, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": - { - "id": 53, - "name": "x", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 46, - "src": "523:1:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "/", - "rightExpression": - { - "id": 54, - "name": "y", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 48, - "src": "527:1:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "523:5:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "functionReturnParameters": 52, - "id": 56, - "nodeType": "Return", - "src": "516:12:0" - } - ] - }, - "functionSelector": "9d4f4e60", - "id": 58, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "myDivision", - "nameLocation": "450:10:0", - "nodeType": "FunctionDefinition", - "parameters": - { - "id": 49, - "nodeType": "ParameterList", - "parameters": - [ - { - "constant": false, - "id": 46, - "mutability": "mutable", - "name": "x", - "nameLocation": "469:1:0", - "nodeType": "VariableDeclaration", - "scope": 58, - "src": "461:9:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": - { - "id": 45, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "461:7:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 48, - "mutability": "mutable", - "name": "y", - "nameLocation": "480:1:0", - "nodeType": "VariableDeclaration", - "scope": 58, - "src": "472:9:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": - { - "id": 47, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "472:7:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - } - ], - "src": "460:22:0" - }, - "returnParameters": - { - "id": 52, - "nodeType": "ParameterList", - "parameters": - [ - { - "constant": false, - "id": 51, - "mutability": "mutable", - "name": "", - "nameLocation": "-1:-1:-1", - "nodeType": "VariableDeclaration", - "scope": 58, - "src": "504:7:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": - { - "id": 50, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "504:7:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - } - ], - "src": "503:9:0" - }, - "scope": 87, - "src": "441:94:0", - "stateMutability": "pure", - "virtual": false, - "visibility": "public" - }, - { - "body": - { - "id": 71, - "nodeType": "Block", - "src": "611:22:0", - "statements": - [ - { - "expression": - { - "commonType": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 69, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": - { - "id": 67, - "name": "x", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 60, - "src": "621:1:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "%", - "rightExpression": - { - "id": 68, - "name": "y", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 62, - "src": "625:1:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "621:5:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "functionReturnParameters": 66, - "id": 70, - "nodeType": "Return", - "src": "614:12:0" - } - ] - }, - "functionSelector": "dc6092a8", - "id": 72, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "myModulo", - "nameLocation": "550:8:0", - "nodeType": "FunctionDefinition", - "parameters": - { - "id": 63, - "nodeType": "ParameterList", - "parameters": - [ - { - "constant": false, - "id": 60, - "mutability": "mutable", - "name": "x", - "nameLocation": "567:1:0", - "nodeType": "VariableDeclaration", - "scope": 72, - "src": "559:9:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": - { - "id": 59, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "559:7:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 62, - "mutability": "mutable", - "name": "y", - "nameLocation": "578:1:0", - "nodeType": "VariableDeclaration", - "scope": 72, - "src": "570:9:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": - { - "id": 61, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "570:7:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - } - ], - "src": "558:22:0" - }, - "returnParameters": - { - "id": 66, - "nodeType": "ParameterList", - "parameters": - [ - { - "constant": false, - "id": 65, - "mutability": "mutable", - "name": "", - "nameLocation": "-1:-1:-1", - "nodeType": "VariableDeclaration", - "scope": 72, - "src": "602:7:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": - { - "id": 64, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "602:7:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - } - ], - "src": "601:9:0" - }, - "scope": 87, - "src": "541:92:0", - "stateMutability": "pure", - "virtual": false, - "visibility": "public" - }, - { - "body": - { - "id": 85, - "nodeType": "Block", - "src": "717:23:0", - "statements": - [ - { - "expression": - { - "commonType": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 83, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": - { - "id": 81, - "name": "x", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 74, - "src": "727:1:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "**", - "rightExpression": - { - "id": 82, - "name": "y", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 76, - "src": "732:1:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "727:6:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "functionReturnParameters": 80, - "id": 84, - "nodeType": "Return", - "src": "720:13:0" - } - ] - }, - "functionSelector": "df159c7b", - "id": 86, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "myExponentiation", - "nameLocation": "648:16:0", - "nodeType": "FunctionDefinition", - "parameters": - { - "id": 77, - "nodeType": "ParameterList", - "parameters": - [ - { - "constant": false, - "id": 74, - "mutability": "mutable", - "name": "x", - "nameLocation": "673:1:0", - "nodeType": "VariableDeclaration", - "scope": 86, - "src": "665:9:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": - { - "id": 73, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "665:7:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 76, - "mutability": "mutable", - "name": "y", - "nameLocation": "684:1:0", - "nodeType": "VariableDeclaration", - "scope": 86, - "src": "676:9:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": - { - "id": 75, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "676:7:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - } - ], - "src": "664:22:0" - }, - "returnParameters": - { - "id": 80, - "nodeType": "ParameterList", - "parameters": - [ - { - "constant": false, - "id": 79, - "mutability": "mutable", - "name": "", - "nameLocation": "-1:-1:-1", - "nodeType": "VariableDeclaration", - "scope": 86, - "src": "708:7:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": - { - "id": 78, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "708:7:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - } - ], - "src": "707:9:0" - }, - "scope": 87, - "src": "639:101:0", - "stateMutability": "pure", - "virtual": false, - "visibility": "public" - } - ], - "scope": 88, - "src": "100:643:0", - "usedErrors": [] - } - ], - "src": "41:703:0" -} \ No newline at end of file diff --git a/resources/regressions/sanity-config.json/mutants.log b/resources/regressions/sanity-config.json/mutants.log deleted file mode 100644 index 35b1539..0000000 --- a/resources/regressions/sanity-config.json/mutants.log +++ /dev/null @@ -1 +0,0 @@ -1,BinaryOpMutation,BinaryOpMutation.sol,23:10, % ,- diff --git a/resources/regressions/sanity-config.json/mutants/1/BinaryOpMutation.sol b/resources/regressions/sanity-config.json/mutants/1/BinaryOpMutation.sol deleted file mode 100644 index 1e8be32..0000000 --- a/resources/regressions/sanity-config.json/mutants/1/BinaryOpMutation.sol +++ /dev/null @@ -1,31 +0,0 @@ -// SPDX-License-Identifier: GPL-3.0-only -pragma solidity >0.7.0; -pragma experimental ABIEncoderV2; - -contract BinaryOpMutation { - function myAddition(uint256 x, uint256 y) public pure returns (uint256) { - return x + y; - } - - function mySubtraction(uint256 x, uint256 y) public pure returns (uint256) { - return x - y; - } - - function myMultiplication(uint256 x, uint256 y) public pure returns (uint256) { - return x * y; - } - - function myDivision(uint256 x, uint256 y) public pure returns (uint256) { - return x / y; - } - - function myModulo(uint256 x, uint256 y) public pure returns (uint256) { - /// BinaryOpMutation(`%` |==> `-`) of: `return x % y;` - return x-y; - } - - function myExponentiation(uint256 x, uint256 y) public pure returns (uint256) { - return x ** y; - } - -} diff --git a/resources/regressions/test1.json/gambit_results.json b/resources/regressions/test1.json/gambit_results.json deleted file mode 100644 index 612d8c1..0000000 --- a/resources/regressions/test1.json/gambit_results.json +++ /dev/null @@ -1,44 +0,0 @@ -[ - { - "description": "BinaryOpMutation", - "diff": "--- original\n+++ mutant\n@@ -5,7 +5,8 @@\n contract TenPower {\n function get10PowerDecimals(uint8 decimals) public pure returns (uint256) {\n uint256 a = 10;\n- uint256 res = a ** decimals;\n+ /// BinaryOpMutation(`**` |==> `+`) of: `uint256 res = a ** decimals;`\n+ uint256 res = a+decimals;\n return res;\n // return 10 ** decimals;\n }\n", - "id": "1", - "name": "mutants/1/10Power/TenPower.sol", - "original": "10Power/TenPower.sol", - }, - { - "description": "BinaryOpMutation", - "diff": "--- original\n+++ mutant\n@@ -5,7 +5,8 @@\n contract TenPower {\n function get10PowerDecimals(uint8 decimals) public pure returns (uint256) {\n uint256 a = 10;\n- uint256 res = a ** decimals;\n+ /// BinaryOpMutation(`**` |==> `-`) of: `uint256 res = a ** decimals;`\n+ uint256 res = a-decimals;\n return res;\n // return 10 ** decimals;\n }\n", - "id": "2", - "name": "mutants/2/10Power/TenPower.sol", - "original": "10Power/TenPower.sol", - }, - { - "description": "BinaryOpMutation", - "diff": "--- original\n+++ mutant\n@@ -5,7 +5,8 @@\n contract TenPower {\n function get10PowerDecimals(uint8 decimals) public pure returns (uint256) {\n uint256 a = 10;\n- uint256 res = a ** decimals;\n+ /// BinaryOpMutation(`**` |==> `*`) of: `uint256 res = a ** decimals;`\n+ uint256 res = a*decimals;\n return res;\n // return 10 ** decimals;\n }\n", - "id": "3", - "name": "mutants/3/10Power/TenPower.sol", - "original": "10Power/TenPower.sol", - }, - { - "description": "BinaryOpMutation", - "diff": "--- original\n+++ mutant\n@@ -5,7 +5,8 @@\n contract TenPower {\n function get10PowerDecimals(uint8 decimals) public pure returns (uint256) {\n uint256 a = 10;\n- uint256 res = a ** decimals;\n+ /// BinaryOpMutation(`**` |==> `/`) of: `uint256 res = a ** decimals;`\n+ uint256 res = a/decimals;\n return res;\n // return 10 ** decimals;\n }\n", - "id": "4", - "name": "mutants/4/10Power/TenPower.sol", - "original": "10Power/TenPower.sol", - }, - { - "description": "BinaryOpMutation", - "diff": "--- original\n+++ mutant\n@@ -5,7 +5,8 @@\n contract TenPower {\n function get10PowerDecimals(uint8 decimals) public pure returns (uint256) {\n uint256 a = 10;\n- uint256 res = a ** decimals;\n+ /// BinaryOpMutation(`**` |==> `%`) of: `uint256 res = a ** decimals;`\n+ uint256 res = a%decimals;\n return res;\n // return 10 ** decimals;\n }\n", - "id": "5", - "name": "mutants/5/10Power/TenPower.sol", - "original": "10Power/TenPower.sol", - }, - { - "description": "SwapArgumentsOperatorMutation", - "diff": "--- original\n+++ mutant\n@@ -5,7 +5,8 @@\n contract TenPower {\n function get10PowerDecimals(uint8 decimals) public pure returns (uint256) {\n uint256 a = 10;\n- uint256 res = a ** decimals;\n+ /// SwapArgumentsOperatorMutation(`a ** decimals` |==> `decimals ** a`) of: `uint256 res = a ** decimals;`\n+ uint256 res = decimals ** a;\n return res;\n // return 10 ** decimals;\n }\n", - "id": "6", - "name": "mutants/6/10Power/TenPower.sol", - "original": "10Power/TenPower.sol", - } -] \ No newline at end of file diff --git a/resources/regressions/test1.json/input_json/TenPower.sol_json.ast b/resources/regressions/test1.json/input_json/TenPower.sol_json.ast deleted file mode 100644 index b5bf1c3..0000000 --- a/resources/regressions/test1.json/input_json/TenPower.sol_json.ast +++ /dev/null @@ -1,334 +0,0 @@ -{ - "absolutePath": "benchmarks/10Power/TenPower.sol", - "exportedSymbols": - { - "TenPower": - [ - 23 - ] - }, - "id": 24, - "license": "GPL-3.0-only", - "nodeType": "SourceUnit", - "nodes": - [ - { - "id": 1, - "literals": - [ - "solidity", - ">", - "0.7", - ".0" - ], - "nodeType": "PragmaDirective", - "src": "41:23:0" - }, - { - "id": 2, - "literals": - [ - "experimental", - "ABIEncoderV2" - ], - "nodeType": "PragmaDirective", - "src": "65:33:0" - }, - { - "abstract": false, - "baseContracts": [], - "canonicalName": "TenPower", - "contractDependencies": [], - "contractKind": "contract", - "fullyImplemented": true, - "id": 23, - "linearizedBaseContracts": - [ - 23 - ], - "name": "TenPower", - "nameLocation": "109:8:0", - "nodeType": "ContractDefinition", - "nodes": - [ - { - "body": - { - "id": 21, - "nodeType": "Block", - "src": "198:122:0", - "statements": - [ - { - "assignments": - [ - 10 - ], - "declarations": - [ - { - "constant": false, - "id": 10, - "mutability": "mutable", - "name": "a", - "nameLocation": "216:1:0", - "nodeType": "VariableDeclaration", - "scope": 21, - "src": "208:9:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": - { - "id": 9, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "208:7:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - } - ], - "id": 12, - "initialValue": - { - "hexValue": "3130", - "id": 11, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "220:2:0", - "typeDescriptions": - { - "typeIdentifier": "t_rational_10_by_1", - "typeString": "int_const 10" - }, - "value": "10" - }, - "nodeType": "VariableDeclarationStatement", - "src": "208:14:0" - }, - { - "assignments": - [ - 14 - ], - "declarations": - [ - { - "constant": false, - "id": 14, - "mutability": "mutable", - "name": "res", - "nameLocation": "240:3:0", - "nodeType": "VariableDeclaration", - "scope": 21, - "src": "232:11:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": - { - "id": 13, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "232:7:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - } - ], - "id": 18, - "initialValue": - { - "commonType": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 17, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": - { - "id": 15, - "name": "a", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 10, - "src": "246:1:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "**", - "rightExpression": - { - "id": 16, - "name": "decimals", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4, - "src": "251:8:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - } - }, - "src": "246:13:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "VariableDeclarationStatement", - "src": "232:27:0" - }, - { - "expression": - { - "id": 19, - "name": "res", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 14, - "src": "276:3:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "functionReturnParameters": 8, - "id": 20, - "nodeType": "Return", - "src": "269:10:0" - } - ] - }, - "functionSelector": "eb79f1be", - "id": 22, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "get10PowerDecimals", - "nameLocation": "133:18:0", - "nodeType": "FunctionDefinition", - "parameters": - { - "id": 5, - "nodeType": "ParameterList", - "parameters": - [ - { - "constant": false, - "id": 4, - "mutability": "mutable", - "name": "decimals", - "nameLocation": "158:8:0", - "nodeType": "VariableDeclaration", - "scope": 22, - "src": "152:14:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - }, - "typeName": - { - "id": 3, - "name": "uint8", - "nodeType": "ElementaryTypeName", - "src": "152:5:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - } - }, - "visibility": "internal" - } - ], - "src": "151:16:0" - }, - "returnParameters": - { - "id": 8, - "nodeType": "ParameterList", - "parameters": - [ - { - "constant": false, - "id": 7, - "mutability": "mutable", - "name": "", - "nameLocation": "-1:-1:-1", - "nodeType": "VariableDeclaration", - "scope": 22, - "src": "189:7:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": - { - "id": 6, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "189:7:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - } - ], - "src": "188:9:0" - }, - "scope": 23, - "src": "124:196:0", - "stateMutability": "pure", - "virtual": false, - "visibility": "public" - } - ], - "scope": 24, - "src": "100:222:0", - "usedErrors": [] - } - ], - "src": "41:282:0" -} \ No newline at end of file diff --git a/resources/regressions/test1.json/input_json/TenPower.sol_json.ast.json b/resources/regressions/test1.json/input_json/TenPower.sol_json.ast.json deleted file mode 100644 index b5bf1c3..0000000 --- a/resources/regressions/test1.json/input_json/TenPower.sol_json.ast.json +++ /dev/null @@ -1,334 +0,0 @@ -{ - "absolutePath": "benchmarks/10Power/TenPower.sol", - "exportedSymbols": - { - "TenPower": - [ - 23 - ] - }, - "id": 24, - "license": "GPL-3.0-only", - "nodeType": "SourceUnit", - "nodes": - [ - { - "id": 1, - "literals": - [ - "solidity", - ">", - "0.7", - ".0" - ], - "nodeType": "PragmaDirective", - "src": "41:23:0" - }, - { - "id": 2, - "literals": - [ - "experimental", - "ABIEncoderV2" - ], - "nodeType": "PragmaDirective", - "src": "65:33:0" - }, - { - "abstract": false, - "baseContracts": [], - "canonicalName": "TenPower", - "contractDependencies": [], - "contractKind": "contract", - "fullyImplemented": true, - "id": 23, - "linearizedBaseContracts": - [ - 23 - ], - "name": "TenPower", - "nameLocation": "109:8:0", - "nodeType": "ContractDefinition", - "nodes": - [ - { - "body": - { - "id": 21, - "nodeType": "Block", - "src": "198:122:0", - "statements": - [ - { - "assignments": - [ - 10 - ], - "declarations": - [ - { - "constant": false, - "id": 10, - "mutability": "mutable", - "name": "a", - "nameLocation": "216:1:0", - "nodeType": "VariableDeclaration", - "scope": 21, - "src": "208:9:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": - { - "id": 9, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "208:7:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - } - ], - "id": 12, - "initialValue": - { - "hexValue": "3130", - "id": 11, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "220:2:0", - "typeDescriptions": - { - "typeIdentifier": "t_rational_10_by_1", - "typeString": "int_const 10" - }, - "value": "10" - }, - "nodeType": "VariableDeclarationStatement", - "src": "208:14:0" - }, - { - "assignments": - [ - 14 - ], - "declarations": - [ - { - "constant": false, - "id": 14, - "mutability": "mutable", - "name": "res", - "nameLocation": "240:3:0", - "nodeType": "VariableDeclaration", - "scope": 21, - "src": "232:11:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": - { - "id": 13, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "232:7:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - } - ], - "id": 18, - "initialValue": - { - "commonType": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 17, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": - { - "id": 15, - "name": "a", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 10, - "src": "246:1:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "**", - "rightExpression": - { - "id": 16, - "name": "decimals", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4, - "src": "251:8:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - } - }, - "src": "246:13:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "VariableDeclarationStatement", - "src": "232:27:0" - }, - { - "expression": - { - "id": 19, - "name": "res", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 14, - "src": "276:3:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "functionReturnParameters": 8, - "id": 20, - "nodeType": "Return", - "src": "269:10:0" - } - ] - }, - "functionSelector": "eb79f1be", - "id": 22, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "get10PowerDecimals", - "nameLocation": "133:18:0", - "nodeType": "FunctionDefinition", - "parameters": - { - "id": 5, - "nodeType": "ParameterList", - "parameters": - [ - { - "constant": false, - "id": 4, - "mutability": "mutable", - "name": "decimals", - "nameLocation": "158:8:0", - "nodeType": "VariableDeclaration", - "scope": 22, - "src": "152:14:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - }, - "typeName": - { - "id": 3, - "name": "uint8", - "nodeType": "ElementaryTypeName", - "src": "152:5:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - } - }, - "visibility": "internal" - } - ], - "src": "151:16:0" - }, - "returnParameters": - { - "id": 8, - "nodeType": "ParameterList", - "parameters": - [ - { - "constant": false, - "id": 7, - "mutability": "mutable", - "name": "", - "nameLocation": "-1:-1:-1", - "nodeType": "VariableDeclaration", - "scope": 22, - "src": "189:7:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": - { - "id": 6, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "189:7:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - } - ], - "src": "188:9:0" - }, - "scope": 23, - "src": "124:196:0", - "stateMutability": "pure", - "virtual": false, - "visibility": "public" - } - ], - "scope": 24, - "src": "100:222:0", - "usedErrors": [] - } - ], - "src": "41:282:0" -} \ No newline at end of file diff --git a/resources/regressions/test1.json/mutants.log b/resources/regressions/test1.json/mutants.log deleted file mode 100644 index 8257640..0000000 --- a/resources/regressions/test1.json/mutants.log +++ /dev/null @@ -1,6 +0,0 @@ -1,BinaryOpMutation,10Power/TenPower.sol,8:24, ** ,+ -2,BinaryOpMutation,10Power/TenPower.sol,8:24, ** ,- -3,BinaryOpMutation,10Power/TenPower.sol,8:24, ** ,* -4,BinaryOpMutation,10Power/TenPower.sol,8:24, ** ,/ -5,BinaryOpMutation,10Power/TenPower.sol,8:24, ** ,% -6,SwapArgumentsOperatorMutation,10Power/TenPower.sol,8:23,a ** decimals,decimals ** a diff --git a/resources/regressions/test1.json/mutants/1/10Power/TenPower.sol b/resources/regressions/test1.json/mutants/1/10Power/TenPower.sol deleted file mode 100644 index 4990844..0000000 --- a/resources/regressions/test1.json/mutants/1/10Power/TenPower.sol +++ /dev/null @@ -1,13 +0,0 @@ -// SPDX-License-Identifier: GPL-3.0-only -pragma solidity >0.7.0; -pragma experimental ABIEncoderV2; - -contract TenPower { - function get10PowerDecimals(uint8 decimals) public pure returns (uint256) { - uint256 a = 10; - /// BinaryOpMutation(`**` |==> `+`) of: `uint256 res = a ** decimals;` - uint256 res = a+decimals; - return res; - // return 10 ** decimals; - } -} diff --git a/resources/regressions/test1.json/mutants/2/10Power/TenPower.sol b/resources/regressions/test1.json/mutants/2/10Power/TenPower.sol deleted file mode 100644 index 23654dc..0000000 --- a/resources/regressions/test1.json/mutants/2/10Power/TenPower.sol +++ /dev/null @@ -1,13 +0,0 @@ -// SPDX-License-Identifier: GPL-3.0-only -pragma solidity >0.7.0; -pragma experimental ABIEncoderV2; - -contract TenPower { - function get10PowerDecimals(uint8 decimals) public pure returns (uint256) { - uint256 a = 10; - /// BinaryOpMutation(`**` |==> `-`) of: `uint256 res = a ** decimals;` - uint256 res = a-decimals; - return res; - // return 10 ** decimals; - } -} diff --git a/resources/regressions/test1.json/mutants/3/10Power/TenPower.sol b/resources/regressions/test1.json/mutants/3/10Power/TenPower.sol deleted file mode 100644 index 66d1760..0000000 --- a/resources/regressions/test1.json/mutants/3/10Power/TenPower.sol +++ /dev/null @@ -1,13 +0,0 @@ -// SPDX-License-Identifier: GPL-3.0-only -pragma solidity >0.7.0; -pragma experimental ABIEncoderV2; - -contract TenPower { - function get10PowerDecimals(uint8 decimals) public pure returns (uint256) { - uint256 a = 10; - /// BinaryOpMutation(`**` |==> `*`) of: `uint256 res = a ** decimals;` - uint256 res = a*decimals; - return res; - // return 10 ** decimals; - } -} diff --git a/resources/regressions/test1.json/mutants/4/10Power/TenPower.sol b/resources/regressions/test1.json/mutants/4/10Power/TenPower.sol deleted file mode 100644 index 844dc32..0000000 --- a/resources/regressions/test1.json/mutants/4/10Power/TenPower.sol +++ /dev/null @@ -1,13 +0,0 @@ -// SPDX-License-Identifier: GPL-3.0-only -pragma solidity >0.7.0; -pragma experimental ABIEncoderV2; - -contract TenPower { - function get10PowerDecimals(uint8 decimals) public pure returns (uint256) { - uint256 a = 10; - /// BinaryOpMutation(`**` |==> `/`) of: `uint256 res = a ** decimals;` - uint256 res = a/decimals; - return res; - // return 10 ** decimals; - } -} diff --git a/resources/regressions/test1.json/mutants/5/10Power/TenPower.sol b/resources/regressions/test1.json/mutants/5/10Power/TenPower.sol deleted file mode 100644 index 1461441..0000000 --- a/resources/regressions/test1.json/mutants/5/10Power/TenPower.sol +++ /dev/null @@ -1,13 +0,0 @@ -// SPDX-License-Identifier: GPL-3.0-only -pragma solidity >0.7.0; -pragma experimental ABIEncoderV2; - -contract TenPower { - function get10PowerDecimals(uint8 decimals) public pure returns (uint256) { - uint256 a = 10; - /// BinaryOpMutation(`**` |==> `%`) of: `uint256 res = a ** decimals;` - uint256 res = a%decimals; - return res; - // return 10 ** decimals; - } -} diff --git a/resources/regressions/test1.json/mutants/6/10Power/TenPower.sol b/resources/regressions/test1.json/mutants/6/10Power/TenPower.sol deleted file mode 100644 index 674f128..0000000 --- a/resources/regressions/test1.json/mutants/6/10Power/TenPower.sol +++ /dev/null @@ -1,13 +0,0 @@ -// SPDX-License-Identifier: GPL-3.0-only -pragma solidity >0.7.0; -pragma experimental ABIEncoderV2; - -contract TenPower { - function get10PowerDecimals(uint8 decimals) public pure returns (uint256) { - uint256 a = 10; - /// SwapArgumentsOperatorMutation(`a ** decimals` |==> `decimals ** a`) of: `uint256 res = a ** decimals;` - uint256 res = decimals ** a; - return res; - // return 10 ** decimals; - } -} diff --git a/resources/regressions/test2.json/gambit_results.json b/resources/regressions/test2.json/gambit_results.json deleted file mode 100644 index 612d8c1..0000000 --- a/resources/regressions/test2.json/gambit_results.json +++ /dev/null @@ -1,44 +0,0 @@ -[ - { - "description": "BinaryOpMutation", - "diff": "--- original\n+++ mutant\n@@ -5,7 +5,8 @@\n contract TenPower {\n function get10PowerDecimals(uint8 decimals) public pure returns (uint256) {\n uint256 a = 10;\n- uint256 res = a ** decimals;\n+ /// BinaryOpMutation(`**` |==> `+`) of: `uint256 res = a ** decimals;`\n+ uint256 res = a+decimals;\n return res;\n // return 10 ** decimals;\n }\n", - "id": "1", - "name": "mutants/1/10Power/TenPower.sol", - "original": "10Power/TenPower.sol", - }, - { - "description": "BinaryOpMutation", - "diff": "--- original\n+++ mutant\n@@ -5,7 +5,8 @@\n contract TenPower {\n function get10PowerDecimals(uint8 decimals) public pure returns (uint256) {\n uint256 a = 10;\n- uint256 res = a ** decimals;\n+ /// BinaryOpMutation(`**` |==> `-`) of: `uint256 res = a ** decimals;`\n+ uint256 res = a-decimals;\n return res;\n // return 10 ** decimals;\n }\n", - "id": "2", - "name": "mutants/2/10Power/TenPower.sol", - "original": "10Power/TenPower.sol", - }, - { - "description": "BinaryOpMutation", - "diff": "--- original\n+++ mutant\n@@ -5,7 +5,8 @@\n contract TenPower {\n function get10PowerDecimals(uint8 decimals) public pure returns (uint256) {\n uint256 a = 10;\n- uint256 res = a ** decimals;\n+ /// BinaryOpMutation(`**` |==> `*`) of: `uint256 res = a ** decimals;`\n+ uint256 res = a*decimals;\n return res;\n // return 10 ** decimals;\n }\n", - "id": "3", - "name": "mutants/3/10Power/TenPower.sol", - "original": "10Power/TenPower.sol", - }, - { - "description": "BinaryOpMutation", - "diff": "--- original\n+++ mutant\n@@ -5,7 +5,8 @@\n contract TenPower {\n function get10PowerDecimals(uint8 decimals) public pure returns (uint256) {\n uint256 a = 10;\n- uint256 res = a ** decimals;\n+ /// BinaryOpMutation(`**` |==> `/`) of: `uint256 res = a ** decimals;`\n+ uint256 res = a/decimals;\n return res;\n // return 10 ** decimals;\n }\n", - "id": "4", - "name": "mutants/4/10Power/TenPower.sol", - "original": "10Power/TenPower.sol", - }, - { - "description": "BinaryOpMutation", - "diff": "--- original\n+++ mutant\n@@ -5,7 +5,8 @@\n contract TenPower {\n function get10PowerDecimals(uint8 decimals) public pure returns (uint256) {\n uint256 a = 10;\n- uint256 res = a ** decimals;\n+ /// BinaryOpMutation(`**` |==> `%`) of: `uint256 res = a ** decimals;`\n+ uint256 res = a%decimals;\n return res;\n // return 10 ** decimals;\n }\n", - "id": "5", - "name": "mutants/5/10Power/TenPower.sol", - "original": "10Power/TenPower.sol", - }, - { - "description": "SwapArgumentsOperatorMutation", - "diff": "--- original\n+++ mutant\n@@ -5,7 +5,8 @@\n contract TenPower {\n function get10PowerDecimals(uint8 decimals) public pure returns (uint256) {\n uint256 a = 10;\n- uint256 res = a ** decimals;\n+ /// SwapArgumentsOperatorMutation(`a ** decimals` |==> `decimals ** a`) of: `uint256 res = a ** decimals;`\n+ uint256 res = decimals ** a;\n return res;\n // return 10 ** decimals;\n }\n", - "id": "6", - "name": "mutants/6/10Power/TenPower.sol", - "original": "10Power/TenPower.sol", - } -] \ No newline at end of file diff --git a/resources/regressions/test2.json/input_json/TenPower.sol_json.ast b/resources/regressions/test2.json/input_json/TenPower.sol_json.ast deleted file mode 100644 index b5bf1c3..0000000 --- a/resources/regressions/test2.json/input_json/TenPower.sol_json.ast +++ /dev/null @@ -1,334 +0,0 @@ -{ - "absolutePath": "benchmarks/10Power/TenPower.sol", - "exportedSymbols": - { - "TenPower": - [ - 23 - ] - }, - "id": 24, - "license": "GPL-3.0-only", - "nodeType": "SourceUnit", - "nodes": - [ - { - "id": 1, - "literals": - [ - "solidity", - ">", - "0.7", - ".0" - ], - "nodeType": "PragmaDirective", - "src": "41:23:0" - }, - { - "id": 2, - "literals": - [ - "experimental", - "ABIEncoderV2" - ], - "nodeType": "PragmaDirective", - "src": "65:33:0" - }, - { - "abstract": false, - "baseContracts": [], - "canonicalName": "TenPower", - "contractDependencies": [], - "contractKind": "contract", - "fullyImplemented": true, - "id": 23, - "linearizedBaseContracts": - [ - 23 - ], - "name": "TenPower", - "nameLocation": "109:8:0", - "nodeType": "ContractDefinition", - "nodes": - [ - { - "body": - { - "id": 21, - "nodeType": "Block", - "src": "198:122:0", - "statements": - [ - { - "assignments": - [ - 10 - ], - "declarations": - [ - { - "constant": false, - "id": 10, - "mutability": "mutable", - "name": "a", - "nameLocation": "216:1:0", - "nodeType": "VariableDeclaration", - "scope": 21, - "src": "208:9:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": - { - "id": 9, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "208:7:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - } - ], - "id": 12, - "initialValue": - { - "hexValue": "3130", - "id": 11, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "220:2:0", - "typeDescriptions": - { - "typeIdentifier": "t_rational_10_by_1", - "typeString": "int_const 10" - }, - "value": "10" - }, - "nodeType": "VariableDeclarationStatement", - "src": "208:14:0" - }, - { - "assignments": - [ - 14 - ], - "declarations": - [ - { - "constant": false, - "id": 14, - "mutability": "mutable", - "name": "res", - "nameLocation": "240:3:0", - "nodeType": "VariableDeclaration", - "scope": 21, - "src": "232:11:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": - { - "id": 13, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "232:7:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - } - ], - "id": 18, - "initialValue": - { - "commonType": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 17, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": - { - "id": 15, - "name": "a", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 10, - "src": "246:1:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "**", - "rightExpression": - { - "id": 16, - "name": "decimals", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4, - "src": "251:8:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - } - }, - "src": "246:13:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "VariableDeclarationStatement", - "src": "232:27:0" - }, - { - "expression": - { - "id": 19, - "name": "res", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 14, - "src": "276:3:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "functionReturnParameters": 8, - "id": 20, - "nodeType": "Return", - "src": "269:10:0" - } - ] - }, - "functionSelector": "eb79f1be", - "id": 22, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "get10PowerDecimals", - "nameLocation": "133:18:0", - "nodeType": "FunctionDefinition", - "parameters": - { - "id": 5, - "nodeType": "ParameterList", - "parameters": - [ - { - "constant": false, - "id": 4, - "mutability": "mutable", - "name": "decimals", - "nameLocation": "158:8:0", - "nodeType": "VariableDeclaration", - "scope": 22, - "src": "152:14:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - }, - "typeName": - { - "id": 3, - "name": "uint8", - "nodeType": "ElementaryTypeName", - "src": "152:5:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - } - }, - "visibility": "internal" - } - ], - "src": "151:16:0" - }, - "returnParameters": - { - "id": 8, - "nodeType": "ParameterList", - "parameters": - [ - { - "constant": false, - "id": 7, - "mutability": "mutable", - "name": "", - "nameLocation": "-1:-1:-1", - "nodeType": "VariableDeclaration", - "scope": 22, - "src": "189:7:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": - { - "id": 6, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "189:7:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - } - ], - "src": "188:9:0" - }, - "scope": 23, - "src": "124:196:0", - "stateMutability": "pure", - "virtual": false, - "visibility": "public" - } - ], - "scope": 24, - "src": "100:222:0", - "usedErrors": [] - } - ], - "src": "41:282:0" -} \ No newline at end of file diff --git a/resources/regressions/test2.json/input_json/TenPower.sol_json.ast.json b/resources/regressions/test2.json/input_json/TenPower.sol_json.ast.json deleted file mode 100644 index b5bf1c3..0000000 --- a/resources/regressions/test2.json/input_json/TenPower.sol_json.ast.json +++ /dev/null @@ -1,334 +0,0 @@ -{ - "absolutePath": "benchmarks/10Power/TenPower.sol", - "exportedSymbols": - { - "TenPower": - [ - 23 - ] - }, - "id": 24, - "license": "GPL-3.0-only", - "nodeType": "SourceUnit", - "nodes": - [ - { - "id": 1, - "literals": - [ - "solidity", - ">", - "0.7", - ".0" - ], - "nodeType": "PragmaDirective", - "src": "41:23:0" - }, - { - "id": 2, - "literals": - [ - "experimental", - "ABIEncoderV2" - ], - "nodeType": "PragmaDirective", - "src": "65:33:0" - }, - { - "abstract": false, - "baseContracts": [], - "canonicalName": "TenPower", - "contractDependencies": [], - "contractKind": "contract", - "fullyImplemented": true, - "id": 23, - "linearizedBaseContracts": - [ - 23 - ], - "name": "TenPower", - "nameLocation": "109:8:0", - "nodeType": "ContractDefinition", - "nodes": - [ - { - "body": - { - "id": 21, - "nodeType": "Block", - "src": "198:122:0", - "statements": - [ - { - "assignments": - [ - 10 - ], - "declarations": - [ - { - "constant": false, - "id": 10, - "mutability": "mutable", - "name": "a", - "nameLocation": "216:1:0", - "nodeType": "VariableDeclaration", - "scope": 21, - "src": "208:9:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": - { - "id": 9, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "208:7:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - } - ], - "id": 12, - "initialValue": - { - "hexValue": "3130", - "id": 11, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "220:2:0", - "typeDescriptions": - { - "typeIdentifier": "t_rational_10_by_1", - "typeString": "int_const 10" - }, - "value": "10" - }, - "nodeType": "VariableDeclarationStatement", - "src": "208:14:0" - }, - { - "assignments": - [ - 14 - ], - "declarations": - [ - { - "constant": false, - "id": 14, - "mutability": "mutable", - "name": "res", - "nameLocation": "240:3:0", - "nodeType": "VariableDeclaration", - "scope": 21, - "src": "232:11:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": - { - "id": 13, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "232:7:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - } - ], - "id": 18, - "initialValue": - { - "commonType": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 17, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": - { - "id": 15, - "name": "a", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 10, - "src": "246:1:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "**", - "rightExpression": - { - "id": 16, - "name": "decimals", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4, - "src": "251:8:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - } - }, - "src": "246:13:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "VariableDeclarationStatement", - "src": "232:27:0" - }, - { - "expression": - { - "id": 19, - "name": "res", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 14, - "src": "276:3:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "functionReturnParameters": 8, - "id": 20, - "nodeType": "Return", - "src": "269:10:0" - } - ] - }, - "functionSelector": "eb79f1be", - "id": 22, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "get10PowerDecimals", - "nameLocation": "133:18:0", - "nodeType": "FunctionDefinition", - "parameters": - { - "id": 5, - "nodeType": "ParameterList", - "parameters": - [ - { - "constant": false, - "id": 4, - "mutability": "mutable", - "name": "decimals", - "nameLocation": "158:8:0", - "nodeType": "VariableDeclaration", - "scope": 22, - "src": "152:14:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - }, - "typeName": - { - "id": 3, - "name": "uint8", - "nodeType": "ElementaryTypeName", - "src": "152:5:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - } - }, - "visibility": "internal" - } - ], - "src": "151:16:0" - }, - "returnParameters": - { - "id": 8, - "nodeType": "ParameterList", - "parameters": - [ - { - "constant": false, - "id": 7, - "mutability": "mutable", - "name": "", - "nameLocation": "-1:-1:-1", - "nodeType": "VariableDeclaration", - "scope": 22, - "src": "189:7:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": - { - "id": 6, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "189:7:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - } - ], - "src": "188:9:0" - }, - "scope": 23, - "src": "124:196:0", - "stateMutability": "pure", - "virtual": false, - "visibility": "public" - } - ], - "scope": 24, - "src": "100:222:0", - "usedErrors": [] - } - ], - "src": "41:282:0" -} \ No newline at end of file diff --git a/resources/regressions/test2.json/mutants.log b/resources/regressions/test2.json/mutants.log deleted file mode 100644 index 8257640..0000000 --- a/resources/regressions/test2.json/mutants.log +++ /dev/null @@ -1,6 +0,0 @@ -1,BinaryOpMutation,10Power/TenPower.sol,8:24, ** ,+ -2,BinaryOpMutation,10Power/TenPower.sol,8:24, ** ,- -3,BinaryOpMutation,10Power/TenPower.sol,8:24, ** ,* -4,BinaryOpMutation,10Power/TenPower.sol,8:24, ** ,/ -5,BinaryOpMutation,10Power/TenPower.sol,8:24, ** ,% -6,SwapArgumentsOperatorMutation,10Power/TenPower.sol,8:23,a ** decimals,decimals ** a diff --git a/resources/regressions/test2.json/mutants/1/10Power/TenPower.sol b/resources/regressions/test2.json/mutants/1/10Power/TenPower.sol deleted file mode 100644 index 4990844..0000000 --- a/resources/regressions/test2.json/mutants/1/10Power/TenPower.sol +++ /dev/null @@ -1,13 +0,0 @@ -// SPDX-License-Identifier: GPL-3.0-only -pragma solidity >0.7.0; -pragma experimental ABIEncoderV2; - -contract TenPower { - function get10PowerDecimals(uint8 decimals) public pure returns (uint256) { - uint256 a = 10; - /// BinaryOpMutation(`**` |==> `+`) of: `uint256 res = a ** decimals;` - uint256 res = a+decimals; - return res; - // return 10 ** decimals; - } -} diff --git a/resources/regressions/test2.json/mutants/2/10Power/TenPower.sol b/resources/regressions/test2.json/mutants/2/10Power/TenPower.sol deleted file mode 100644 index 23654dc..0000000 --- a/resources/regressions/test2.json/mutants/2/10Power/TenPower.sol +++ /dev/null @@ -1,13 +0,0 @@ -// SPDX-License-Identifier: GPL-3.0-only -pragma solidity >0.7.0; -pragma experimental ABIEncoderV2; - -contract TenPower { - function get10PowerDecimals(uint8 decimals) public pure returns (uint256) { - uint256 a = 10; - /// BinaryOpMutation(`**` |==> `-`) of: `uint256 res = a ** decimals;` - uint256 res = a-decimals; - return res; - // return 10 ** decimals; - } -} diff --git a/resources/regressions/test2.json/mutants/3/10Power/TenPower.sol b/resources/regressions/test2.json/mutants/3/10Power/TenPower.sol deleted file mode 100644 index 66d1760..0000000 --- a/resources/regressions/test2.json/mutants/3/10Power/TenPower.sol +++ /dev/null @@ -1,13 +0,0 @@ -// SPDX-License-Identifier: GPL-3.0-only -pragma solidity >0.7.0; -pragma experimental ABIEncoderV2; - -contract TenPower { - function get10PowerDecimals(uint8 decimals) public pure returns (uint256) { - uint256 a = 10; - /// BinaryOpMutation(`**` |==> `*`) of: `uint256 res = a ** decimals;` - uint256 res = a*decimals; - return res; - // return 10 ** decimals; - } -} diff --git a/resources/regressions/test2.json/mutants/4/10Power/TenPower.sol b/resources/regressions/test2.json/mutants/4/10Power/TenPower.sol deleted file mode 100644 index 844dc32..0000000 --- a/resources/regressions/test2.json/mutants/4/10Power/TenPower.sol +++ /dev/null @@ -1,13 +0,0 @@ -// SPDX-License-Identifier: GPL-3.0-only -pragma solidity >0.7.0; -pragma experimental ABIEncoderV2; - -contract TenPower { - function get10PowerDecimals(uint8 decimals) public pure returns (uint256) { - uint256 a = 10; - /// BinaryOpMutation(`**` |==> `/`) of: `uint256 res = a ** decimals;` - uint256 res = a/decimals; - return res; - // return 10 ** decimals; - } -} diff --git a/resources/regressions/test2.json/mutants/5/10Power/TenPower.sol b/resources/regressions/test2.json/mutants/5/10Power/TenPower.sol deleted file mode 100644 index 1461441..0000000 --- a/resources/regressions/test2.json/mutants/5/10Power/TenPower.sol +++ /dev/null @@ -1,13 +0,0 @@ -// SPDX-License-Identifier: GPL-3.0-only -pragma solidity >0.7.0; -pragma experimental ABIEncoderV2; - -contract TenPower { - function get10PowerDecimals(uint8 decimals) public pure returns (uint256) { - uint256 a = 10; - /// BinaryOpMutation(`**` |==> `%`) of: `uint256 res = a ** decimals;` - uint256 res = a%decimals; - return res; - // return 10 ** decimals; - } -} diff --git a/resources/regressions/test2.json/mutants/6/10Power/TenPower.sol b/resources/regressions/test2.json/mutants/6/10Power/TenPower.sol deleted file mode 100644 index 674f128..0000000 --- a/resources/regressions/test2.json/mutants/6/10Power/TenPower.sol +++ /dev/null @@ -1,13 +0,0 @@ -// SPDX-License-Identifier: GPL-3.0-only -pragma solidity >0.7.0; -pragma experimental ABIEncoderV2; - -contract TenPower { - function get10PowerDecimals(uint8 decimals) public pure returns (uint256) { - uint256 a = 10; - /// SwapArgumentsOperatorMutation(`a ** decimals` |==> `decimals ** a`) of: `uint256 res = a ** decimals;` - uint256 res = decimals ** a; - return res; - // return 10 ** decimals; - } -} diff --git a/resources/regressions/test3.json/gambit_results.json b/resources/regressions/test3.json/gambit_results.json deleted file mode 100644 index 612d8c1..0000000 --- a/resources/regressions/test3.json/gambit_results.json +++ /dev/null @@ -1,44 +0,0 @@ -[ - { - "description": "BinaryOpMutation", - "diff": "--- original\n+++ mutant\n@@ -5,7 +5,8 @@\n contract TenPower {\n function get10PowerDecimals(uint8 decimals) public pure returns (uint256) {\n uint256 a = 10;\n- uint256 res = a ** decimals;\n+ /// BinaryOpMutation(`**` |==> `+`) of: `uint256 res = a ** decimals;`\n+ uint256 res = a+decimals;\n return res;\n // return 10 ** decimals;\n }\n", - "id": "1", - "name": "mutants/1/10Power/TenPower.sol", - "original": "10Power/TenPower.sol", - }, - { - "description": "BinaryOpMutation", - "diff": "--- original\n+++ mutant\n@@ -5,7 +5,8 @@\n contract TenPower {\n function get10PowerDecimals(uint8 decimals) public pure returns (uint256) {\n uint256 a = 10;\n- uint256 res = a ** decimals;\n+ /// BinaryOpMutation(`**` |==> `-`) of: `uint256 res = a ** decimals;`\n+ uint256 res = a-decimals;\n return res;\n // return 10 ** decimals;\n }\n", - "id": "2", - "name": "mutants/2/10Power/TenPower.sol", - "original": "10Power/TenPower.sol", - }, - { - "description": "BinaryOpMutation", - "diff": "--- original\n+++ mutant\n@@ -5,7 +5,8 @@\n contract TenPower {\n function get10PowerDecimals(uint8 decimals) public pure returns (uint256) {\n uint256 a = 10;\n- uint256 res = a ** decimals;\n+ /// BinaryOpMutation(`**` |==> `*`) of: `uint256 res = a ** decimals;`\n+ uint256 res = a*decimals;\n return res;\n // return 10 ** decimals;\n }\n", - "id": "3", - "name": "mutants/3/10Power/TenPower.sol", - "original": "10Power/TenPower.sol", - }, - { - "description": "BinaryOpMutation", - "diff": "--- original\n+++ mutant\n@@ -5,7 +5,8 @@\n contract TenPower {\n function get10PowerDecimals(uint8 decimals) public pure returns (uint256) {\n uint256 a = 10;\n- uint256 res = a ** decimals;\n+ /// BinaryOpMutation(`**` |==> `/`) of: `uint256 res = a ** decimals;`\n+ uint256 res = a/decimals;\n return res;\n // return 10 ** decimals;\n }\n", - "id": "4", - "name": "mutants/4/10Power/TenPower.sol", - "original": "10Power/TenPower.sol", - }, - { - "description": "BinaryOpMutation", - "diff": "--- original\n+++ mutant\n@@ -5,7 +5,8 @@\n contract TenPower {\n function get10PowerDecimals(uint8 decimals) public pure returns (uint256) {\n uint256 a = 10;\n- uint256 res = a ** decimals;\n+ /// BinaryOpMutation(`**` |==> `%`) of: `uint256 res = a ** decimals;`\n+ uint256 res = a%decimals;\n return res;\n // return 10 ** decimals;\n }\n", - "id": "5", - "name": "mutants/5/10Power/TenPower.sol", - "original": "10Power/TenPower.sol", - }, - { - "description": "SwapArgumentsOperatorMutation", - "diff": "--- original\n+++ mutant\n@@ -5,7 +5,8 @@\n contract TenPower {\n function get10PowerDecimals(uint8 decimals) public pure returns (uint256) {\n uint256 a = 10;\n- uint256 res = a ** decimals;\n+ /// SwapArgumentsOperatorMutation(`a ** decimals` |==> `decimals ** a`) of: `uint256 res = a ** decimals;`\n+ uint256 res = decimals ** a;\n return res;\n // return 10 ** decimals;\n }\n", - "id": "6", - "name": "mutants/6/10Power/TenPower.sol", - "original": "10Power/TenPower.sol", - } -] \ No newline at end of file diff --git a/resources/regressions/test3.json/input_json/C.sol_json.ast b/resources/regressions/test3.json/input_json/C.sol_json.ast deleted file mode 100644 index a3306b6..0000000 --- a/resources/regressions/test3.json/input_json/C.sol_json.ast +++ /dev/null @@ -1,1828 +0,0 @@ -{ - "absolutePath": "benchmarks/MultipleContracts/C.sol", - "exportedSymbols": - { - "C": - [ - 135 - ], - "Utils": - [ - 33 - ] - }, - "id": 136, - "license": "GPL-3.0-only", - "nodeType": "SourceUnit", - "nodes": - [ - { - "id": 1, - "literals": - [ - "solidity", - "^", - "0.8", - ".13" - ], - "nodeType": "PragmaDirective", - "src": "42:24:0" - }, - { - "abstract": false, - "baseContracts": [], - "canonicalName": "Utils", - "contractDependencies": [], - "contractKind": "library", - "fullyImplemented": true, - "id": 33, - "linearizedBaseContracts": - [ - 33 - ], - "name": "Utils", - "nameLocation": "76:5:0", - "nodeType": "ContractDefinition", - "nodes": - [ - { - "body": - { - "id": 17, - "nodeType": "Block", - "src": "151:34:0", - "statements": - [ - { - "expression": - { - "arguments": - [ - { - "commonType": - { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "id": 14, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": - { - "baseExpression": - { - "id": 10, - "name": "c", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4, - "src": "168:1:0", - "typeDescriptions": - { - "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", - "typeString": "address[] memory" - } - }, - "id": 12, - "indexExpression": - { - "hexValue": "30", - "id": 11, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "170:1:0", - "typeDescriptions": - { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - }, - "value": "0" - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "168:4:0", - "typeDescriptions": - { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "nodeType": "BinaryOperation", - "operator": "==", - "rightExpression": - { - "id": 13, - "name": "e", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 6, - "src": "176:1:0", - "typeDescriptions": - { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "src": "168:9:0", - "typeDescriptions": - { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - } - ], - "expression": - { - "argumentTypes": - [ - { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - ], - "id": 9, - "name": "assert", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": -3, - "src": "161:6:0", - "typeDescriptions": - { - "typeIdentifier": "t_function_assert_pure$_t_bool_$returns$__$", - "typeString": "function (bool) pure" - } - }, - "id": 15, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "161:17:0", - "tryCall": false, - "typeDescriptions": - { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 16, - "nodeType": "ExpressionStatement", - "src": "161:17:0" - } - ] - }, - "id": 18, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "getarray", - "nameLocation": "97:8:0", - "nodeType": "FunctionDefinition", - "parameters": - { - "id": 7, - "nodeType": "ParameterList", - "parameters": - [ - { - "constant": false, - "id": 4, - "mutability": "mutable", - "name": "c", - "nameLocation": "123:1:0", - "nodeType": "VariableDeclaration", - "scope": 18, - "src": "106:18:0", - "stateVariable": false, - "storageLocation": "memory", - "typeDescriptions": - { - "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", - "typeString": "address[]" - }, - "typeName": - { - "baseType": - { - "id": 2, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "106:7:0", - "stateMutability": "nonpayable", - "typeDescriptions": - { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "id": 3, - "nodeType": "ArrayTypeName", - "src": "106:9:0", - "typeDescriptions": - { - "typeIdentifier": "t_array$_t_address_$dyn_storage_ptr", - "typeString": "address[]" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 6, - "mutability": "mutable", - "name": "e", - "nameLocation": "134:1:0", - "nodeType": "VariableDeclaration", - "scope": 18, - "src": "126:9:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": - { - "id": 5, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "126:7:0", - "stateMutability": "nonpayable", - "typeDescriptions": - { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "visibility": "internal" - } - ], - "src": "105:31:0" - }, - "returnParameters": - { - "id": 8, - "nodeType": "ParameterList", - "parameters": [], - "src": "151:0:0" - }, - "scope": 33, - "src": "88:97:0", - "stateMutability": "pure", - "virtual": false, - "visibility": "internal" - }, - { - "body": - { - "id": 31, - "nodeType": "Block", - "src": "247:29:0", - "statements": - [ - { - "expression": - { - "commonType": - { - "typeIdentifier": "t_int8", - "typeString": "int8" - }, - "id": 29, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": - { - "id": 27, - "name": "a", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 20, - "src": "264:1:0", - "typeDescriptions": - { - "typeIdentifier": "t_int8", - "typeString": "int8" - } - }, - "nodeType": "BinaryOperation", - "operator": "+", - "rightExpression": - { - "id": 28, - "name": "b", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 22, - "src": "268:1:0", - "typeDescriptions": - { - "typeIdentifier": "t_int8", - "typeString": "int8" - } - }, - "src": "264:5:0", - "typeDescriptions": - { - "typeIdentifier": "t_int8", - "typeString": "int8" - } - }, - "functionReturnParameters": 26, - "id": 30, - "nodeType": "Return", - "src": "257:12:0" - } - ] - }, - "functionSelector": "e2666777", - "id": 32, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "add", - "nameLocation": "200:3:0", - "nodeType": "FunctionDefinition", - "parameters": - { - "id": 23, - "nodeType": "ParameterList", - "parameters": - [ - { - "constant": false, - "id": 20, - "mutability": "mutable", - "name": "a", - "nameLocation": "209:1:0", - "nodeType": "VariableDeclaration", - "scope": 32, - "src": "204:6:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_int8", - "typeString": "int8" - }, - "typeName": - { - "id": 19, - "name": "int8", - "nodeType": "ElementaryTypeName", - "src": "204:4:0", - "typeDescriptions": - { - "typeIdentifier": "t_int8", - "typeString": "int8" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 22, - "mutability": "mutable", - "name": "b", - "nameLocation": "217:1:0", - "nodeType": "VariableDeclaration", - "scope": 32, - "src": "212:6:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_int8", - "typeString": "int8" - }, - "typeName": - { - "id": 21, - "name": "int8", - "nodeType": "ElementaryTypeName", - "src": "212:4:0", - "typeDescriptions": - { - "typeIdentifier": "t_int8", - "typeString": "int8" - } - }, - "visibility": "internal" - } - ], - "src": "203:16:0" - }, - "returnParameters": - { - "id": 26, - "nodeType": "ParameterList", - "parameters": - [ - { - "constant": false, - "id": 25, - "mutability": "mutable", - "name": "", - "nameLocation": "-1:-1:-1", - "nodeType": "VariableDeclaration", - "scope": 32, - "src": "241:4:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_int8", - "typeString": "int8" - }, - "typeName": - { - "id": 24, - "name": "int8", - "nodeType": "ElementaryTypeName", - "src": "241:4:0", - "typeDescriptions": - { - "typeIdentifier": "t_int8", - "typeString": "int8" - } - }, - "visibility": "internal" - } - ], - "src": "240:6:0" - }, - "scope": 33, - "src": "191:85:0", - "stateMutability": "pure", - "virtual": false, - "visibility": "public" - } - ], - "scope": 136, - "src": "68:210:0", - "usedErrors": [] - }, - { - "abstract": false, - "baseContracts": [], - "canonicalName": "C", - "contractDependencies": [], - "contractKind": "contract", - "fullyImplemented": true, - "id": 135, - "linearizedBaseContracts": - [ - 135 - ], - "name": "C", - "nameLocation": "289:1:0", - "nodeType": "ContractDefinition", - "nodes": - [ - { - "body": - { - "id": 59, - "nodeType": "Block", - "src": "353:99:0", - "statements": - [ - { - "assignments": - [ - 43 - ], - "declarations": - [ - { - "constant": false, - "id": 43, - "mutability": "mutable", - "name": "a", - "nameLocation": "380:1:0", - "nodeType": "VariableDeclaration", - "scope": 59, - "src": "363:18:0", - "stateVariable": false, - "storageLocation": "memory", - "typeDescriptions": - { - "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", - "typeString": "address[]" - }, - "typeName": - { - "baseType": - { - "id": 41, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "363:7:0", - "typeDescriptions": - { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "id": 42, - "nodeType": "ArrayTypeName", - "src": "363:9:0", - "typeDescriptions": - { - "typeIdentifier": "t_array$_t_address_$dyn_storage_ptr", - "typeString": "address[]" - } - }, - "visibility": "internal" - } - ], - "id": 49, - "initialValue": - { - "arguments": - [ - { - "hexValue": "31", - "id": 47, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "398:1:0", - "typeDescriptions": - { - "typeIdentifier": "t_rational_1_by_1", - "typeString": "int_const 1" - }, - "value": "1" - } - ], - "expression": - { - "argumentTypes": - [ - { - "typeIdentifier": "t_rational_1_by_1", - "typeString": "int_const 1" - } - ], - "id": 46, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "nodeType": "NewExpression", - "src": "384:13:0", - "typeDescriptions": - { - "typeIdentifier": "t_function_objectcreation_pure$_t_uint256_$returns$_t_array$_t_address_$dyn_memory_ptr_$", - "typeString": "function (uint256) pure returns (address[] memory)" - }, - "typeName": - { - "baseType": - { - "id": 44, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "388:7:0", - "stateMutability": "nonpayable", - "typeDescriptions": - { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "id": 45, - "nodeType": "ArrayTypeName", - "src": "388:9:0", - "typeDescriptions": - { - "typeIdentifier": "t_array$_t_address_$dyn_storage_ptr", - "typeString": "address[]" - } - } - }, - "id": 48, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "384:16:0", - "tryCall": false, - "typeDescriptions": - { - "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", - "typeString": "address[] memory" - } - }, - "nodeType": "VariableDeclarationStatement", - "src": "363:37:0" - }, - { - "expression": - { - "id": 55, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": - { - "baseExpression": - { - "id": 50, - "name": "a", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 43, - "src": "410:1:0", - "typeDescriptions": - { - "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", - "typeString": "address[] memory" - } - }, - "id": 52, - "indexExpression": - { - "hexValue": "30", - "id": 51, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "412:1:0", - "typeDescriptions": - { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - }, - "value": "0" - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": true, - "nodeType": "IndexAccess", - "src": "410:4:0", - "typeDescriptions": - { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": - { - "expression": - { - "id": 53, - "name": "msg", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": -15, - "src": "417:3:0", - "typeDescriptions": - { - "typeIdentifier": "t_magic_message", - "typeString": "msg" - } - }, - "id": 54, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "sender", - "nodeType": "MemberAccess", - "src": "417:10:0", - "typeDescriptions": - { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "src": "410:17:0", - "typeDescriptions": - { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "id": 56, - "nodeType": "ExpressionStatement", - "src": "410:17:0" - }, - { - "expression": - { - "id": 57, - "name": "a", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 43, - "src": "444:1:0", - "typeDescriptions": - { - "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", - "typeString": "address[] memory" - } - }, - "functionReturnParameters": 38, - "id": 58, - "nodeType": "Return", - "src": "437:8:0" - } - ] - }, - "functionSelector": "c2985578", - "id": 60, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "foo", - "nameLocation": "306:3:0", - "nodeType": "FunctionDefinition", - "parameters": - { - "id": 34, - "nodeType": "ParameterList", - "parameters": [], - "src": "309:2:0" - }, - "returnParameters": - { - "id": 38, - "nodeType": "ParameterList", - "parameters": - [ - { - "constant": false, - "id": 37, - "mutability": "mutable", - "name": "", - "nameLocation": "-1:-1:-1", - "nodeType": "VariableDeclaration", - "scope": 60, - "src": "335:16:0", - "stateVariable": false, - "storageLocation": "memory", - "typeDescriptions": - { - "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", - "typeString": "address[]" - }, - "typeName": - { - "baseType": - { - "id": 35, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "335:7:0", - "stateMutability": "nonpayable", - "typeDescriptions": - { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "id": 36, - "nodeType": "ArrayTypeName", - "src": "335:9:0", - "typeDescriptions": - { - "typeIdentifier": "t_array$_t_address_$dyn_storage_ptr", - "typeString": "address[]" - } - }, - "visibility": "internal" - } - ], - "src": "334:18:0" - }, - "scope": 135, - "src": "297:155:0", - "stateMutability": "view", - "virtual": false, - "visibility": "external" - }, - { - "body": - { - "id": 79, - "nodeType": "Block", - "src": "532:88:0", - "statements": - [ - { - "assignments": - [ - 68 - ], - "declarations": - [ - { - "constant": false, - "id": 68, - "mutability": "mutable", - "name": "a", - "nameLocation": "550:1:0", - "nodeType": "VariableDeclaration", - "scope": 79, - "src": "542:9:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": - { - "id": 67, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "542:7:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - } - ], - "id": 70, - "initialValue": - { - "hexValue": "3130", - "id": 69, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "554:2:0", - "typeDescriptions": - { - "typeIdentifier": "t_rational_10_by_1", - "typeString": "int_const 10" - }, - "value": "10" - }, - "nodeType": "VariableDeclarationStatement", - "src": "542:14:0" - }, - { - "assignments": - [ - 72 - ], - "declarations": - [ - { - "constant": false, - "id": 72, - "mutability": "mutable", - "name": "res", - "nameLocation": "574:3:0", - "nodeType": "VariableDeclaration", - "scope": 79, - "src": "566:11:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": - { - "id": 71, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "566:7:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - } - ], - "id": 76, - "initialValue": - { - "commonType": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 75, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": - { - "id": 73, - "name": "a", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 68, - "src": "580:1:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "**", - "rightExpression": - { - "id": 74, - "name": "decimals", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 62, - "src": "585:8:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - } - }, - "src": "580:13:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "VariableDeclarationStatement", - "src": "566:27:0" - }, - { - "expression": - { - "id": 77, - "name": "res", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 72, - "src": "610:3:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "functionReturnParameters": 66, - "id": 78, - "nodeType": "Return", - "src": "603:10:0" - } - ] - }, - "functionSelector": "eb79f1be", - "id": 80, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "get10PowerDecimals", - "nameLocation": "467:18:0", - "nodeType": "FunctionDefinition", - "parameters": - { - "id": 63, - "nodeType": "ParameterList", - "parameters": - [ - { - "constant": false, - "id": 62, - "mutability": "mutable", - "name": "decimals", - "nameLocation": "492:8:0", - "nodeType": "VariableDeclaration", - "scope": 80, - "src": "486:14:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - }, - "typeName": - { - "id": 61, - "name": "uint8", - "nodeType": "ElementaryTypeName", - "src": "486:5:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - } - }, - "visibility": "internal" - } - ], - "src": "485:16:0" - }, - "returnParameters": - { - "id": 66, - "nodeType": "ParameterList", - "parameters": - [ - { - "constant": false, - "id": 65, - "mutability": "mutable", - "name": "", - "nameLocation": "-1:-1:-1", - "nodeType": "VariableDeclaration", - "scope": 80, - "src": "523:7:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": - { - "id": 64, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "523:7:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - } - ], - "src": "522:9:0" - }, - "scope": 135, - "src": "458:162:0", - "stateMutability": "pure", - "virtual": false, - "visibility": "public" - }, - { - "body": - { - "id": 96, - "nodeType": "Block", - "src": "687:34:0", - "statements": - [ - { - "expression": - { - "arguments": - [ - { - "commonType": - { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "id": 93, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": - { - "baseExpression": - { - "id": 89, - "name": "c", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 83, - "src": "704:1:0", - "typeDescriptions": - { - "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", - "typeString": "address[] memory" - } - }, - "id": 91, - "indexExpression": - { - "hexValue": "30", - "id": 90, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "706:1:0", - "typeDescriptions": - { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - }, - "value": "0" - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "704:4:0", - "typeDescriptions": - { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "nodeType": "BinaryOperation", - "operator": "==", - "rightExpression": - { - "id": 92, - "name": "e", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 85, - "src": "712:1:0", - "typeDescriptions": - { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "src": "704:9:0", - "typeDescriptions": - { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - } - ], - "expression": - { - "argumentTypes": - [ - { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - ], - "id": 88, - "name": "assert", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": -3, - "src": "697:6:0", - "typeDescriptions": - { - "typeIdentifier": "t_function_assert_pure$_t_bool_$returns$__$", - "typeString": "function (bool) pure" - } - }, - "id": 94, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "697:17:0", - "tryCall": false, - "typeDescriptions": - { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 95, - "nodeType": "ExpressionStatement", - "src": "697:17:0" - } - ] - }, - "functionSelector": "e5b2857b", - "id": 97, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "getarray", - "nameLocation": "635:8:0", - "nodeType": "FunctionDefinition", - "parameters": - { - "id": 86, - "nodeType": "ParameterList", - "parameters": - [ - { - "constant": false, - "id": 83, - "mutability": "mutable", - "name": "c", - "nameLocation": "661:1:0", - "nodeType": "VariableDeclaration", - "scope": 97, - "src": "644:18:0", - "stateVariable": false, - "storageLocation": "memory", - "typeDescriptions": - { - "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", - "typeString": "address[]" - }, - "typeName": - { - "baseType": - { - "id": 81, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "644:7:0", - "stateMutability": "nonpayable", - "typeDescriptions": - { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "id": 82, - "nodeType": "ArrayTypeName", - "src": "644:9:0", - "typeDescriptions": - { - "typeIdentifier": "t_array$_t_address_$dyn_storage_ptr", - "typeString": "address[]" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 85, - "mutability": "mutable", - "name": "e", - "nameLocation": "672:1:0", - "nodeType": "VariableDeclaration", - "scope": 97, - "src": "664:9:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": - { - "id": 84, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "664:7:0", - "stateMutability": "nonpayable", - "typeDescriptions": - { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "visibility": "internal" - } - ], - "src": "643:31:0" - }, - "returnParameters": - { - "id": 87, - "nodeType": "ParameterList", - "parameters": [], - "src": "687:0:0" - }, - "scope": 135, - "src": "626:95:0", - "stateMutability": "pure", - "virtual": false, - "visibility": "public" - }, - { - "body": - { - "id": 119, - "nodeType": "Block", - "src": "763:90:0", - "statements": - [ - { - "assignments": - [ - 104 - ], - "declarations": - [ - { - "constant": false, - "id": 104, - "mutability": "mutable", - "name": "b", - "nameLocation": "790:1:0", - "nodeType": "VariableDeclaration", - "scope": 119, - "src": "773:18:0", - "stateVariable": false, - "storageLocation": "memory", - "typeDescriptions": - { - "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", - "typeString": "address[]" - }, - "typeName": - { - "baseType": - { - "id": 102, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "773:7:0", - "typeDescriptions": - { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "id": 103, - "nodeType": "ArrayTypeName", - "src": "773:9:0", - "typeDescriptions": - { - "typeIdentifier": "t_array$_t_address_$dyn_storage_ptr", - "typeString": "address[]" - } - }, - "visibility": "internal" - } - ], - "id": 108, - "initialValue": - { - "arguments": [], - "expression": - { - "argumentTypes": [], - "expression": - { - "id": 105, - "name": "this", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": -28, - "src": "794:4:0", - "typeDescriptions": - { - "typeIdentifier": "t_contract$_C_$135", - "typeString": "contract C" - } - }, - "id": 106, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "foo", - "nodeType": "MemberAccess", - "referencedDeclaration": 60, - "src": "794:8:0", - "typeDescriptions": - { - "typeIdentifier": "t_function_external_view$__$returns$_t_array$_t_address_$dyn_memory_ptr_$", - "typeString": "function () view external returns (address[] memory)" - } - }, - "id": 107, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "794:10:0", - "tryCall": false, - "typeDescriptions": - { - "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", - "typeString": "address[] memory" - } - }, - "nodeType": "VariableDeclarationStatement", - "src": "773:31:0" - }, - { - "expression": - { - "arguments": - [ - { - "id": 112, - "name": "b", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 104, - "src": "829:1:0", - "typeDescriptions": - { - "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", - "typeString": "address[] memory" - } - }, - { - "arguments": - [ - { - "id": 115, - "name": "this", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": -28, - "src": "840:4:0", - "typeDescriptions": - { - "typeIdentifier": "t_contract$_C_$135", - "typeString": "contract C" - } - } - ], - "expression": - { - "argumentTypes": - [ - { - "typeIdentifier": "t_contract$_C_$135", - "typeString": "contract C" - } - ], - "id": 114, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "nodeType": "ElementaryTypeNameExpression", - "src": "832:7:0", - "typeDescriptions": - { - "typeIdentifier": "t_type$_t_address_$", - "typeString": "type(address)" - }, - "typeName": - { - "id": 113, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "832:7:0", - "typeDescriptions": {} - } - }, - "id": 116, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "typeConversion", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "832:13:0", - "tryCall": false, - "typeDescriptions": - { - "typeIdentifier": "t_address", - "typeString": "address" - } - } - ], - "expression": - { - "argumentTypes": - [ - { - "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", - "typeString": "address[] memory" - }, - { - "typeIdentifier": "t_address", - "typeString": "address" - } - ], - "expression": - { - "id": 109, - "name": "Utils", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 33, - "src": "814:5:0", - "typeDescriptions": - { - "typeIdentifier": "t_type$_t_contract$_Utils_$33_$", - "typeString": "type(library Utils)" - } - }, - "id": 111, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "getarray", - "nodeType": "MemberAccess", - "referencedDeclaration": 18, - "src": "814:14:0", - "typeDescriptions": - { - "typeIdentifier": "t_function_internal_pure$_t_array$_t_address_$dyn_memory_ptr_$_t_address_$returns$__$", - "typeString": "function (address[] memory,address) pure" - } - }, - "id": 117, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "814:32:0", - "tryCall": false, - "typeDescriptions": - { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 118, - "nodeType": "ExpressionStatement", - "src": "814:32:0" - } - ] - }, - "functionSelector": "d3ab473b", - "id": 120, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "callmyself", - "nameLocation": "736:10:0", - "nodeType": "FunctionDefinition", - "parameters": - { - "id": 98, - "nodeType": "ParameterList", - "parameters": [], - "src": "746:2:0" - }, - "returnParameters": - { - "id": 99, - "nodeType": "ParameterList", - "parameters": [], - "src": "763:0:0" - }, - "scope": 135, - "src": "727:126:0", - "stateMutability": "view", - "virtual": false, - "visibility": "external" - }, - { - "body": - { - "id": 133, - "nodeType": "Block", - "src": "915:29:0", - "statements": - [ - { - "expression": - { - "commonType": - { - "typeIdentifier": "t_int8", - "typeString": "int8" - }, - "id": 131, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": - { - "id": 129, - "name": "c", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 122, - "src": "932:1:0", - "typeDescriptions": - { - "typeIdentifier": "t_int8", - "typeString": "int8" - } - }, - "nodeType": "BinaryOperation", - "operator": "+", - "rightExpression": - { - "id": 130, - "name": "d", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 124, - "src": "936:1:0", - "typeDescriptions": - { - "typeIdentifier": "t_int8", - "typeString": "int8" - } - }, - "src": "932:5:0", - "typeDescriptions": - { - "typeIdentifier": "t_int8", - "typeString": "int8" - } - }, - "functionReturnParameters": 128, - "id": 132, - "nodeType": "Return", - "src": "925:12:0" - } - ] - }, - "functionSelector": "e2666777", - "id": 134, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "add", - "nameLocation": "868:3:0", - "nodeType": "FunctionDefinition", - "parameters": - { - "id": 125, - "nodeType": "ParameterList", - "parameters": - [ - { - "constant": false, - "id": 122, - "mutability": "mutable", - "name": "c", - "nameLocation": "877:1:0", - "nodeType": "VariableDeclaration", - "scope": 134, - "src": "872:6:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_int8", - "typeString": "int8" - }, - "typeName": - { - "id": 121, - "name": "int8", - "nodeType": "ElementaryTypeName", - "src": "872:4:0", - "typeDescriptions": - { - "typeIdentifier": "t_int8", - "typeString": "int8" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 124, - "mutability": "mutable", - "name": "d", - "nameLocation": "885:1:0", - "nodeType": "VariableDeclaration", - "scope": 134, - "src": "880:6:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_int8", - "typeString": "int8" - }, - "typeName": - { - "id": 123, - "name": "int8", - "nodeType": "ElementaryTypeName", - "src": "880:4:0", - "typeDescriptions": - { - "typeIdentifier": "t_int8", - "typeString": "int8" - } - }, - "visibility": "internal" - } - ], - "src": "871:16:0" - }, - "returnParameters": - { - "id": 128, - "nodeType": "ParameterList", - "parameters": - [ - { - "constant": false, - "id": 127, - "mutability": "mutable", - "name": "", - "nameLocation": "-1:-1:-1", - "nodeType": "VariableDeclaration", - "scope": 134, - "src": "909:4:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_int8", - "typeString": "int8" - }, - "typeName": - { - "id": 126, - "name": "int8", - "nodeType": "ElementaryTypeName", - "src": "909:4:0", - "typeDescriptions": - { - "typeIdentifier": "t_int8", - "typeString": "int8" - } - }, - "visibility": "internal" - } - ], - "src": "908:6:0" - }, - "scope": 135, - "src": "859:85:0", - "stateMutability": "pure", - "virtual": false, - "visibility": "public" - } - ], - "scope": 136, - "src": "280:666:0", - "usedErrors": [] - } - ], - "src": "42:905:0" -} \ No newline at end of file diff --git a/resources/regressions/test3.json/input_json/C.sol_json.ast.json b/resources/regressions/test3.json/input_json/C.sol_json.ast.json deleted file mode 100644 index a3306b6..0000000 --- a/resources/regressions/test3.json/input_json/C.sol_json.ast.json +++ /dev/null @@ -1,1828 +0,0 @@ -{ - "absolutePath": "benchmarks/MultipleContracts/C.sol", - "exportedSymbols": - { - "C": - [ - 135 - ], - "Utils": - [ - 33 - ] - }, - "id": 136, - "license": "GPL-3.0-only", - "nodeType": "SourceUnit", - "nodes": - [ - { - "id": 1, - "literals": - [ - "solidity", - "^", - "0.8", - ".13" - ], - "nodeType": "PragmaDirective", - "src": "42:24:0" - }, - { - "abstract": false, - "baseContracts": [], - "canonicalName": "Utils", - "contractDependencies": [], - "contractKind": "library", - "fullyImplemented": true, - "id": 33, - "linearizedBaseContracts": - [ - 33 - ], - "name": "Utils", - "nameLocation": "76:5:0", - "nodeType": "ContractDefinition", - "nodes": - [ - { - "body": - { - "id": 17, - "nodeType": "Block", - "src": "151:34:0", - "statements": - [ - { - "expression": - { - "arguments": - [ - { - "commonType": - { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "id": 14, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": - { - "baseExpression": - { - "id": 10, - "name": "c", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4, - "src": "168:1:0", - "typeDescriptions": - { - "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", - "typeString": "address[] memory" - } - }, - "id": 12, - "indexExpression": - { - "hexValue": "30", - "id": 11, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "170:1:0", - "typeDescriptions": - { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - }, - "value": "0" - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "168:4:0", - "typeDescriptions": - { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "nodeType": "BinaryOperation", - "operator": "==", - "rightExpression": - { - "id": 13, - "name": "e", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 6, - "src": "176:1:0", - "typeDescriptions": - { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "src": "168:9:0", - "typeDescriptions": - { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - } - ], - "expression": - { - "argumentTypes": - [ - { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - ], - "id": 9, - "name": "assert", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": -3, - "src": "161:6:0", - "typeDescriptions": - { - "typeIdentifier": "t_function_assert_pure$_t_bool_$returns$__$", - "typeString": "function (bool) pure" - } - }, - "id": 15, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "161:17:0", - "tryCall": false, - "typeDescriptions": - { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 16, - "nodeType": "ExpressionStatement", - "src": "161:17:0" - } - ] - }, - "id": 18, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "getarray", - "nameLocation": "97:8:0", - "nodeType": "FunctionDefinition", - "parameters": - { - "id": 7, - "nodeType": "ParameterList", - "parameters": - [ - { - "constant": false, - "id": 4, - "mutability": "mutable", - "name": "c", - "nameLocation": "123:1:0", - "nodeType": "VariableDeclaration", - "scope": 18, - "src": "106:18:0", - "stateVariable": false, - "storageLocation": "memory", - "typeDescriptions": - { - "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", - "typeString": "address[]" - }, - "typeName": - { - "baseType": - { - "id": 2, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "106:7:0", - "stateMutability": "nonpayable", - "typeDescriptions": - { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "id": 3, - "nodeType": "ArrayTypeName", - "src": "106:9:0", - "typeDescriptions": - { - "typeIdentifier": "t_array$_t_address_$dyn_storage_ptr", - "typeString": "address[]" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 6, - "mutability": "mutable", - "name": "e", - "nameLocation": "134:1:0", - "nodeType": "VariableDeclaration", - "scope": 18, - "src": "126:9:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": - { - "id": 5, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "126:7:0", - "stateMutability": "nonpayable", - "typeDescriptions": - { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "visibility": "internal" - } - ], - "src": "105:31:0" - }, - "returnParameters": - { - "id": 8, - "nodeType": "ParameterList", - "parameters": [], - "src": "151:0:0" - }, - "scope": 33, - "src": "88:97:0", - "stateMutability": "pure", - "virtual": false, - "visibility": "internal" - }, - { - "body": - { - "id": 31, - "nodeType": "Block", - "src": "247:29:0", - "statements": - [ - { - "expression": - { - "commonType": - { - "typeIdentifier": "t_int8", - "typeString": "int8" - }, - "id": 29, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": - { - "id": 27, - "name": "a", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 20, - "src": "264:1:0", - "typeDescriptions": - { - "typeIdentifier": "t_int8", - "typeString": "int8" - } - }, - "nodeType": "BinaryOperation", - "operator": "+", - "rightExpression": - { - "id": 28, - "name": "b", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 22, - "src": "268:1:0", - "typeDescriptions": - { - "typeIdentifier": "t_int8", - "typeString": "int8" - } - }, - "src": "264:5:0", - "typeDescriptions": - { - "typeIdentifier": "t_int8", - "typeString": "int8" - } - }, - "functionReturnParameters": 26, - "id": 30, - "nodeType": "Return", - "src": "257:12:0" - } - ] - }, - "functionSelector": "e2666777", - "id": 32, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "add", - "nameLocation": "200:3:0", - "nodeType": "FunctionDefinition", - "parameters": - { - "id": 23, - "nodeType": "ParameterList", - "parameters": - [ - { - "constant": false, - "id": 20, - "mutability": "mutable", - "name": "a", - "nameLocation": "209:1:0", - "nodeType": "VariableDeclaration", - "scope": 32, - "src": "204:6:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_int8", - "typeString": "int8" - }, - "typeName": - { - "id": 19, - "name": "int8", - "nodeType": "ElementaryTypeName", - "src": "204:4:0", - "typeDescriptions": - { - "typeIdentifier": "t_int8", - "typeString": "int8" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 22, - "mutability": "mutable", - "name": "b", - "nameLocation": "217:1:0", - "nodeType": "VariableDeclaration", - "scope": 32, - "src": "212:6:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_int8", - "typeString": "int8" - }, - "typeName": - { - "id": 21, - "name": "int8", - "nodeType": "ElementaryTypeName", - "src": "212:4:0", - "typeDescriptions": - { - "typeIdentifier": "t_int8", - "typeString": "int8" - } - }, - "visibility": "internal" - } - ], - "src": "203:16:0" - }, - "returnParameters": - { - "id": 26, - "nodeType": "ParameterList", - "parameters": - [ - { - "constant": false, - "id": 25, - "mutability": "mutable", - "name": "", - "nameLocation": "-1:-1:-1", - "nodeType": "VariableDeclaration", - "scope": 32, - "src": "241:4:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_int8", - "typeString": "int8" - }, - "typeName": - { - "id": 24, - "name": "int8", - "nodeType": "ElementaryTypeName", - "src": "241:4:0", - "typeDescriptions": - { - "typeIdentifier": "t_int8", - "typeString": "int8" - } - }, - "visibility": "internal" - } - ], - "src": "240:6:0" - }, - "scope": 33, - "src": "191:85:0", - "stateMutability": "pure", - "virtual": false, - "visibility": "public" - } - ], - "scope": 136, - "src": "68:210:0", - "usedErrors": [] - }, - { - "abstract": false, - "baseContracts": [], - "canonicalName": "C", - "contractDependencies": [], - "contractKind": "contract", - "fullyImplemented": true, - "id": 135, - "linearizedBaseContracts": - [ - 135 - ], - "name": "C", - "nameLocation": "289:1:0", - "nodeType": "ContractDefinition", - "nodes": - [ - { - "body": - { - "id": 59, - "nodeType": "Block", - "src": "353:99:0", - "statements": - [ - { - "assignments": - [ - 43 - ], - "declarations": - [ - { - "constant": false, - "id": 43, - "mutability": "mutable", - "name": "a", - "nameLocation": "380:1:0", - "nodeType": "VariableDeclaration", - "scope": 59, - "src": "363:18:0", - "stateVariable": false, - "storageLocation": "memory", - "typeDescriptions": - { - "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", - "typeString": "address[]" - }, - "typeName": - { - "baseType": - { - "id": 41, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "363:7:0", - "typeDescriptions": - { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "id": 42, - "nodeType": "ArrayTypeName", - "src": "363:9:0", - "typeDescriptions": - { - "typeIdentifier": "t_array$_t_address_$dyn_storage_ptr", - "typeString": "address[]" - } - }, - "visibility": "internal" - } - ], - "id": 49, - "initialValue": - { - "arguments": - [ - { - "hexValue": "31", - "id": 47, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "398:1:0", - "typeDescriptions": - { - "typeIdentifier": "t_rational_1_by_1", - "typeString": "int_const 1" - }, - "value": "1" - } - ], - "expression": - { - "argumentTypes": - [ - { - "typeIdentifier": "t_rational_1_by_1", - "typeString": "int_const 1" - } - ], - "id": 46, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "nodeType": "NewExpression", - "src": "384:13:0", - "typeDescriptions": - { - "typeIdentifier": "t_function_objectcreation_pure$_t_uint256_$returns$_t_array$_t_address_$dyn_memory_ptr_$", - "typeString": "function (uint256) pure returns (address[] memory)" - }, - "typeName": - { - "baseType": - { - "id": 44, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "388:7:0", - "stateMutability": "nonpayable", - "typeDescriptions": - { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "id": 45, - "nodeType": "ArrayTypeName", - "src": "388:9:0", - "typeDescriptions": - { - "typeIdentifier": "t_array$_t_address_$dyn_storage_ptr", - "typeString": "address[]" - } - } - }, - "id": 48, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "384:16:0", - "tryCall": false, - "typeDescriptions": - { - "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", - "typeString": "address[] memory" - } - }, - "nodeType": "VariableDeclarationStatement", - "src": "363:37:0" - }, - { - "expression": - { - "id": 55, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": - { - "baseExpression": - { - "id": 50, - "name": "a", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 43, - "src": "410:1:0", - "typeDescriptions": - { - "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", - "typeString": "address[] memory" - } - }, - "id": 52, - "indexExpression": - { - "hexValue": "30", - "id": 51, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "412:1:0", - "typeDescriptions": - { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - }, - "value": "0" - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": true, - "nodeType": "IndexAccess", - "src": "410:4:0", - "typeDescriptions": - { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": - { - "expression": - { - "id": 53, - "name": "msg", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": -15, - "src": "417:3:0", - "typeDescriptions": - { - "typeIdentifier": "t_magic_message", - "typeString": "msg" - } - }, - "id": 54, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "sender", - "nodeType": "MemberAccess", - "src": "417:10:0", - "typeDescriptions": - { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "src": "410:17:0", - "typeDescriptions": - { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "id": 56, - "nodeType": "ExpressionStatement", - "src": "410:17:0" - }, - { - "expression": - { - "id": 57, - "name": "a", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 43, - "src": "444:1:0", - "typeDescriptions": - { - "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", - "typeString": "address[] memory" - } - }, - "functionReturnParameters": 38, - "id": 58, - "nodeType": "Return", - "src": "437:8:0" - } - ] - }, - "functionSelector": "c2985578", - "id": 60, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "foo", - "nameLocation": "306:3:0", - "nodeType": "FunctionDefinition", - "parameters": - { - "id": 34, - "nodeType": "ParameterList", - "parameters": [], - "src": "309:2:0" - }, - "returnParameters": - { - "id": 38, - "nodeType": "ParameterList", - "parameters": - [ - { - "constant": false, - "id": 37, - "mutability": "mutable", - "name": "", - "nameLocation": "-1:-1:-1", - "nodeType": "VariableDeclaration", - "scope": 60, - "src": "335:16:0", - "stateVariable": false, - "storageLocation": "memory", - "typeDescriptions": - { - "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", - "typeString": "address[]" - }, - "typeName": - { - "baseType": - { - "id": 35, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "335:7:0", - "stateMutability": "nonpayable", - "typeDescriptions": - { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "id": 36, - "nodeType": "ArrayTypeName", - "src": "335:9:0", - "typeDescriptions": - { - "typeIdentifier": "t_array$_t_address_$dyn_storage_ptr", - "typeString": "address[]" - } - }, - "visibility": "internal" - } - ], - "src": "334:18:0" - }, - "scope": 135, - "src": "297:155:0", - "stateMutability": "view", - "virtual": false, - "visibility": "external" - }, - { - "body": - { - "id": 79, - "nodeType": "Block", - "src": "532:88:0", - "statements": - [ - { - "assignments": - [ - 68 - ], - "declarations": - [ - { - "constant": false, - "id": 68, - "mutability": "mutable", - "name": "a", - "nameLocation": "550:1:0", - "nodeType": "VariableDeclaration", - "scope": 79, - "src": "542:9:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": - { - "id": 67, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "542:7:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - } - ], - "id": 70, - "initialValue": - { - "hexValue": "3130", - "id": 69, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "554:2:0", - "typeDescriptions": - { - "typeIdentifier": "t_rational_10_by_1", - "typeString": "int_const 10" - }, - "value": "10" - }, - "nodeType": "VariableDeclarationStatement", - "src": "542:14:0" - }, - { - "assignments": - [ - 72 - ], - "declarations": - [ - { - "constant": false, - "id": 72, - "mutability": "mutable", - "name": "res", - "nameLocation": "574:3:0", - "nodeType": "VariableDeclaration", - "scope": 79, - "src": "566:11:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": - { - "id": 71, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "566:7:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - } - ], - "id": 76, - "initialValue": - { - "commonType": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 75, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": - { - "id": 73, - "name": "a", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 68, - "src": "580:1:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "**", - "rightExpression": - { - "id": 74, - "name": "decimals", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 62, - "src": "585:8:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - } - }, - "src": "580:13:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "VariableDeclarationStatement", - "src": "566:27:0" - }, - { - "expression": - { - "id": 77, - "name": "res", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 72, - "src": "610:3:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "functionReturnParameters": 66, - "id": 78, - "nodeType": "Return", - "src": "603:10:0" - } - ] - }, - "functionSelector": "eb79f1be", - "id": 80, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "get10PowerDecimals", - "nameLocation": "467:18:0", - "nodeType": "FunctionDefinition", - "parameters": - { - "id": 63, - "nodeType": "ParameterList", - "parameters": - [ - { - "constant": false, - "id": 62, - "mutability": "mutable", - "name": "decimals", - "nameLocation": "492:8:0", - "nodeType": "VariableDeclaration", - "scope": 80, - "src": "486:14:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - }, - "typeName": - { - "id": 61, - "name": "uint8", - "nodeType": "ElementaryTypeName", - "src": "486:5:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - } - }, - "visibility": "internal" - } - ], - "src": "485:16:0" - }, - "returnParameters": - { - "id": 66, - "nodeType": "ParameterList", - "parameters": - [ - { - "constant": false, - "id": 65, - "mutability": "mutable", - "name": "", - "nameLocation": "-1:-1:-1", - "nodeType": "VariableDeclaration", - "scope": 80, - "src": "523:7:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": - { - "id": 64, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "523:7:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - } - ], - "src": "522:9:0" - }, - "scope": 135, - "src": "458:162:0", - "stateMutability": "pure", - "virtual": false, - "visibility": "public" - }, - { - "body": - { - "id": 96, - "nodeType": "Block", - "src": "687:34:0", - "statements": - [ - { - "expression": - { - "arguments": - [ - { - "commonType": - { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "id": 93, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": - { - "baseExpression": - { - "id": 89, - "name": "c", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 83, - "src": "704:1:0", - "typeDescriptions": - { - "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", - "typeString": "address[] memory" - } - }, - "id": 91, - "indexExpression": - { - "hexValue": "30", - "id": 90, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "706:1:0", - "typeDescriptions": - { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - }, - "value": "0" - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "704:4:0", - "typeDescriptions": - { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "nodeType": "BinaryOperation", - "operator": "==", - "rightExpression": - { - "id": 92, - "name": "e", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 85, - "src": "712:1:0", - "typeDescriptions": - { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "src": "704:9:0", - "typeDescriptions": - { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - } - ], - "expression": - { - "argumentTypes": - [ - { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - ], - "id": 88, - "name": "assert", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": -3, - "src": "697:6:0", - "typeDescriptions": - { - "typeIdentifier": "t_function_assert_pure$_t_bool_$returns$__$", - "typeString": "function (bool) pure" - } - }, - "id": 94, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "697:17:0", - "tryCall": false, - "typeDescriptions": - { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 95, - "nodeType": "ExpressionStatement", - "src": "697:17:0" - } - ] - }, - "functionSelector": "e5b2857b", - "id": 97, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "getarray", - "nameLocation": "635:8:0", - "nodeType": "FunctionDefinition", - "parameters": - { - "id": 86, - "nodeType": "ParameterList", - "parameters": - [ - { - "constant": false, - "id": 83, - "mutability": "mutable", - "name": "c", - "nameLocation": "661:1:0", - "nodeType": "VariableDeclaration", - "scope": 97, - "src": "644:18:0", - "stateVariable": false, - "storageLocation": "memory", - "typeDescriptions": - { - "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", - "typeString": "address[]" - }, - "typeName": - { - "baseType": - { - "id": 81, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "644:7:0", - "stateMutability": "nonpayable", - "typeDescriptions": - { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "id": 82, - "nodeType": "ArrayTypeName", - "src": "644:9:0", - "typeDescriptions": - { - "typeIdentifier": "t_array$_t_address_$dyn_storage_ptr", - "typeString": "address[]" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 85, - "mutability": "mutable", - "name": "e", - "nameLocation": "672:1:0", - "nodeType": "VariableDeclaration", - "scope": 97, - "src": "664:9:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": - { - "id": 84, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "664:7:0", - "stateMutability": "nonpayable", - "typeDescriptions": - { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "visibility": "internal" - } - ], - "src": "643:31:0" - }, - "returnParameters": - { - "id": 87, - "nodeType": "ParameterList", - "parameters": [], - "src": "687:0:0" - }, - "scope": 135, - "src": "626:95:0", - "stateMutability": "pure", - "virtual": false, - "visibility": "public" - }, - { - "body": - { - "id": 119, - "nodeType": "Block", - "src": "763:90:0", - "statements": - [ - { - "assignments": - [ - 104 - ], - "declarations": - [ - { - "constant": false, - "id": 104, - "mutability": "mutable", - "name": "b", - "nameLocation": "790:1:0", - "nodeType": "VariableDeclaration", - "scope": 119, - "src": "773:18:0", - "stateVariable": false, - "storageLocation": "memory", - "typeDescriptions": - { - "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", - "typeString": "address[]" - }, - "typeName": - { - "baseType": - { - "id": 102, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "773:7:0", - "typeDescriptions": - { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "id": 103, - "nodeType": "ArrayTypeName", - "src": "773:9:0", - "typeDescriptions": - { - "typeIdentifier": "t_array$_t_address_$dyn_storage_ptr", - "typeString": "address[]" - } - }, - "visibility": "internal" - } - ], - "id": 108, - "initialValue": - { - "arguments": [], - "expression": - { - "argumentTypes": [], - "expression": - { - "id": 105, - "name": "this", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": -28, - "src": "794:4:0", - "typeDescriptions": - { - "typeIdentifier": "t_contract$_C_$135", - "typeString": "contract C" - } - }, - "id": 106, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "foo", - "nodeType": "MemberAccess", - "referencedDeclaration": 60, - "src": "794:8:0", - "typeDescriptions": - { - "typeIdentifier": "t_function_external_view$__$returns$_t_array$_t_address_$dyn_memory_ptr_$", - "typeString": "function () view external returns (address[] memory)" - } - }, - "id": 107, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "794:10:0", - "tryCall": false, - "typeDescriptions": - { - "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", - "typeString": "address[] memory" - } - }, - "nodeType": "VariableDeclarationStatement", - "src": "773:31:0" - }, - { - "expression": - { - "arguments": - [ - { - "id": 112, - "name": "b", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 104, - "src": "829:1:0", - "typeDescriptions": - { - "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", - "typeString": "address[] memory" - } - }, - { - "arguments": - [ - { - "id": 115, - "name": "this", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": -28, - "src": "840:4:0", - "typeDescriptions": - { - "typeIdentifier": "t_contract$_C_$135", - "typeString": "contract C" - } - } - ], - "expression": - { - "argumentTypes": - [ - { - "typeIdentifier": "t_contract$_C_$135", - "typeString": "contract C" - } - ], - "id": 114, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "nodeType": "ElementaryTypeNameExpression", - "src": "832:7:0", - "typeDescriptions": - { - "typeIdentifier": "t_type$_t_address_$", - "typeString": "type(address)" - }, - "typeName": - { - "id": 113, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "832:7:0", - "typeDescriptions": {} - } - }, - "id": 116, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "typeConversion", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "832:13:0", - "tryCall": false, - "typeDescriptions": - { - "typeIdentifier": "t_address", - "typeString": "address" - } - } - ], - "expression": - { - "argumentTypes": - [ - { - "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", - "typeString": "address[] memory" - }, - { - "typeIdentifier": "t_address", - "typeString": "address" - } - ], - "expression": - { - "id": 109, - "name": "Utils", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 33, - "src": "814:5:0", - "typeDescriptions": - { - "typeIdentifier": "t_type$_t_contract$_Utils_$33_$", - "typeString": "type(library Utils)" - } - }, - "id": 111, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "getarray", - "nodeType": "MemberAccess", - "referencedDeclaration": 18, - "src": "814:14:0", - "typeDescriptions": - { - "typeIdentifier": "t_function_internal_pure$_t_array$_t_address_$dyn_memory_ptr_$_t_address_$returns$__$", - "typeString": "function (address[] memory,address) pure" - } - }, - "id": 117, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "814:32:0", - "tryCall": false, - "typeDescriptions": - { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 118, - "nodeType": "ExpressionStatement", - "src": "814:32:0" - } - ] - }, - "functionSelector": "d3ab473b", - "id": 120, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "callmyself", - "nameLocation": "736:10:0", - "nodeType": "FunctionDefinition", - "parameters": - { - "id": 98, - "nodeType": "ParameterList", - "parameters": [], - "src": "746:2:0" - }, - "returnParameters": - { - "id": 99, - "nodeType": "ParameterList", - "parameters": [], - "src": "763:0:0" - }, - "scope": 135, - "src": "727:126:0", - "stateMutability": "view", - "virtual": false, - "visibility": "external" - }, - { - "body": - { - "id": 133, - "nodeType": "Block", - "src": "915:29:0", - "statements": - [ - { - "expression": - { - "commonType": - { - "typeIdentifier": "t_int8", - "typeString": "int8" - }, - "id": 131, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": - { - "id": 129, - "name": "c", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 122, - "src": "932:1:0", - "typeDescriptions": - { - "typeIdentifier": "t_int8", - "typeString": "int8" - } - }, - "nodeType": "BinaryOperation", - "operator": "+", - "rightExpression": - { - "id": 130, - "name": "d", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 124, - "src": "936:1:0", - "typeDescriptions": - { - "typeIdentifier": "t_int8", - "typeString": "int8" - } - }, - "src": "932:5:0", - "typeDescriptions": - { - "typeIdentifier": "t_int8", - "typeString": "int8" - } - }, - "functionReturnParameters": 128, - "id": 132, - "nodeType": "Return", - "src": "925:12:0" - } - ] - }, - "functionSelector": "e2666777", - "id": 134, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "add", - "nameLocation": "868:3:0", - "nodeType": "FunctionDefinition", - "parameters": - { - "id": 125, - "nodeType": "ParameterList", - "parameters": - [ - { - "constant": false, - "id": 122, - "mutability": "mutable", - "name": "c", - "nameLocation": "877:1:0", - "nodeType": "VariableDeclaration", - "scope": 134, - "src": "872:6:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_int8", - "typeString": "int8" - }, - "typeName": - { - "id": 121, - "name": "int8", - "nodeType": "ElementaryTypeName", - "src": "872:4:0", - "typeDescriptions": - { - "typeIdentifier": "t_int8", - "typeString": "int8" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 124, - "mutability": "mutable", - "name": "d", - "nameLocation": "885:1:0", - "nodeType": "VariableDeclaration", - "scope": 134, - "src": "880:6:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_int8", - "typeString": "int8" - }, - "typeName": - { - "id": 123, - "name": "int8", - "nodeType": "ElementaryTypeName", - "src": "880:4:0", - "typeDescriptions": - { - "typeIdentifier": "t_int8", - "typeString": "int8" - } - }, - "visibility": "internal" - } - ], - "src": "871:16:0" - }, - "returnParameters": - { - "id": 128, - "nodeType": "ParameterList", - "parameters": - [ - { - "constant": false, - "id": 127, - "mutability": "mutable", - "name": "", - "nameLocation": "-1:-1:-1", - "nodeType": "VariableDeclaration", - "scope": 134, - "src": "909:4:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_int8", - "typeString": "int8" - }, - "typeName": - { - "id": 126, - "name": "int8", - "nodeType": "ElementaryTypeName", - "src": "909:4:0", - "typeDescriptions": - { - "typeIdentifier": "t_int8", - "typeString": "int8" - } - }, - "visibility": "internal" - } - ], - "src": "908:6:0" - }, - "scope": 135, - "src": "859:85:0", - "stateMutability": "pure", - "virtual": false, - "visibility": "public" - } - ], - "scope": 136, - "src": "280:666:0", - "usedErrors": [] - } - ], - "src": "42:905:0" -} \ No newline at end of file diff --git a/resources/regressions/test3.json/input_json/TenPower.sol_json.ast b/resources/regressions/test3.json/input_json/TenPower.sol_json.ast deleted file mode 100644 index b5bf1c3..0000000 --- a/resources/regressions/test3.json/input_json/TenPower.sol_json.ast +++ /dev/null @@ -1,334 +0,0 @@ -{ - "absolutePath": "benchmarks/10Power/TenPower.sol", - "exportedSymbols": - { - "TenPower": - [ - 23 - ] - }, - "id": 24, - "license": "GPL-3.0-only", - "nodeType": "SourceUnit", - "nodes": - [ - { - "id": 1, - "literals": - [ - "solidity", - ">", - "0.7", - ".0" - ], - "nodeType": "PragmaDirective", - "src": "41:23:0" - }, - { - "id": 2, - "literals": - [ - "experimental", - "ABIEncoderV2" - ], - "nodeType": "PragmaDirective", - "src": "65:33:0" - }, - { - "abstract": false, - "baseContracts": [], - "canonicalName": "TenPower", - "contractDependencies": [], - "contractKind": "contract", - "fullyImplemented": true, - "id": 23, - "linearizedBaseContracts": - [ - 23 - ], - "name": "TenPower", - "nameLocation": "109:8:0", - "nodeType": "ContractDefinition", - "nodes": - [ - { - "body": - { - "id": 21, - "nodeType": "Block", - "src": "198:122:0", - "statements": - [ - { - "assignments": - [ - 10 - ], - "declarations": - [ - { - "constant": false, - "id": 10, - "mutability": "mutable", - "name": "a", - "nameLocation": "216:1:0", - "nodeType": "VariableDeclaration", - "scope": 21, - "src": "208:9:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": - { - "id": 9, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "208:7:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - } - ], - "id": 12, - "initialValue": - { - "hexValue": "3130", - "id": 11, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "220:2:0", - "typeDescriptions": - { - "typeIdentifier": "t_rational_10_by_1", - "typeString": "int_const 10" - }, - "value": "10" - }, - "nodeType": "VariableDeclarationStatement", - "src": "208:14:0" - }, - { - "assignments": - [ - 14 - ], - "declarations": - [ - { - "constant": false, - "id": 14, - "mutability": "mutable", - "name": "res", - "nameLocation": "240:3:0", - "nodeType": "VariableDeclaration", - "scope": 21, - "src": "232:11:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": - { - "id": 13, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "232:7:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - } - ], - "id": 18, - "initialValue": - { - "commonType": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 17, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": - { - "id": 15, - "name": "a", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 10, - "src": "246:1:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "**", - "rightExpression": - { - "id": 16, - "name": "decimals", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4, - "src": "251:8:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - } - }, - "src": "246:13:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "VariableDeclarationStatement", - "src": "232:27:0" - }, - { - "expression": - { - "id": 19, - "name": "res", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 14, - "src": "276:3:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "functionReturnParameters": 8, - "id": 20, - "nodeType": "Return", - "src": "269:10:0" - } - ] - }, - "functionSelector": "eb79f1be", - "id": 22, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "get10PowerDecimals", - "nameLocation": "133:18:0", - "nodeType": "FunctionDefinition", - "parameters": - { - "id": 5, - "nodeType": "ParameterList", - "parameters": - [ - { - "constant": false, - "id": 4, - "mutability": "mutable", - "name": "decimals", - "nameLocation": "158:8:0", - "nodeType": "VariableDeclaration", - "scope": 22, - "src": "152:14:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - }, - "typeName": - { - "id": 3, - "name": "uint8", - "nodeType": "ElementaryTypeName", - "src": "152:5:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - } - }, - "visibility": "internal" - } - ], - "src": "151:16:0" - }, - "returnParameters": - { - "id": 8, - "nodeType": "ParameterList", - "parameters": - [ - { - "constant": false, - "id": 7, - "mutability": "mutable", - "name": "", - "nameLocation": "-1:-1:-1", - "nodeType": "VariableDeclaration", - "scope": 22, - "src": "189:7:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": - { - "id": 6, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "189:7:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - } - ], - "src": "188:9:0" - }, - "scope": 23, - "src": "124:196:0", - "stateMutability": "pure", - "virtual": false, - "visibility": "public" - } - ], - "scope": 24, - "src": "100:222:0", - "usedErrors": [] - } - ], - "src": "41:282:0" -} \ No newline at end of file diff --git a/resources/regressions/test3.json/input_json/TenPower.sol_json.ast.json b/resources/regressions/test3.json/input_json/TenPower.sol_json.ast.json deleted file mode 100644 index b5bf1c3..0000000 --- a/resources/regressions/test3.json/input_json/TenPower.sol_json.ast.json +++ /dev/null @@ -1,334 +0,0 @@ -{ - "absolutePath": "benchmarks/10Power/TenPower.sol", - "exportedSymbols": - { - "TenPower": - [ - 23 - ] - }, - "id": 24, - "license": "GPL-3.0-only", - "nodeType": "SourceUnit", - "nodes": - [ - { - "id": 1, - "literals": - [ - "solidity", - ">", - "0.7", - ".0" - ], - "nodeType": "PragmaDirective", - "src": "41:23:0" - }, - { - "id": 2, - "literals": - [ - "experimental", - "ABIEncoderV2" - ], - "nodeType": "PragmaDirective", - "src": "65:33:0" - }, - { - "abstract": false, - "baseContracts": [], - "canonicalName": "TenPower", - "contractDependencies": [], - "contractKind": "contract", - "fullyImplemented": true, - "id": 23, - "linearizedBaseContracts": - [ - 23 - ], - "name": "TenPower", - "nameLocation": "109:8:0", - "nodeType": "ContractDefinition", - "nodes": - [ - { - "body": - { - "id": 21, - "nodeType": "Block", - "src": "198:122:0", - "statements": - [ - { - "assignments": - [ - 10 - ], - "declarations": - [ - { - "constant": false, - "id": 10, - "mutability": "mutable", - "name": "a", - "nameLocation": "216:1:0", - "nodeType": "VariableDeclaration", - "scope": 21, - "src": "208:9:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": - { - "id": 9, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "208:7:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - } - ], - "id": 12, - "initialValue": - { - "hexValue": "3130", - "id": 11, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "220:2:0", - "typeDescriptions": - { - "typeIdentifier": "t_rational_10_by_1", - "typeString": "int_const 10" - }, - "value": "10" - }, - "nodeType": "VariableDeclarationStatement", - "src": "208:14:0" - }, - { - "assignments": - [ - 14 - ], - "declarations": - [ - { - "constant": false, - "id": 14, - "mutability": "mutable", - "name": "res", - "nameLocation": "240:3:0", - "nodeType": "VariableDeclaration", - "scope": 21, - "src": "232:11:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": - { - "id": 13, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "232:7:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - } - ], - "id": 18, - "initialValue": - { - "commonType": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 17, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": - { - "id": 15, - "name": "a", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 10, - "src": "246:1:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "**", - "rightExpression": - { - "id": 16, - "name": "decimals", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4, - "src": "251:8:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - } - }, - "src": "246:13:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "VariableDeclarationStatement", - "src": "232:27:0" - }, - { - "expression": - { - "id": 19, - "name": "res", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 14, - "src": "276:3:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "functionReturnParameters": 8, - "id": 20, - "nodeType": "Return", - "src": "269:10:0" - } - ] - }, - "functionSelector": "eb79f1be", - "id": 22, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "get10PowerDecimals", - "nameLocation": "133:18:0", - "nodeType": "FunctionDefinition", - "parameters": - { - "id": 5, - "nodeType": "ParameterList", - "parameters": - [ - { - "constant": false, - "id": 4, - "mutability": "mutable", - "name": "decimals", - "nameLocation": "158:8:0", - "nodeType": "VariableDeclaration", - "scope": 22, - "src": "152:14:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - }, - "typeName": - { - "id": 3, - "name": "uint8", - "nodeType": "ElementaryTypeName", - "src": "152:5:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - } - }, - "visibility": "internal" - } - ], - "src": "151:16:0" - }, - "returnParameters": - { - "id": 8, - "nodeType": "ParameterList", - "parameters": - [ - { - "constant": false, - "id": 7, - "mutability": "mutable", - "name": "", - "nameLocation": "-1:-1:-1", - "nodeType": "VariableDeclaration", - "scope": 22, - "src": "189:7:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": - { - "id": 6, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "189:7:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - } - ], - "src": "188:9:0" - }, - "scope": 23, - "src": "124:196:0", - "stateMutability": "pure", - "virtual": false, - "visibility": "public" - } - ], - "scope": 24, - "src": "100:222:0", - "usedErrors": [] - } - ], - "src": "41:282:0" -} \ No newline at end of file diff --git a/resources/regressions/test3.json/mutants.log b/resources/regressions/test3.json/mutants.log deleted file mode 100644 index 8257640..0000000 --- a/resources/regressions/test3.json/mutants.log +++ /dev/null @@ -1,6 +0,0 @@ -1,BinaryOpMutation,10Power/TenPower.sol,8:24, ** ,+ -2,BinaryOpMutation,10Power/TenPower.sol,8:24, ** ,- -3,BinaryOpMutation,10Power/TenPower.sol,8:24, ** ,* -4,BinaryOpMutation,10Power/TenPower.sol,8:24, ** ,/ -5,BinaryOpMutation,10Power/TenPower.sol,8:24, ** ,% -6,SwapArgumentsOperatorMutation,10Power/TenPower.sol,8:23,a ** decimals,decimals ** a diff --git a/resources/regressions/test3.json/mutants/1/10Power/TenPower.sol b/resources/regressions/test3.json/mutants/1/10Power/TenPower.sol deleted file mode 100644 index 4990844..0000000 --- a/resources/regressions/test3.json/mutants/1/10Power/TenPower.sol +++ /dev/null @@ -1,13 +0,0 @@ -// SPDX-License-Identifier: GPL-3.0-only -pragma solidity >0.7.0; -pragma experimental ABIEncoderV2; - -contract TenPower { - function get10PowerDecimals(uint8 decimals) public pure returns (uint256) { - uint256 a = 10; - /// BinaryOpMutation(`**` |==> `+`) of: `uint256 res = a ** decimals;` - uint256 res = a+decimals; - return res; - // return 10 ** decimals; - } -} diff --git a/resources/regressions/test3.json/mutants/2/10Power/TenPower.sol b/resources/regressions/test3.json/mutants/2/10Power/TenPower.sol deleted file mode 100644 index 23654dc..0000000 --- a/resources/regressions/test3.json/mutants/2/10Power/TenPower.sol +++ /dev/null @@ -1,13 +0,0 @@ -// SPDX-License-Identifier: GPL-3.0-only -pragma solidity >0.7.0; -pragma experimental ABIEncoderV2; - -contract TenPower { - function get10PowerDecimals(uint8 decimals) public pure returns (uint256) { - uint256 a = 10; - /// BinaryOpMutation(`**` |==> `-`) of: `uint256 res = a ** decimals;` - uint256 res = a-decimals; - return res; - // return 10 ** decimals; - } -} diff --git a/resources/regressions/test3.json/mutants/3/10Power/TenPower.sol b/resources/regressions/test3.json/mutants/3/10Power/TenPower.sol deleted file mode 100644 index 66d1760..0000000 --- a/resources/regressions/test3.json/mutants/3/10Power/TenPower.sol +++ /dev/null @@ -1,13 +0,0 @@ -// SPDX-License-Identifier: GPL-3.0-only -pragma solidity >0.7.0; -pragma experimental ABIEncoderV2; - -contract TenPower { - function get10PowerDecimals(uint8 decimals) public pure returns (uint256) { - uint256 a = 10; - /// BinaryOpMutation(`**` |==> `*`) of: `uint256 res = a ** decimals;` - uint256 res = a*decimals; - return res; - // return 10 ** decimals; - } -} diff --git a/resources/regressions/test3.json/mutants/4/10Power/TenPower.sol b/resources/regressions/test3.json/mutants/4/10Power/TenPower.sol deleted file mode 100644 index 844dc32..0000000 --- a/resources/regressions/test3.json/mutants/4/10Power/TenPower.sol +++ /dev/null @@ -1,13 +0,0 @@ -// SPDX-License-Identifier: GPL-3.0-only -pragma solidity >0.7.0; -pragma experimental ABIEncoderV2; - -contract TenPower { - function get10PowerDecimals(uint8 decimals) public pure returns (uint256) { - uint256 a = 10; - /// BinaryOpMutation(`**` |==> `/`) of: `uint256 res = a ** decimals;` - uint256 res = a/decimals; - return res; - // return 10 ** decimals; - } -} diff --git a/resources/regressions/test3.json/mutants/5/10Power/TenPower.sol b/resources/regressions/test3.json/mutants/5/10Power/TenPower.sol deleted file mode 100644 index 1461441..0000000 --- a/resources/regressions/test3.json/mutants/5/10Power/TenPower.sol +++ /dev/null @@ -1,13 +0,0 @@ -// SPDX-License-Identifier: GPL-3.0-only -pragma solidity >0.7.0; -pragma experimental ABIEncoderV2; - -contract TenPower { - function get10PowerDecimals(uint8 decimals) public pure returns (uint256) { - uint256 a = 10; - /// BinaryOpMutation(`**` |==> `%`) of: `uint256 res = a ** decimals;` - uint256 res = a%decimals; - return res; - // return 10 ** decimals; - } -} diff --git a/resources/regressions/test3.json/mutants/6/10Power/TenPower.sol b/resources/regressions/test3.json/mutants/6/10Power/TenPower.sol deleted file mode 100644 index 674f128..0000000 --- a/resources/regressions/test3.json/mutants/6/10Power/TenPower.sol +++ /dev/null @@ -1,13 +0,0 @@ -// SPDX-License-Identifier: GPL-3.0-only -pragma solidity >0.7.0; -pragma experimental ABIEncoderV2; - -contract TenPower { - function get10PowerDecimals(uint8 decimals) public pure returns (uint256) { - uint256 a = 10; - /// SwapArgumentsOperatorMutation(`a ** decimals` |==> `decimals ** a`) of: `uint256 res = a ** decimals;` - uint256 res = decimals ** a; - return res; - // return 10 ** decimals; - } -} diff --git a/resources/regressions/test4.json/gambit_results.json b/resources/regressions/test4.json/gambit_results.json deleted file mode 100644 index 612d8c1..0000000 --- a/resources/regressions/test4.json/gambit_results.json +++ /dev/null @@ -1,44 +0,0 @@ -[ - { - "description": "BinaryOpMutation", - "diff": "--- original\n+++ mutant\n@@ -5,7 +5,8 @@\n contract TenPower {\n function get10PowerDecimals(uint8 decimals) public pure returns (uint256) {\n uint256 a = 10;\n- uint256 res = a ** decimals;\n+ /// BinaryOpMutation(`**` |==> `+`) of: `uint256 res = a ** decimals;`\n+ uint256 res = a+decimals;\n return res;\n // return 10 ** decimals;\n }\n", - "id": "1", - "name": "mutants/1/10Power/TenPower.sol", - "original": "10Power/TenPower.sol", - }, - { - "description": "BinaryOpMutation", - "diff": "--- original\n+++ mutant\n@@ -5,7 +5,8 @@\n contract TenPower {\n function get10PowerDecimals(uint8 decimals) public pure returns (uint256) {\n uint256 a = 10;\n- uint256 res = a ** decimals;\n+ /// BinaryOpMutation(`**` |==> `-`) of: `uint256 res = a ** decimals;`\n+ uint256 res = a-decimals;\n return res;\n // return 10 ** decimals;\n }\n", - "id": "2", - "name": "mutants/2/10Power/TenPower.sol", - "original": "10Power/TenPower.sol", - }, - { - "description": "BinaryOpMutation", - "diff": "--- original\n+++ mutant\n@@ -5,7 +5,8 @@\n contract TenPower {\n function get10PowerDecimals(uint8 decimals) public pure returns (uint256) {\n uint256 a = 10;\n- uint256 res = a ** decimals;\n+ /// BinaryOpMutation(`**` |==> `*`) of: `uint256 res = a ** decimals;`\n+ uint256 res = a*decimals;\n return res;\n // return 10 ** decimals;\n }\n", - "id": "3", - "name": "mutants/3/10Power/TenPower.sol", - "original": "10Power/TenPower.sol", - }, - { - "description": "BinaryOpMutation", - "diff": "--- original\n+++ mutant\n@@ -5,7 +5,8 @@\n contract TenPower {\n function get10PowerDecimals(uint8 decimals) public pure returns (uint256) {\n uint256 a = 10;\n- uint256 res = a ** decimals;\n+ /// BinaryOpMutation(`**` |==> `/`) of: `uint256 res = a ** decimals;`\n+ uint256 res = a/decimals;\n return res;\n // return 10 ** decimals;\n }\n", - "id": "4", - "name": "mutants/4/10Power/TenPower.sol", - "original": "10Power/TenPower.sol", - }, - { - "description": "BinaryOpMutation", - "diff": "--- original\n+++ mutant\n@@ -5,7 +5,8 @@\n contract TenPower {\n function get10PowerDecimals(uint8 decimals) public pure returns (uint256) {\n uint256 a = 10;\n- uint256 res = a ** decimals;\n+ /// BinaryOpMutation(`**` |==> `%`) of: `uint256 res = a ** decimals;`\n+ uint256 res = a%decimals;\n return res;\n // return 10 ** decimals;\n }\n", - "id": "5", - "name": "mutants/5/10Power/TenPower.sol", - "original": "10Power/TenPower.sol", - }, - { - "description": "SwapArgumentsOperatorMutation", - "diff": "--- original\n+++ mutant\n@@ -5,7 +5,8 @@\n contract TenPower {\n function get10PowerDecimals(uint8 decimals) public pure returns (uint256) {\n uint256 a = 10;\n- uint256 res = a ** decimals;\n+ /// SwapArgumentsOperatorMutation(`a ** decimals` |==> `decimals ** a`) of: `uint256 res = a ** decimals;`\n+ uint256 res = decimals ** a;\n return res;\n // return 10 ** decimals;\n }\n", - "id": "6", - "name": "mutants/6/10Power/TenPower.sol", - "original": "10Power/TenPower.sol", - } -] \ No newline at end of file diff --git a/resources/regressions/test4.json/input_json/C.sol_json.ast b/resources/regressions/test4.json/input_json/C.sol_json.ast deleted file mode 100644 index a3306b6..0000000 --- a/resources/regressions/test4.json/input_json/C.sol_json.ast +++ /dev/null @@ -1,1828 +0,0 @@ -{ - "absolutePath": "benchmarks/MultipleContracts/C.sol", - "exportedSymbols": - { - "C": - [ - 135 - ], - "Utils": - [ - 33 - ] - }, - "id": 136, - "license": "GPL-3.0-only", - "nodeType": "SourceUnit", - "nodes": - [ - { - "id": 1, - "literals": - [ - "solidity", - "^", - "0.8", - ".13" - ], - "nodeType": "PragmaDirective", - "src": "42:24:0" - }, - { - "abstract": false, - "baseContracts": [], - "canonicalName": "Utils", - "contractDependencies": [], - "contractKind": "library", - "fullyImplemented": true, - "id": 33, - "linearizedBaseContracts": - [ - 33 - ], - "name": "Utils", - "nameLocation": "76:5:0", - "nodeType": "ContractDefinition", - "nodes": - [ - { - "body": - { - "id": 17, - "nodeType": "Block", - "src": "151:34:0", - "statements": - [ - { - "expression": - { - "arguments": - [ - { - "commonType": - { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "id": 14, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": - { - "baseExpression": - { - "id": 10, - "name": "c", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4, - "src": "168:1:0", - "typeDescriptions": - { - "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", - "typeString": "address[] memory" - } - }, - "id": 12, - "indexExpression": - { - "hexValue": "30", - "id": 11, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "170:1:0", - "typeDescriptions": - { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - }, - "value": "0" - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "168:4:0", - "typeDescriptions": - { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "nodeType": "BinaryOperation", - "operator": "==", - "rightExpression": - { - "id": 13, - "name": "e", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 6, - "src": "176:1:0", - "typeDescriptions": - { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "src": "168:9:0", - "typeDescriptions": - { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - } - ], - "expression": - { - "argumentTypes": - [ - { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - ], - "id": 9, - "name": "assert", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": -3, - "src": "161:6:0", - "typeDescriptions": - { - "typeIdentifier": "t_function_assert_pure$_t_bool_$returns$__$", - "typeString": "function (bool) pure" - } - }, - "id": 15, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "161:17:0", - "tryCall": false, - "typeDescriptions": - { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 16, - "nodeType": "ExpressionStatement", - "src": "161:17:0" - } - ] - }, - "id": 18, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "getarray", - "nameLocation": "97:8:0", - "nodeType": "FunctionDefinition", - "parameters": - { - "id": 7, - "nodeType": "ParameterList", - "parameters": - [ - { - "constant": false, - "id": 4, - "mutability": "mutable", - "name": "c", - "nameLocation": "123:1:0", - "nodeType": "VariableDeclaration", - "scope": 18, - "src": "106:18:0", - "stateVariable": false, - "storageLocation": "memory", - "typeDescriptions": - { - "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", - "typeString": "address[]" - }, - "typeName": - { - "baseType": - { - "id": 2, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "106:7:0", - "stateMutability": "nonpayable", - "typeDescriptions": - { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "id": 3, - "nodeType": "ArrayTypeName", - "src": "106:9:0", - "typeDescriptions": - { - "typeIdentifier": "t_array$_t_address_$dyn_storage_ptr", - "typeString": "address[]" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 6, - "mutability": "mutable", - "name": "e", - "nameLocation": "134:1:0", - "nodeType": "VariableDeclaration", - "scope": 18, - "src": "126:9:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": - { - "id": 5, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "126:7:0", - "stateMutability": "nonpayable", - "typeDescriptions": - { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "visibility": "internal" - } - ], - "src": "105:31:0" - }, - "returnParameters": - { - "id": 8, - "nodeType": "ParameterList", - "parameters": [], - "src": "151:0:0" - }, - "scope": 33, - "src": "88:97:0", - "stateMutability": "pure", - "virtual": false, - "visibility": "internal" - }, - { - "body": - { - "id": 31, - "nodeType": "Block", - "src": "247:29:0", - "statements": - [ - { - "expression": - { - "commonType": - { - "typeIdentifier": "t_int8", - "typeString": "int8" - }, - "id": 29, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": - { - "id": 27, - "name": "a", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 20, - "src": "264:1:0", - "typeDescriptions": - { - "typeIdentifier": "t_int8", - "typeString": "int8" - } - }, - "nodeType": "BinaryOperation", - "operator": "+", - "rightExpression": - { - "id": 28, - "name": "b", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 22, - "src": "268:1:0", - "typeDescriptions": - { - "typeIdentifier": "t_int8", - "typeString": "int8" - } - }, - "src": "264:5:0", - "typeDescriptions": - { - "typeIdentifier": "t_int8", - "typeString": "int8" - } - }, - "functionReturnParameters": 26, - "id": 30, - "nodeType": "Return", - "src": "257:12:0" - } - ] - }, - "functionSelector": "e2666777", - "id": 32, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "add", - "nameLocation": "200:3:0", - "nodeType": "FunctionDefinition", - "parameters": - { - "id": 23, - "nodeType": "ParameterList", - "parameters": - [ - { - "constant": false, - "id": 20, - "mutability": "mutable", - "name": "a", - "nameLocation": "209:1:0", - "nodeType": "VariableDeclaration", - "scope": 32, - "src": "204:6:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_int8", - "typeString": "int8" - }, - "typeName": - { - "id": 19, - "name": "int8", - "nodeType": "ElementaryTypeName", - "src": "204:4:0", - "typeDescriptions": - { - "typeIdentifier": "t_int8", - "typeString": "int8" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 22, - "mutability": "mutable", - "name": "b", - "nameLocation": "217:1:0", - "nodeType": "VariableDeclaration", - "scope": 32, - "src": "212:6:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_int8", - "typeString": "int8" - }, - "typeName": - { - "id": 21, - "name": "int8", - "nodeType": "ElementaryTypeName", - "src": "212:4:0", - "typeDescriptions": - { - "typeIdentifier": "t_int8", - "typeString": "int8" - } - }, - "visibility": "internal" - } - ], - "src": "203:16:0" - }, - "returnParameters": - { - "id": 26, - "nodeType": "ParameterList", - "parameters": - [ - { - "constant": false, - "id": 25, - "mutability": "mutable", - "name": "", - "nameLocation": "-1:-1:-1", - "nodeType": "VariableDeclaration", - "scope": 32, - "src": "241:4:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_int8", - "typeString": "int8" - }, - "typeName": - { - "id": 24, - "name": "int8", - "nodeType": "ElementaryTypeName", - "src": "241:4:0", - "typeDescriptions": - { - "typeIdentifier": "t_int8", - "typeString": "int8" - } - }, - "visibility": "internal" - } - ], - "src": "240:6:0" - }, - "scope": 33, - "src": "191:85:0", - "stateMutability": "pure", - "virtual": false, - "visibility": "public" - } - ], - "scope": 136, - "src": "68:210:0", - "usedErrors": [] - }, - { - "abstract": false, - "baseContracts": [], - "canonicalName": "C", - "contractDependencies": [], - "contractKind": "contract", - "fullyImplemented": true, - "id": 135, - "linearizedBaseContracts": - [ - 135 - ], - "name": "C", - "nameLocation": "289:1:0", - "nodeType": "ContractDefinition", - "nodes": - [ - { - "body": - { - "id": 59, - "nodeType": "Block", - "src": "353:99:0", - "statements": - [ - { - "assignments": - [ - 43 - ], - "declarations": - [ - { - "constant": false, - "id": 43, - "mutability": "mutable", - "name": "a", - "nameLocation": "380:1:0", - "nodeType": "VariableDeclaration", - "scope": 59, - "src": "363:18:0", - "stateVariable": false, - "storageLocation": "memory", - "typeDescriptions": - { - "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", - "typeString": "address[]" - }, - "typeName": - { - "baseType": - { - "id": 41, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "363:7:0", - "typeDescriptions": - { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "id": 42, - "nodeType": "ArrayTypeName", - "src": "363:9:0", - "typeDescriptions": - { - "typeIdentifier": "t_array$_t_address_$dyn_storage_ptr", - "typeString": "address[]" - } - }, - "visibility": "internal" - } - ], - "id": 49, - "initialValue": - { - "arguments": - [ - { - "hexValue": "31", - "id": 47, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "398:1:0", - "typeDescriptions": - { - "typeIdentifier": "t_rational_1_by_1", - "typeString": "int_const 1" - }, - "value": "1" - } - ], - "expression": - { - "argumentTypes": - [ - { - "typeIdentifier": "t_rational_1_by_1", - "typeString": "int_const 1" - } - ], - "id": 46, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "nodeType": "NewExpression", - "src": "384:13:0", - "typeDescriptions": - { - "typeIdentifier": "t_function_objectcreation_pure$_t_uint256_$returns$_t_array$_t_address_$dyn_memory_ptr_$", - "typeString": "function (uint256) pure returns (address[] memory)" - }, - "typeName": - { - "baseType": - { - "id": 44, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "388:7:0", - "stateMutability": "nonpayable", - "typeDescriptions": - { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "id": 45, - "nodeType": "ArrayTypeName", - "src": "388:9:0", - "typeDescriptions": - { - "typeIdentifier": "t_array$_t_address_$dyn_storage_ptr", - "typeString": "address[]" - } - } - }, - "id": 48, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "384:16:0", - "tryCall": false, - "typeDescriptions": - { - "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", - "typeString": "address[] memory" - } - }, - "nodeType": "VariableDeclarationStatement", - "src": "363:37:0" - }, - { - "expression": - { - "id": 55, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": - { - "baseExpression": - { - "id": 50, - "name": "a", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 43, - "src": "410:1:0", - "typeDescriptions": - { - "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", - "typeString": "address[] memory" - } - }, - "id": 52, - "indexExpression": - { - "hexValue": "30", - "id": 51, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "412:1:0", - "typeDescriptions": - { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - }, - "value": "0" - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": true, - "nodeType": "IndexAccess", - "src": "410:4:0", - "typeDescriptions": - { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": - { - "expression": - { - "id": 53, - "name": "msg", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": -15, - "src": "417:3:0", - "typeDescriptions": - { - "typeIdentifier": "t_magic_message", - "typeString": "msg" - } - }, - "id": 54, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "sender", - "nodeType": "MemberAccess", - "src": "417:10:0", - "typeDescriptions": - { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "src": "410:17:0", - "typeDescriptions": - { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "id": 56, - "nodeType": "ExpressionStatement", - "src": "410:17:0" - }, - { - "expression": - { - "id": 57, - "name": "a", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 43, - "src": "444:1:0", - "typeDescriptions": - { - "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", - "typeString": "address[] memory" - } - }, - "functionReturnParameters": 38, - "id": 58, - "nodeType": "Return", - "src": "437:8:0" - } - ] - }, - "functionSelector": "c2985578", - "id": 60, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "foo", - "nameLocation": "306:3:0", - "nodeType": "FunctionDefinition", - "parameters": - { - "id": 34, - "nodeType": "ParameterList", - "parameters": [], - "src": "309:2:0" - }, - "returnParameters": - { - "id": 38, - "nodeType": "ParameterList", - "parameters": - [ - { - "constant": false, - "id": 37, - "mutability": "mutable", - "name": "", - "nameLocation": "-1:-1:-1", - "nodeType": "VariableDeclaration", - "scope": 60, - "src": "335:16:0", - "stateVariable": false, - "storageLocation": "memory", - "typeDescriptions": - { - "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", - "typeString": "address[]" - }, - "typeName": - { - "baseType": - { - "id": 35, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "335:7:0", - "stateMutability": "nonpayable", - "typeDescriptions": - { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "id": 36, - "nodeType": "ArrayTypeName", - "src": "335:9:0", - "typeDescriptions": - { - "typeIdentifier": "t_array$_t_address_$dyn_storage_ptr", - "typeString": "address[]" - } - }, - "visibility": "internal" - } - ], - "src": "334:18:0" - }, - "scope": 135, - "src": "297:155:0", - "stateMutability": "view", - "virtual": false, - "visibility": "external" - }, - { - "body": - { - "id": 79, - "nodeType": "Block", - "src": "532:88:0", - "statements": - [ - { - "assignments": - [ - 68 - ], - "declarations": - [ - { - "constant": false, - "id": 68, - "mutability": "mutable", - "name": "a", - "nameLocation": "550:1:0", - "nodeType": "VariableDeclaration", - "scope": 79, - "src": "542:9:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": - { - "id": 67, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "542:7:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - } - ], - "id": 70, - "initialValue": - { - "hexValue": "3130", - "id": 69, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "554:2:0", - "typeDescriptions": - { - "typeIdentifier": "t_rational_10_by_1", - "typeString": "int_const 10" - }, - "value": "10" - }, - "nodeType": "VariableDeclarationStatement", - "src": "542:14:0" - }, - { - "assignments": - [ - 72 - ], - "declarations": - [ - { - "constant": false, - "id": 72, - "mutability": "mutable", - "name": "res", - "nameLocation": "574:3:0", - "nodeType": "VariableDeclaration", - "scope": 79, - "src": "566:11:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": - { - "id": 71, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "566:7:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - } - ], - "id": 76, - "initialValue": - { - "commonType": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 75, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": - { - "id": 73, - "name": "a", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 68, - "src": "580:1:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "**", - "rightExpression": - { - "id": 74, - "name": "decimals", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 62, - "src": "585:8:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - } - }, - "src": "580:13:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "VariableDeclarationStatement", - "src": "566:27:0" - }, - { - "expression": - { - "id": 77, - "name": "res", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 72, - "src": "610:3:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "functionReturnParameters": 66, - "id": 78, - "nodeType": "Return", - "src": "603:10:0" - } - ] - }, - "functionSelector": "eb79f1be", - "id": 80, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "get10PowerDecimals", - "nameLocation": "467:18:0", - "nodeType": "FunctionDefinition", - "parameters": - { - "id": 63, - "nodeType": "ParameterList", - "parameters": - [ - { - "constant": false, - "id": 62, - "mutability": "mutable", - "name": "decimals", - "nameLocation": "492:8:0", - "nodeType": "VariableDeclaration", - "scope": 80, - "src": "486:14:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - }, - "typeName": - { - "id": 61, - "name": "uint8", - "nodeType": "ElementaryTypeName", - "src": "486:5:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - } - }, - "visibility": "internal" - } - ], - "src": "485:16:0" - }, - "returnParameters": - { - "id": 66, - "nodeType": "ParameterList", - "parameters": - [ - { - "constant": false, - "id": 65, - "mutability": "mutable", - "name": "", - "nameLocation": "-1:-1:-1", - "nodeType": "VariableDeclaration", - "scope": 80, - "src": "523:7:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": - { - "id": 64, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "523:7:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - } - ], - "src": "522:9:0" - }, - "scope": 135, - "src": "458:162:0", - "stateMutability": "pure", - "virtual": false, - "visibility": "public" - }, - { - "body": - { - "id": 96, - "nodeType": "Block", - "src": "687:34:0", - "statements": - [ - { - "expression": - { - "arguments": - [ - { - "commonType": - { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "id": 93, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": - { - "baseExpression": - { - "id": 89, - "name": "c", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 83, - "src": "704:1:0", - "typeDescriptions": - { - "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", - "typeString": "address[] memory" - } - }, - "id": 91, - "indexExpression": - { - "hexValue": "30", - "id": 90, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "706:1:0", - "typeDescriptions": - { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - }, - "value": "0" - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "704:4:0", - "typeDescriptions": - { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "nodeType": "BinaryOperation", - "operator": "==", - "rightExpression": - { - "id": 92, - "name": "e", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 85, - "src": "712:1:0", - "typeDescriptions": - { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "src": "704:9:0", - "typeDescriptions": - { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - } - ], - "expression": - { - "argumentTypes": - [ - { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - ], - "id": 88, - "name": "assert", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": -3, - "src": "697:6:0", - "typeDescriptions": - { - "typeIdentifier": "t_function_assert_pure$_t_bool_$returns$__$", - "typeString": "function (bool) pure" - } - }, - "id": 94, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "697:17:0", - "tryCall": false, - "typeDescriptions": - { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 95, - "nodeType": "ExpressionStatement", - "src": "697:17:0" - } - ] - }, - "functionSelector": "e5b2857b", - "id": 97, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "getarray", - "nameLocation": "635:8:0", - "nodeType": "FunctionDefinition", - "parameters": - { - "id": 86, - "nodeType": "ParameterList", - "parameters": - [ - { - "constant": false, - "id": 83, - "mutability": "mutable", - "name": "c", - "nameLocation": "661:1:0", - "nodeType": "VariableDeclaration", - "scope": 97, - "src": "644:18:0", - "stateVariable": false, - "storageLocation": "memory", - "typeDescriptions": - { - "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", - "typeString": "address[]" - }, - "typeName": - { - "baseType": - { - "id": 81, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "644:7:0", - "stateMutability": "nonpayable", - "typeDescriptions": - { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "id": 82, - "nodeType": "ArrayTypeName", - "src": "644:9:0", - "typeDescriptions": - { - "typeIdentifier": "t_array$_t_address_$dyn_storage_ptr", - "typeString": "address[]" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 85, - "mutability": "mutable", - "name": "e", - "nameLocation": "672:1:0", - "nodeType": "VariableDeclaration", - "scope": 97, - "src": "664:9:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": - { - "id": 84, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "664:7:0", - "stateMutability": "nonpayable", - "typeDescriptions": - { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "visibility": "internal" - } - ], - "src": "643:31:0" - }, - "returnParameters": - { - "id": 87, - "nodeType": "ParameterList", - "parameters": [], - "src": "687:0:0" - }, - "scope": 135, - "src": "626:95:0", - "stateMutability": "pure", - "virtual": false, - "visibility": "public" - }, - { - "body": - { - "id": 119, - "nodeType": "Block", - "src": "763:90:0", - "statements": - [ - { - "assignments": - [ - 104 - ], - "declarations": - [ - { - "constant": false, - "id": 104, - "mutability": "mutable", - "name": "b", - "nameLocation": "790:1:0", - "nodeType": "VariableDeclaration", - "scope": 119, - "src": "773:18:0", - "stateVariable": false, - "storageLocation": "memory", - "typeDescriptions": - { - "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", - "typeString": "address[]" - }, - "typeName": - { - "baseType": - { - "id": 102, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "773:7:0", - "typeDescriptions": - { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "id": 103, - "nodeType": "ArrayTypeName", - "src": "773:9:0", - "typeDescriptions": - { - "typeIdentifier": "t_array$_t_address_$dyn_storage_ptr", - "typeString": "address[]" - } - }, - "visibility": "internal" - } - ], - "id": 108, - "initialValue": - { - "arguments": [], - "expression": - { - "argumentTypes": [], - "expression": - { - "id": 105, - "name": "this", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": -28, - "src": "794:4:0", - "typeDescriptions": - { - "typeIdentifier": "t_contract$_C_$135", - "typeString": "contract C" - } - }, - "id": 106, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "foo", - "nodeType": "MemberAccess", - "referencedDeclaration": 60, - "src": "794:8:0", - "typeDescriptions": - { - "typeIdentifier": "t_function_external_view$__$returns$_t_array$_t_address_$dyn_memory_ptr_$", - "typeString": "function () view external returns (address[] memory)" - } - }, - "id": 107, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "794:10:0", - "tryCall": false, - "typeDescriptions": - { - "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", - "typeString": "address[] memory" - } - }, - "nodeType": "VariableDeclarationStatement", - "src": "773:31:0" - }, - { - "expression": - { - "arguments": - [ - { - "id": 112, - "name": "b", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 104, - "src": "829:1:0", - "typeDescriptions": - { - "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", - "typeString": "address[] memory" - } - }, - { - "arguments": - [ - { - "id": 115, - "name": "this", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": -28, - "src": "840:4:0", - "typeDescriptions": - { - "typeIdentifier": "t_contract$_C_$135", - "typeString": "contract C" - } - } - ], - "expression": - { - "argumentTypes": - [ - { - "typeIdentifier": "t_contract$_C_$135", - "typeString": "contract C" - } - ], - "id": 114, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "nodeType": "ElementaryTypeNameExpression", - "src": "832:7:0", - "typeDescriptions": - { - "typeIdentifier": "t_type$_t_address_$", - "typeString": "type(address)" - }, - "typeName": - { - "id": 113, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "832:7:0", - "typeDescriptions": {} - } - }, - "id": 116, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "typeConversion", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "832:13:0", - "tryCall": false, - "typeDescriptions": - { - "typeIdentifier": "t_address", - "typeString": "address" - } - } - ], - "expression": - { - "argumentTypes": - [ - { - "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", - "typeString": "address[] memory" - }, - { - "typeIdentifier": "t_address", - "typeString": "address" - } - ], - "expression": - { - "id": 109, - "name": "Utils", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 33, - "src": "814:5:0", - "typeDescriptions": - { - "typeIdentifier": "t_type$_t_contract$_Utils_$33_$", - "typeString": "type(library Utils)" - } - }, - "id": 111, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "getarray", - "nodeType": "MemberAccess", - "referencedDeclaration": 18, - "src": "814:14:0", - "typeDescriptions": - { - "typeIdentifier": "t_function_internal_pure$_t_array$_t_address_$dyn_memory_ptr_$_t_address_$returns$__$", - "typeString": "function (address[] memory,address) pure" - } - }, - "id": 117, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "814:32:0", - "tryCall": false, - "typeDescriptions": - { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 118, - "nodeType": "ExpressionStatement", - "src": "814:32:0" - } - ] - }, - "functionSelector": "d3ab473b", - "id": 120, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "callmyself", - "nameLocation": "736:10:0", - "nodeType": "FunctionDefinition", - "parameters": - { - "id": 98, - "nodeType": "ParameterList", - "parameters": [], - "src": "746:2:0" - }, - "returnParameters": - { - "id": 99, - "nodeType": "ParameterList", - "parameters": [], - "src": "763:0:0" - }, - "scope": 135, - "src": "727:126:0", - "stateMutability": "view", - "virtual": false, - "visibility": "external" - }, - { - "body": - { - "id": 133, - "nodeType": "Block", - "src": "915:29:0", - "statements": - [ - { - "expression": - { - "commonType": - { - "typeIdentifier": "t_int8", - "typeString": "int8" - }, - "id": 131, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": - { - "id": 129, - "name": "c", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 122, - "src": "932:1:0", - "typeDescriptions": - { - "typeIdentifier": "t_int8", - "typeString": "int8" - } - }, - "nodeType": "BinaryOperation", - "operator": "+", - "rightExpression": - { - "id": 130, - "name": "d", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 124, - "src": "936:1:0", - "typeDescriptions": - { - "typeIdentifier": "t_int8", - "typeString": "int8" - } - }, - "src": "932:5:0", - "typeDescriptions": - { - "typeIdentifier": "t_int8", - "typeString": "int8" - } - }, - "functionReturnParameters": 128, - "id": 132, - "nodeType": "Return", - "src": "925:12:0" - } - ] - }, - "functionSelector": "e2666777", - "id": 134, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "add", - "nameLocation": "868:3:0", - "nodeType": "FunctionDefinition", - "parameters": - { - "id": 125, - "nodeType": "ParameterList", - "parameters": - [ - { - "constant": false, - "id": 122, - "mutability": "mutable", - "name": "c", - "nameLocation": "877:1:0", - "nodeType": "VariableDeclaration", - "scope": 134, - "src": "872:6:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_int8", - "typeString": "int8" - }, - "typeName": - { - "id": 121, - "name": "int8", - "nodeType": "ElementaryTypeName", - "src": "872:4:0", - "typeDescriptions": - { - "typeIdentifier": "t_int8", - "typeString": "int8" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 124, - "mutability": "mutable", - "name": "d", - "nameLocation": "885:1:0", - "nodeType": "VariableDeclaration", - "scope": 134, - "src": "880:6:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_int8", - "typeString": "int8" - }, - "typeName": - { - "id": 123, - "name": "int8", - "nodeType": "ElementaryTypeName", - "src": "880:4:0", - "typeDescriptions": - { - "typeIdentifier": "t_int8", - "typeString": "int8" - } - }, - "visibility": "internal" - } - ], - "src": "871:16:0" - }, - "returnParameters": - { - "id": 128, - "nodeType": "ParameterList", - "parameters": - [ - { - "constant": false, - "id": 127, - "mutability": "mutable", - "name": "", - "nameLocation": "-1:-1:-1", - "nodeType": "VariableDeclaration", - "scope": 134, - "src": "909:4:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_int8", - "typeString": "int8" - }, - "typeName": - { - "id": 126, - "name": "int8", - "nodeType": "ElementaryTypeName", - "src": "909:4:0", - "typeDescriptions": - { - "typeIdentifier": "t_int8", - "typeString": "int8" - } - }, - "visibility": "internal" - } - ], - "src": "908:6:0" - }, - "scope": 135, - "src": "859:85:0", - "stateMutability": "pure", - "virtual": false, - "visibility": "public" - } - ], - "scope": 136, - "src": "280:666:0", - "usedErrors": [] - } - ], - "src": "42:905:0" -} \ No newline at end of file diff --git a/resources/regressions/test4.json/input_json/C.sol_json.ast.json b/resources/regressions/test4.json/input_json/C.sol_json.ast.json deleted file mode 100644 index a3306b6..0000000 --- a/resources/regressions/test4.json/input_json/C.sol_json.ast.json +++ /dev/null @@ -1,1828 +0,0 @@ -{ - "absolutePath": "benchmarks/MultipleContracts/C.sol", - "exportedSymbols": - { - "C": - [ - 135 - ], - "Utils": - [ - 33 - ] - }, - "id": 136, - "license": "GPL-3.0-only", - "nodeType": "SourceUnit", - "nodes": - [ - { - "id": 1, - "literals": - [ - "solidity", - "^", - "0.8", - ".13" - ], - "nodeType": "PragmaDirective", - "src": "42:24:0" - }, - { - "abstract": false, - "baseContracts": [], - "canonicalName": "Utils", - "contractDependencies": [], - "contractKind": "library", - "fullyImplemented": true, - "id": 33, - "linearizedBaseContracts": - [ - 33 - ], - "name": "Utils", - "nameLocation": "76:5:0", - "nodeType": "ContractDefinition", - "nodes": - [ - { - "body": - { - "id": 17, - "nodeType": "Block", - "src": "151:34:0", - "statements": - [ - { - "expression": - { - "arguments": - [ - { - "commonType": - { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "id": 14, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": - { - "baseExpression": - { - "id": 10, - "name": "c", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4, - "src": "168:1:0", - "typeDescriptions": - { - "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", - "typeString": "address[] memory" - } - }, - "id": 12, - "indexExpression": - { - "hexValue": "30", - "id": 11, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "170:1:0", - "typeDescriptions": - { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - }, - "value": "0" - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "168:4:0", - "typeDescriptions": - { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "nodeType": "BinaryOperation", - "operator": "==", - "rightExpression": - { - "id": 13, - "name": "e", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 6, - "src": "176:1:0", - "typeDescriptions": - { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "src": "168:9:0", - "typeDescriptions": - { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - } - ], - "expression": - { - "argumentTypes": - [ - { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - ], - "id": 9, - "name": "assert", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": -3, - "src": "161:6:0", - "typeDescriptions": - { - "typeIdentifier": "t_function_assert_pure$_t_bool_$returns$__$", - "typeString": "function (bool) pure" - } - }, - "id": 15, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "161:17:0", - "tryCall": false, - "typeDescriptions": - { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 16, - "nodeType": "ExpressionStatement", - "src": "161:17:0" - } - ] - }, - "id": 18, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "getarray", - "nameLocation": "97:8:0", - "nodeType": "FunctionDefinition", - "parameters": - { - "id": 7, - "nodeType": "ParameterList", - "parameters": - [ - { - "constant": false, - "id": 4, - "mutability": "mutable", - "name": "c", - "nameLocation": "123:1:0", - "nodeType": "VariableDeclaration", - "scope": 18, - "src": "106:18:0", - "stateVariable": false, - "storageLocation": "memory", - "typeDescriptions": - { - "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", - "typeString": "address[]" - }, - "typeName": - { - "baseType": - { - "id": 2, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "106:7:0", - "stateMutability": "nonpayable", - "typeDescriptions": - { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "id": 3, - "nodeType": "ArrayTypeName", - "src": "106:9:0", - "typeDescriptions": - { - "typeIdentifier": "t_array$_t_address_$dyn_storage_ptr", - "typeString": "address[]" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 6, - "mutability": "mutable", - "name": "e", - "nameLocation": "134:1:0", - "nodeType": "VariableDeclaration", - "scope": 18, - "src": "126:9:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": - { - "id": 5, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "126:7:0", - "stateMutability": "nonpayable", - "typeDescriptions": - { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "visibility": "internal" - } - ], - "src": "105:31:0" - }, - "returnParameters": - { - "id": 8, - "nodeType": "ParameterList", - "parameters": [], - "src": "151:0:0" - }, - "scope": 33, - "src": "88:97:0", - "stateMutability": "pure", - "virtual": false, - "visibility": "internal" - }, - { - "body": - { - "id": 31, - "nodeType": "Block", - "src": "247:29:0", - "statements": - [ - { - "expression": - { - "commonType": - { - "typeIdentifier": "t_int8", - "typeString": "int8" - }, - "id": 29, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": - { - "id": 27, - "name": "a", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 20, - "src": "264:1:0", - "typeDescriptions": - { - "typeIdentifier": "t_int8", - "typeString": "int8" - } - }, - "nodeType": "BinaryOperation", - "operator": "+", - "rightExpression": - { - "id": 28, - "name": "b", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 22, - "src": "268:1:0", - "typeDescriptions": - { - "typeIdentifier": "t_int8", - "typeString": "int8" - } - }, - "src": "264:5:0", - "typeDescriptions": - { - "typeIdentifier": "t_int8", - "typeString": "int8" - } - }, - "functionReturnParameters": 26, - "id": 30, - "nodeType": "Return", - "src": "257:12:0" - } - ] - }, - "functionSelector": "e2666777", - "id": 32, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "add", - "nameLocation": "200:3:0", - "nodeType": "FunctionDefinition", - "parameters": - { - "id": 23, - "nodeType": "ParameterList", - "parameters": - [ - { - "constant": false, - "id": 20, - "mutability": "mutable", - "name": "a", - "nameLocation": "209:1:0", - "nodeType": "VariableDeclaration", - "scope": 32, - "src": "204:6:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_int8", - "typeString": "int8" - }, - "typeName": - { - "id": 19, - "name": "int8", - "nodeType": "ElementaryTypeName", - "src": "204:4:0", - "typeDescriptions": - { - "typeIdentifier": "t_int8", - "typeString": "int8" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 22, - "mutability": "mutable", - "name": "b", - "nameLocation": "217:1:0", - "nodeType": "VariableDeclaration", - "scope": 32, - "src": "212:6:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_int8", - "typeString": "int8" - }, - "typeName": - { - "id": 21, - "name": "int8", - "nodeType": "ElementaryTypeName", - "src": "212:4:0", - "typeDescriptions": - { - "typeIdentifier": "t_int8", - "typeString": "int8" - } - }, - "visibility": "internal" - } - ], - "src": "203:16:0" - }, - "returnParameters": - { - "id": 26, - "nodeType": "ParameterList", - "parameters": - [ - { - "constant": false, - "id": 25, - "mutability": "mutable", - "name": "", - "nameLocation": "-1:-1:-1", - "nodeType": "VariableDeclaration", - "scope": 32, - "src": "241:4:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_int8", - "typeString": "int8" - }, - "typeName": - { - "id": 24, - "name": "int8", - "nodeType": "ElementaryTypeName", - "src": "241:4:0", - "typeDescriptions": - { - "typeIdentifier": "t_int8", - "typeString": "int8" - } - }, - "visibility": "internal" - } - ], - "src": "240:6:0" - }, - "scope": 33, - "src": "191:85:0", - "stateMutability": "pure", - "virtual": false, - "visibility": "public" - } - ], - "scope": 136, - "src": "68:210:0", - "usedErrors": [] - }, - { - "abstract": false, - "baseContracts": [], - "canonicalName": "C", - "contractDependencies": [], - "contractKind": "contract", - "fullyImplemented": true, - "id": 135, - "linearizedBaseContracts": - [ - 135 - ], - "name": "C", - "nameLocation": "289:1:0", - "nodeType": "ContractDefinition", - "nodes": - [ - { - "body": - { - "id": 59, - "nodeType": "Block", - "src": "353:99:0", - "statements": - [ - { - "assignments": - [ - 43 - ], - "declarations": - [ - { - "constant": false, - "id": 43, - "mutability": "mutable", - "name": "a", - "nameLocation": "380:1:0", - "nodeType": "VariableDeclaration", - "scope": 59, - "src": "363:18:0", - "stateVariable": false, - "storageLocation": "memory", - "typeDescriptions": - { - "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", - "typeString": "address[]" - }, - "typeName": - { - "baseType": - { - "id": 41, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "363:7:0", - "typeDescriptions": - { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "id": 42, - "nodeType": "ArrayTypeName", - "src": "363:9:0", - "typeDescriptions": - { - "typeIdentifier": "t_array$_t_address_$dyn_storage_ptr", - "typeString": "address[]" - } - }, - "visibility": "internal" - } - ], - "id": 49, - "initialValue": - { - "arguments": - [ - { - "hexValue": "31", - "id": 47, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "398:1:0", - "typeDescriptions": - { - "typeIdentifier": "t_rational_1_by_1", - "typeString": "int_const 1" - }, - "value": "1" - } - ], - "expression": - { - "argumentTypes": - [ - { - "typeIdentifier": "t_rational_1_by_1", - "typeString": "int_const 1" - } - ], - "id": 46, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "nodeType": "NewExpression", - "src": "384:13:0", - "typeDescriptions": - { - "typeIdentifier": "t_function_objectcreation_pure$_t_uint256_$returns$_t_array$_t_address_$dyn_memory_ptr_$", - "typeString": "function (uint256) pure returns (address[] memory)" - }, - "typeName": - { - "baseType": - { - "id": 44, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "388:7:0", - "stateMutability": "nonpayable", - "typeDescriptions": - { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "id": 45, - "nodeType": "ArrayTypeName", - "src": "388:9:0", - "typeDescriptions": - { - "typeIdentifier": "t_array$_t_address_$dyn_storage_ptr", - "typeString": "address[]" - } - } - }, - "id": 48, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "384:16:0", - "tryCall": false, - "typeDescriptions": - { - "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", - "typeString": "address[] memory" - } - }, - "nodeType": "VariableDeclarationStatement", - "src": "363:37:0" - }, - { - "expression": - { - "id": 55, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": - { - "baseExpression": - { - "id": 50, - "name": "a", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 43, - "src": "410:1:0", - "typeDescriptions": - { - "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", - "typeString": "address[] memory" - } - }, - "id": 52, - "indexExpression": - { - "hexValue": "30", - "id": 51, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "412:1:0", - "typeDescriptions": - { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - }, - "value": "0" - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": true, - "nodeType": "IndexAccess", - "src": "410:4:0", - "typeDescriptions": - { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": - { - "expression": - { - "id": 53, - "name": "msg", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": -15, - "src": "417:3:0", - "typeDescriptions": - { - "typeIdentifier": "t_magic_message", - "typeString": "msg" - } - }, - "id": 54, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "sender", - "nodeType": "MemberAccess", - "src": "417:10:0", - "typeDescriptions": - { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "src": "410:17:0", - "typeDescriptions": - { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "id": 56, - "nodeType": "ExpressionStatement", - "src": "410:17:0" - }, - { - "expression": - { - "id": 57, - "name": "a", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 43, - "src": "444:1:0", - "typeDescriptions": - { - "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", - "typeString": "address[] memory" - } - }, - "functionReturnParameters": 38, - "id": 58, - "nodeType": "Return", - "src": "437:8:0" - } - ] - }, - "functionSelector": "c2985578", - "id": 60, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "foo", - "nameLocation": "306:3:0", - "nodeType": "FunctionDefinition", - "parameters": - { - "id": 34, - "nodeType": "ParameterList", - "parameters": [], - "src": "309:2:0" - }, - "returnParameters": - { - "id": 38, - "nodeType": "ParameterList", - "parameters": - [ - { - "constant": false, - "id": 37, - "mutability": "mutable", - "name": "", - "nameLocation": "-1:-1:-1", - "nodeType": "VariableDeclaration", - "scope": 60, - "src": "335:16:0", - "stateVariable": false, - "storageLocation": "memory", - "typeDescriptions": - { - "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", - "typeString": "address[]" - }, - "typeName": - { - "baseType": - { - "id": 35, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "335:7:0", - "stateMutability": "nonpayable", - "typeDescriptions": - { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "id": 36, - "nodeType": "ArrayTypeName", - "src": "335:9:0", - "typeDescriptions": - { - "typeIdentifier": "t_array$_t_address_$dyn_storage_ptr", - "typeString": "address[]" - } - }, - "visibility": "internal" - } - ], - "src": "334:18:0" - }, - "scope": 135, - "src": "297:155:0", - "stateMutability": "view", - "virtual": false, - "visibility": "external" - }, - { - "body": - { - "id": 79, - "nodeType": "Block", - "src": "532:88:0", - "statements": - [ - { - "assignments": - [ - 68 - ], - "declarations": - [ - { - "constant": false, - "id": 68, - "mutability": "mutable", - "name": "a", - "nameLocation": "550:1:0", - "nodeType": "VariableDeclaration", - "scope": 79, - "src": "542:9:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": - { - "id": 67, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "542:7:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - } - ], - "id": 70, - "initialValue": - { - "hexValue": "3130", - "id": 69, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "554:2:0", - "typeDescriptions": - { - "typeIdentifier": "t_rational_10_by_1", - "typeString": "int_const 10" - }, - "value": "10" - }, - "nodeType": "VariableDeclarationStatement", - "src": "542:14:0" - }, - { - "assignments": - [ - 72 - ], - "declarations": - [ - { - "constant": false, - "id": 72, - "mutability": "mutable", - "name": "res", - "nameLocation": "574:3:0", - "nodeType": "VariableDeclaration", - "scope": 79, - "src": "566:11:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": - { - "id": 71, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "566:7:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - } - ], - "id": 76, - "initialValue": - { - "commonType": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 75, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": - { - "id": 73, - "name": "a", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 68, - "src": "580:1:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "**", - "rightExpression": - { - "id": 74, - "name": "decimals", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 62, - "src": "585:8:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - } - }, - "src": "580:13:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "VariableDeclarationStatement", - "src": "566:27:0" - }, - { - "expression": - { - "id": 77, - "name": "res", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 72, - "src": "610:3:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "functionReturnParameters": 66, - "id": 78, - "nodeType": "Return", - "src": "603:10:0" - } - ] - }, - "functionSelector": "eb79f1be", - "id": 80, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "get10PowerDecimals", - "nameLocation": "467:18:0", - "nodeType": "FunctionDefinition", - "parameters": - { - "id": 63, - "nodeType": "ParameterList", - "parameters": - [ - { - "constant": false, - "id": 62, - "mutability": "mutable", - "name": "decimals", - "nameLocation": "492:8:0", - "nodeType": "VariableDeclaration", - "scope": 80, - "src": "486:14:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - }, - "typeName": - { - "id": 61, - "name": "uint8", - "nodeType": "ElementaryTypeName", - "src": "486:5:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - } - }, - "visibility": "internal" - } - ], - "src": "485:16:0" - }, - "returnParameters": - { - "id": 66, - "nodeType": "ParameterList", - "parameters": - [ - { - "constant": false, - "id": 65, - "mutability": "mutable", - "name": "", - "nameLocation": "-1:-1:-1", - "nodeType": "VariableDeclaration", - "scope": 80, - "src": "523:7:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": - { - "id": 64, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "523:7:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - } - ], - "src": "522:9:0" - }, - "scope": 135, - "src": "458:162:0", - "stateMutability": "pure", - "virtual": false, - "visibility": "public" - }, - { - "body": - { - "id": 96, - "nodeType": "Block", - "src": "687:34:0", - "statements": - [ - { - "expression": - { - "arguments": - [ - { - "commonType": - { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "id": 93, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": - { - "baseExpression": - { - "id": 89, - "name": "c", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 83, - "src": "704:1:0", - "typeDescriptions": - { - "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", - "typeString": "address[] memory" - } - }, - "id": 91, - "indexExpression": - { - "hexValue": "30", - "id": 90, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "706:1:0", - "typeDescriptions": - { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - }, - "value": "0" - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "704:4:0", - "typeDescriptions": - { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "nodeType": "BinaryOperation", - "operator": "==", - "rightExpression": - { - "id": 92, - "name": "e", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 85, - "src": "712:1:0", - "typeDescriptions": - { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "src": "704:9:0", - "typeDescriptions": - { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - } - ], - "expression": - { - "argumentTypes": - [ - { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - ], - "id": 88, - "name": "assert", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": -3, - "src": "697:6:0", - "typeDescriptions": - { - "typeIdentifier": "t_function_assert_pure$_t_bool_$returns$__$", - "typeString": "function (bool) pure" - } - }, - "id": 94, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "697:17:0", - "tryCall": false, - "typeDescriptions": - { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 95, - "nodeType": "ExpressionStatement", - "src": "697:17:0" - } - ] - }, - "functionSelector": "e5b2857b", - "id": 97, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "getarray", - "nameLocation": "635:8:0", - "nodeType": "FunctionDefinition", - "parameters": - { - "id": 86, - "nodeType": "ParameterList", - "parameters": - [ - { - "constant": false, - "id": 83, - "mutability": "mutable", - "name": "c", - "nameLocation": "661:1:0", - "nodeType": "VariableDeclaration", - "scope": 97, - "src": "644:18:0", - "stateVariable": false, - "storageLocation": "memory", - "typeDescriptions": - { - "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", - "typeString": "address[]" - }, - "typeName": - { - "baseType": - { - "id": 81, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "644:7:0", - "stateMutability": "nonpayable", - "typeDescriptions": - { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "id": 82, - "nodeType": "ArrayTypeName", - "src": "644:9:0", - "typeDescriptions": - { - "typeIdentifier": "t_array$_t_address_$dyn_storage_ptr", - "typeString": "address[]" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 85, - "mutability": "mutable", - "name": "e", - "nameLocation": "672:1:0", - "nodeType": "VariableDeclaration", - "scope": 97, - "src": "664:9:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": - { - "id": 84, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "664:7:0", - "stateMutability": "nonpayable", - "typeDescriptions": - { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "visibility": "internal" - } - ], - "src": "643:31:0" - }, - "returnParameters": - { - "id": 87, - "nodeType": "ParameterList", - "parameters": [], - "src": "687:0:0" - }, - "scope": 135, - "src": "626:95:0", - "stateMutability": "pure", - "virtual": false, - "visibility": "public" - }, - { - "body": - { - "id": 119, - "nodeType": "Block", - "src": "763:90:0", - "statements": - [ - { - "assignments": - [ - 104 - ], - "declarations": - [ - { - "constant": false, - "id": 104, - "mutability": "mutable", - "name": "b", - "nameLocation": "790:1:0", - "nodeType": "VariableDeclaration", - "scope": 119, - "src": "773:18:0", - "stateVariable": false, - "storageLocation": "memory", - "typeDescriptions": - { - "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", - "typeString": "address[]" - }, - "typeName": - { - "baseType": - { - "id": 102, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "773:7:0", - "typeDescriptions": - { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "id": 103, - "nodeType": "ArrayTypeName", - "src": "773:9:0", - "typeDescriptions": - { - "typeIdentifier": "t_array$_t_address_$dyn_storage_ptr", - "typeString": "address[]" - } - }, - "visibility": "internal" - } - ], - "id": 108, - "initialValue": - { - "arguments": [], - "expression": - { - "argumentTypes": [], - "expression": - { - "id": 105, - "name": "this", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": -28, - "src": "794:4:0", - "typeDescriptions": - { - "typeIdentifier": "t_contract$_C_$135", - "typeString": "contract C" - } - }, - "id": 106, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "foo", - "nodeType": "MemberAccess", - "referencedDeclaration": 60, - "src": "794:8:0", - "typeDescriptions": - { - "typeIdentifier": "t_function_external_view$__$returns$_t_array$_t_address_$dyn_memory_ptr_$", - "typeString": "function () view external returns (address[] memory)" - } - }, - "id": 107, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "794:10:0", - "tryCall": false, - "typeDescriptions": - { - "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", - "typeString": "address[] memory" - } - }, - "nodeType": "VariableDeclarationStatement", - "src": "773:31:0" - }, - { - "expression": - { - "arguments": - [ - { - "id": 112, - "name": "b", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 104, - "src": "829:1:0", - "typeDescriptions": - { - "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", - "typeString": "address[] memory" - } - }, - { - "arguments": - [ - { - "id": 115, - "name": "this", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": -28, - "src": "840:4:0", - "typeDescriptions": - { - "typeIdentifier": "t_contract$_C_$135", - "typeString": "contract C" - } - } - ], - "expression": - { - "argumentTypes": - [ - { - "typeIdentifier": "t_contract$_C_$135", - "typeString": "contract C" - } - ], - "id": 114, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "nodeType": "ElementaryTypeNameExpression", - "src": "832:7:0", - "typeDescriptions": - { - "typeIdentifier": "t_type$_t_address_$", - "typeString": "type(address)" - }, - "typeName": - { - "id": 113, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "832:7:0", - "typeDescriptions": {} - } - }, - "id": 116, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "typeConversion", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "832:13:0", - "tryCall": false, - "typeDescriptions": - { - "typeIdentifier": "t_address", - "typeString": "address" - } - } - ], - "expression": - { - "argumentTypes": - [ - { - "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", - "typeString": "address[] memory" - }, - { - "typeIdentifier": "t_address", - "typeString": "address" - } - ], - "expression": - { - "id": 109, - "name": "Utils", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 33, - "src": "814:5:0", - "typeDescriptions": - { - "typeIdentifier": "t_type$_t_contract$_Utils_$33_$", - "typeString": "type(library Utils)" - } - }, - "id": 111, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "getarray", - "nodeType": "MemberAccess", - "referencedDeclaration": 18, - "src": "814:14:0", - "typeDescriptions": - { - "typeIdentifier": "t_function_internal_pure$_t_array$_t_address_$dyn_memory_ptr_$_t_address_$returns$__$", - "typeString": "function (address[] memory,address) pure" - } - }, - "id": 117, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "814:32:0", - "tryCall": false, - "typeDescriptions": - { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 118, - "nodeType": "ExpressionStatement", - "src": "814:32:0" - } - ] - }, - "functionSelector": "d3ab473b", - "id": 120, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "callmyself", - "nameLocation": "736:10:0", - "nodeType": "FunctionDefinition", - "parameters": - { - "id": 98, - "nodeType": "ParameterList", - "parameters": [], - "src": "746:2:0" - }, - "returnParameters": - { - "id": 99, - "nodeType": "ParameterList", - "parameters": [], - "src": "763:0:0" - }, - "scope": 135, - "src": "727:126:0", - "stateMutability": "view", - "virtual": false, - "visibility": "external" - }, - { - "body": - { - "id": 133, - "nodeType": "Block", - "src": "915:29:0", - "statements": - [ - { - "expression": - { - "commonType": - { - "typeIdentifier": "t_int8", - "typeString": "int8" - }, - "id": 131, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": - { - "id": 129, - "name": "c", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 122, - "src": "932:1:0", - "typeDescriptions": - { - "typeIdentifier": "t_int8", - "typeString": "int8" - } - }, - "nodeType": "BinaryOperation", - "operator": "+", - "rightExpression": - { - "id": 130, - "name": "d", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 124, - "src": "936:1:0", - "typeDescriptions": - { - "typeIdentifier": "t_int8", - "typeString": "int8" - } - }, - "src": "932:5:0", - "typeDescriptions": - { - "typeIdentifier": "t_int8", - "typeString": "int8" - } - }, - "functionReturnParameters": 128, - "id": 132, - "nodeType": "Return", - "src": "925:12:0" - } - ] - }, - "functionSelector": "e2666777", - "id": 134, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "add", - "nameLocation": "868:3:0", - "nodeType": "FunctionDefinition", - "parameters": - { - "id": 125, - "nodeType": "ParameterList", - "parameters": - [ - { - "constant": false, - "id": 122, - "mutability": "mutable", - "name": "c", - "nameLocation": "877:1:0", - "nodeType": "VariableDeclaration", - "scope": 134, - "src": "872:6:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_int8", - "typeString": "int8" - }, - "typeName": - { - "id": 121, - "name": "int8", - "nodeType": "ElementaryTypeName", - "src": "872:4:0", - "typeDescriptions": - { - "typeIdentifier": "t_int8", - "typeString": "int8" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 124, - "mutability": "mutable", - "name": "d", - "nameLocation": "885:1:0", - "nodeType": "VariableDeclaration", - "scope": 134, - "src": "880:6:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_int8", - "typeString": "int8" - }, - "typeName": - { - "id": 123, - "name": "int8", - "nodeType": "ElementaryTypeName", - "src": "880:4:0", - "typeDescriptions": - { - "typeIdentifier": "t_int8", - "typeString": "int8" - } - }, - "visibility": "internal" - } - ], - "src": "871:16:0" - }, - "returnParameters": - { - "id": 128, - "nodeType": "ParameterList", - "parameters": - [ - { - "constant": false, - "id": 127, - "mutability": "mutable", - "name": "", - "nameLocation": "-1:-1:-1", - "nodeType": "VariableDeclaration", - "scope": 134, - "src": "909:4:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_int8", - "typeString": "int8" - }, - "typeName": - { - "id": 126, - "name": "int8", - "nodeType": "ElementaryTypeName", - "src": "909:4:0", - "typeDescriptions": - { - "typeIdentifier": "t_int8", - "typeString": "int8" - } - }, - "visibility": "internal" - } - ], - "src": "908:6:0" - }, - "scope": 135, - "src": "859:85:0", - "stateMutability": "pure", - "virtual": false, - "visibility": "public" - } - ], - "scope": 136, - "src": "280:666:0", - "usedErrors": [] - } - ], - "src": "42:905:0" -} \ No newline at end of file diff --git a/resources/regressions/test4.json/input_json/TenPower.sol_json.ast b/resources/regressions/test4.json/input_json/TenPower.sol_json.ast deleted file mode 100644 index b5bf1c3..0000000 --- a/resources/regressions/test4.json/input_json/TenPower.sol_json.ast +++ /dev/null @@ -1,334 +0,0 @@ -{ - "absolutePath": "benchmarks/10Power/TenPower.sol", - "exportedSymbols": - { - "TenPower": - [ - 23 - ] - }, - "id": 24, - "license": "GPL-3.0-only", - "nodeType": "SourceUnit", - "nodes": - [ - { - "id": 1, - "literals": - [ - "solidity", - ">", - "0.7", - ".0" - ], - "nodeType": "PragmaDirective", - "src": "41:23:0" - }, - { - "id": 2, - "literals": - [ - "experimental", - "ABIEncoderV2" - ], - "nodeType": "PragmaDirective", - "src": "65:33:0" - }, - { - "abstract": false, - "baseContracts": [], - "canonicalName": "TenPower", - "contractDependencies": [], - "contractKind": "contract", - "fullyImplemented": true, - "id": 23, - "linearizedBaseContracts": - [ - 23 - ], - "name": "TenPower", - "nameLocation": "109:8:0", - "nodeType": "ContractDefinition", - "nodes": - [ - { - "body": - { - "id": 21, - "nodeType": "Block", - "src": "198:122:0", - "statements": - [ - { - "assignments": - [ - 10 - ], - "declarations": - [ - { - "constant": false, - "id": 10, - "mutability": "mutable", - "name": "a", - "nameLocation": "216:1:0", - "nodeType": "VariableDeclaration", - "scope": 21, - "src": "208:9:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": - { - "id": 9, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "208:7:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - } - ], - "id": 12, - "initialValue": - { - "hexValue": "3130", - "id": 11, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "220:2:0", - "typeDescriptions": - { - "typeIdentifier": "t_rational_10_by_1", - "typeString": "int_const 10" - }, - "value": "10" - }, - "nodeType": "VariableDeclarationStatement", - "src": "208:14:0" - }, - { - "assignments": - [ - 14 - ], - "declarations": - [ - { - "constant": false, - "id": 14, - "mutability": "mutable", - "name": "res", - "nameLocation": "240:3:0", - "nodeType": "VariableDeclaration", - "scope": 21, - "src": "232:11:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": - { - "id": 13, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "232:7:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - } - ], - "id": 18, - "initialValue": - { - "commonType": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 17, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": - { - "id": 15, - "name": "a", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 10, - "src": "246:1:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "**", - "rightExpression": - { - "id": 16, - "name": "decimals", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4, - "src": "251:8:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - } - }, - "src": "246:13:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "VariableDeclarationStatement", - "src": "232:27:0" - }, - { - "expression": - { - "id": 19, - "name": "res", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 14, - "src": "276:3:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "functionReturnParameters": 8, - "id": 20, - "nodeType": "Return", - "src": "269:10:0" - } - ] - }, - "functionSelector": "eb79f1be", - "id": 22, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "get10PowerDecimals", - "nameLocation": "133:18:0", - "nodeType": "FunctionDefinition", - "parameters": - { - "id": 5, - "nodeType": "ParameterList", - "parameters": - [ - { - "constant": false, - "id": 4, - "mutability": "mutable", - "name": "decimals", - "nameLocation": "158:8:0", - "nodeType": "VariableDeclaration", - "scope": 22, - "src": "152:14:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - }, - "typeName": - { - "id": 3, - "name": "uint8", - "nodeType": "ElementaryTypeName", - "src": "152:5:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - } - }, - "visibility": "internal" - } - ], - "src": "151:16:0" - }, - "returnParameters": - { - "id": 8, - "nodeType": "ParameterList", - "parameters": - [ - { - "constant": false, - "id": 7, - "mutability": "mutable", - "name": "", - "nameLocation": "-1:-1:-1", - "nodeType": "VariableDeclaration", - "scope": 22, - "src": "189:7:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": - { - "id": 6, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "189:7:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - } - ], - "src": "188:9:0" - }, - "scope": 23, - "src": "124:196:0", - "stateMutability": "pure", - "virtual": false, - "visibility": "public" - } - ], - "scope": 24, - "src": "100:222:0", - "usedErrors": [] - } - ], - "src": "41:282:0" -} \ No newline at end of file diff --git a/resources/regressions/test4.json/input_json/TenPower.sol_json.ast.json b/resources/regressions/test4.json/input_json/TenPower.sol_json.ast.json deleted file mode 100644 index b5bf1c3..0000000 --- a/resources/regressions/test4.json/input_json/TenPower.sol_json.ast.json +++ /dev/null @@ -1,334 +0,0 @@ -{ - "absolutePath": "benchmarks/10Power/TenPower.sol", - "exportedSymbols": - { - "TenPower": - [ - 23 - ] - }, - "id": 24, - "license": "GPL-3.0-only", - "nodeType": "SourceUnit", - "nodes": - [ - { - "id": 1, - "literals": - [ - "solidity", - ">", - "0.7", - ".0" - ], - "nodeType": "PragmaDirective", - "src": "41:23:0" - }, - { - "id": 2, - "literals": - [ - "experimental", - "ABIEncoderV2" - ], - "nodeType": "PragmaDirective", - "src": "65:33:0" - }, - { - "abstract": false, - "baseContracts": [], - "canonicalName": "TenPower", - "contractDependencies": [], - "contractKind": "contract", - "fullyImplemented": true, - "id": 23, - "linearizedBaseContracts": - [ - 23 - ], - "name": "TenPower", - "nameLocation": "109:8:0", - "nodeType": "ContractDefinition", - "nodes": - [ - { - "body": - { - "id": 21, - "nodeType": "Block", - "src": "198:122:0", - "statements": - [ - { - "assignments": - [ - 10 - ], - "declarations": - [ - { - "constant": false, - "id": 10, - "mutability": "mutable", - "name": "a", - "nameLocation": "216:1:0", - "nodeType": "VariableDeclaration", - "scope": 21, - "src": "208:9:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": - { - "id": 9, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "208:7:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - } - ], - "id": 12, - "initialValue": - { - "hexValue": "3130", - "id": 11, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "220:2:0", - "typeDescriptions": - { - "typeIdentifier": "t_rational_10_by_1", - "typeString": "int_const 10" - }, - "value": "10" - }, - "nodeType": "VariableDeclarationStatement", - "src": "208:14:0" - }, - { - "assignments": - [ - 14 - ], - "declarations": - [ - { - "constant": false, - "id": 14, - "mutability": "mutable", - "name": "res", - "nameLocation": "240:3:0", - "nodeType": "VariableDeclaration", - "scope": 21, - "src": "232:11:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": - { - "id": 13, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "232:7:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - } - ], - "id": 18, - "initialValue": - { - "commonType": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 17, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": - { - "id": 15, - "name": "a", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 10, - "src": "246:1:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "**", - "rightExpression": - { - "id": 16, - "name": "decimals", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4, - "src": "251:8:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - } - }, - "src": "246:13:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "VariableDeclarationStatement", - "src": "232:27:0" - }, - { - "expression": - { - "id": 19, - "name": "res", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 14, - "src": "276:3:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "functionReturnParameters": 8, - "id": 20, - "nodeType": "Return", - "src": "269:10:0" - } - ] - }, - "functionSelector": "eb79f1be", - "id": 22, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "get10PowerDecimals", - "nameLocation": "133:18:0", - "nodeType": "FunctionDefinition", - "parameters": - { - "id": 5, - "nodeType": "ParameterList", - "parameters": - [ - { - "constant": false, - "id": 4, - "mutability": "mutable", - "name": "decimals", - "nameLocation": "158:8:0", - "nodeType": "VariableDeclaration", - "scope": 22, - "src": "152:14:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - }, - "typeName": - { - "id": 3, - "name": "uint8", - "nodeType": "ElementaryTypeName", - "src": "152:5:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - } - }, - "visibility": "internal" - } - ], - "src": "151:16:0" - }, - "returnParameters": - { - "id": 8, - "nodeType": "ParameterList", - "parameters": - [ - { - "constant": false, - "id": 7, - "mutability": "mutable", - "name": "", - "nameLocation": "-1:-1:-1", - "nodeType": "VariableDeclaration", - "scope": 22, - "src": "189:7:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": - { - "id": 6, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "189:7:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - } - ], - "src": "188:9:0" - }, - "scope": 23, - "src": "124:196:0", - "stateMutability": "pure", - "virtual": false, - "visibility": "public" - } - ], - "scope": 24, - "src": "100:222:0", - "usedErrors": [] - } - ], - "src": "41:282:0" -} \ No newline at end of file diff --git a/resources/regressions/test4.json/mutants.log b/resources/regressions/test4.json/mutants.log deleted file mode 100644 index 8257640..0000000 --- a/resources/regressions/test4.json/mutants.log +++ /dev/null @@ -1,6 +0,0 @@ -1,BinaryOpMutation,10Power/TenPower.sol,8:24, ** ,+ -2,BinaryOpMutation,10Power/TenPower.sol,8:24, ** ,- -3,BinaryOpMutation,10Power/TenPower.sol,8:24, ** ,* -4,BinaryOpMutation,10Power/TenPower.sol,8:24, ** ,/ -5,BinaryOpMutation,10Power/TenPower.sol,8:24, ** ,% -6,SwapArgumentsOperatorMutation,10Power/TenPower.sol,8:23,a ** decimals,decimals ** a diff --git a/resources/regressions/test4.json/mutants/1/10Power/TenPower.sol b/resources/regressions/test4.json/mutants/1/10Power/TenPower.sol deleted file mode 100644 index 4990844..0000000 --- a/resources/regressions/test4.json/mutants/1/10Power/TenPower.sol +++ /dev/null @@ -1,13 +0,0 @@ -// SPDX-License-Identifier: GPL-3.0-only -pragma solidity >0.7.0; -pragma experimental ABIEncoderV2; - -contract TenPower { - function get10PowerDecimals(uint8 decimals) public pure returns (uint256) { - uint256 a = 10; - /// BinaryOpMutation(`**` |==> `+`) of: `uint256 res = a ** decimals;` - uint256 res = a+decimals; - return res; - // return 10 ** decimals; - } -} diff --git a/resources/regressions/test4.json/mutants/2/10Power/TenPower.sol b/resources/regressions/test4.json/mutants/2/10Power/TenPower.sol deleted file mode 100644 index 23654dc..0000000 --- a/resources/regressions/test4.json/mutants/2/10Power/TenPower.sol +++ /dev/null @@ -1,13 +0,0 @@ -// SPDX-License-Identifier: GPL-3.0-only -pragma solidity >0.7.0; -pragma experimental ABIEncoderV2; - -contract TenPower { - function get10PowerDecimals(uint8 decimals) public pure returns (uint256) { - uint256 a = 10; - /// BinaryOpMutation(`**` |==> `-`) of: `uint256 res = a ** decimals;` - uint256 res = a-decimals; - return res; - // return 10 ** decimals; - } -} diff --git a/resources/regressions/test4.json/mutants/3/10Power/TenPower.sol b/resources/regressions/test4.json/mutants/3/10Power/TenPower.sol deleted file mode 100644 index 66d1760..0000000 --- a/resources/regressions/test4.json/mutants/3/10Power/TenPower.sol +++ /dev/null @@ -1,13 +0,0 @@ -// SPDX-License-Identifier: GPL-3.0-only -pragma solidity >0.7.0; -pragma experimental ABIEncoderV2; - -contract TenPower { - function get10PowerDecimals(uint8 decimals) public pure returns (uint256) { - uint256 a = 10; - /// BinaryOpMutation(`**` |==> `*`) of: `uint256 res = a ** decimals;` - uint256 res = a*decimals; - return res; - // return 10 ** decimals; - } -} diff --git a/resources/regressions/test4.json/mutants/4/10Power/TenPower.sol b/resources/regressions/test4.json/mutants/4/10Power/TenPower.sol deleted file mode 100644 index 844dc32..0000000 --- a/resources/regressions/test4.json/mutants/4/10Power/TenPower.sol +++ /dev/null @@ -1,13 +0,0 @@ -// SPDX-License-Identifier: GPL-3.0-only -pragma solidity >0.7.0; -pragma experimental ABIEncoderV2; - -contract TenPower { - function get10PowerDecimals(uint8 decimals) public pure returns (uint256) { - uint256 a = 10; - /// BinaryOpMutation(`**` |==> `/`) of: `uint256 res = a ** decimals;` - uint256 res = a/decimals; - return res; - // return 10 ** decimals; - } -} diff --git a/resources/regressions/test4.json/mutants/5/10Power/TenPower.sol b/resources/regressions/test4.json/mutants/5/10Power/TenPower.sol deleted file mode 100644 index 1461441..0000000 --- a/resources/regressions/test4.json/mutants/5/10Power/TenPower.sol +++ /dev/null @@ -1,13 +0,0 @@ -// SPDX-License-Identifier: GPL-3.0-only -pragma solidity >0.7.0; -pragma experimental ABIEncoderV2; - -contract TenPower { - function get10PowerDecimals(uint8 decimals) public pure returns (uint256) { - uint256 a = 10; - /// BinaryOpMutation(`**` |==> `%`) of: `uint256 res = a ** decimals;` - uint256 res = a%decimals; - return res; - // return 10 ** decimals; - } -} diff --git a/resources/regressions/test4.json/mutants/6/10Power/TenPower.sol b/resources/regressions/test4.json/mutants/6/10Power/TenPower.sol deleted file mode 100644 index 674f128..0000000 --- a/resources/regressions/test4.json/mutants/6/10Power/TenPower.sol +++ /dev/null @@ -1,13 +0,0 @@ -// SPDX-License-Identifier: GPL-3.0-only -pragma solidity >0.7.0; -pragma experimental ABIEncoderV2; - -contract TenPower { - function get10PowerDecimals(uint8 decimals) public pure returns (uint256) { - uint256 a = 10; - /// SwapArgumentsOperatorMutation(`a ** decimals` |==> `decimals ** a`) of: `uint256 res = a ** decimals;` - uint256 res = decimals ** a; - return res; - // return 10 ** decimals; - } -} diff --git a/resources/regressions/test5.json/gambit_results.json b/resources/regressions/test5.json/gambit_results.json deleted file mode 100644 index bf1a5b0..0000000 --- a/resources/regressions/test5.json/gambit_results.json +++ /dev/null @@ -1,79 +0,0 @@ -[ - { - "description": "BinaryOpMutation", - "diff": "--- original\n+++ mutant\n@@ -5,7 +5,8 @@\n contract TenPower {\n function get10PowerDecimals(uint8 decimals) public pure returns (uint256) {\n uint256 a = 10;\n- uint256 res = a ** decimals;\n+ /// BinaryOpMutation(`**` |==> `+`) of: `uint256 res = a ** decimals;`\n+ uint256 res = a+decimals;\n return res;\n // return 10 ** decimals;\n }\n", - "id": "1", - "name": "mutants/1/10Power/TenPower.sol", - "original": "10Power/TenPower.sol", - }, - { - "description": "BinaryOpMutation", - "diff": "--- original\n+++ mutant\n@@ -5,7 +5,8 @@\n contract TenPower {\n function get10PowerDecimals(uint8 decimals) public pure returns (uint256) {\n uint256 a = 10;\n- uint256 res = a ** decimals;\n+ /// BinaryOpMutation(`**` |==> `-`) of: `uint256 res = a ** decimals;`\n+ uint256 res = a-decimals;\n return res;\n // return 10 ** decimals;\n }\n", - "id": "2", - "name": "mutants/2/10Power/TenPower.sol", - "original": "10Power/TenPower.sol", - }, - { - "description": "BinaryOpMutation", - "diff": "--- original\n+++ mutant\n@@ -5,7 +5,8 @@\n contract TenPower {\n function get10PowerDecimals(uint8 decimals) public pure returns (uint256) {\n uint256 a = 10;\n- uint256 res = a ** decimals;\n+ /// BinaryOpMutation(`**` |==> `*`) of: `uint256 res = a ** decimals;`\n+ uint256 res = a*decimals;\n return res;\n // return 10 ** decimals;\n }\n", - "id": "3", - "name": "mutants/3/10Power/TenPower.sol", - "original": "10Power/TenPower.sol", - }, - { - "description": "BinaryOpMutation", - "diff": "--- original\n+++ mutant\n@@ -5,7 +5,8 @@\n contract TenPower {\n function get10PowerDecimals(uint8 decimals) public pure returns (uint256) {\n uint256 a = 10;\n- uint256 res = a ** decimals;\n+ /// BinaryOpMutation(`**` |==> `/`) of: `uint256 res = a ** decimals;`\n+ uint256 res = a/decimals;\n return res;\n // return 10 ** decimals;\n }\n", - "id": "4", - "name": "mutants/4/10Power/TenPower.sol", - "original": "10Power/TenPower.sol", - }, - { - "description": "BinaryOpMutation", - "diff": "--- original\n+++ mutant\n@@ -5,7 +5,8 @@\n contract TenPower {\n function get10PowerDecimals(uint8 decimals) public pure returns (uint256) {\n uint256 a = 10;\n- uint256 res = a ** decimals;\n+ /// BinaryOpMutation(`**` |==> `%`) of: `uint256 res = a ** decimals;`\n+ uint256 res = a%decimals;\n return res;\n // return 10 ** decimals;\n }\n", - "id": "5", - "name": "mutants/5/10Power/TenPower.sol", - "original": "10Power/TenPower.sol", - }, - { - "description": "SwapArgumentsOperatorMutation", - "diff": "--- original\n+++ mutant\n@@ -5,7 +5,8 @@\n contract TenPower {\n function get10PowerDecimals(uint8 decimals) public pure returns (uint256) {\n uint256 a = 10;\n- uint256 res = a ** decimals;\n+ /// SwapArgumentsOperatorMutation(`a ** decimals` |==> `decimals ** a`) of: `uint256 res = a ** decimals;`\n+ uint256 res = decimals ** a;\n return res;\n // return 10 ** decimals;\n }\n", - "id": "6", - "name": "mutants/6/10Power/TenPower.sol", - "original": "10Power/TenPower.sol", - }, - { - "description": "DeleteExpressionMutation", - "diff": "--- original\n+++ mutant\n@@ -4,7 +4,8 @@\n \n library Utils {\n function getarray(address[] memory c, address e) internal pure {\n- assert(c[0] == e);\n+ /// DeleteExpressionMutation(`assert(c[0] == e)` |==> `assert(true)`) of: `assert(c[0] == e);`\n+ assert(true);\n }\n \n function add(int8 a, int8 b) public pure returns (int8) {\n", - "id": "7", - "name": "mutants/7/MultipleContracts/C.sol", - "original": "MultipleContracts/C.sol", - }, - { - "description": "BinaryOpMutation", - "diff": "--- original\n+++ mutant\n@@ -8,7 +8,8 @@\n }\n \n function add(int8 a, int8 b) public pure returns (int8) {\n- return a + b;\n+ /// BinaryOpMutation(`+` |==> `-`) of: `return a + b;`\n+ return a-b;\n }\n }\n \n", - "id": "8", - "name": "mutants/8/MultipleContracts/C.sol", - "original": "MultipleContracts/C.sol", - }, - { - "description": "BinaryOpMutation", - "diff": "--- original\n+++ mutant\n@@ -8,7 +8,8 @@\n }\n \n function add(int8 a, int8 b) public pure returns (int8) {\n- return a + b;\n+ /// BinaryOpMutation(`+` |==> `*`) of: `return a + b;`\n+ return a*b;\n }\n }\n \n", - "id": "9", - "name": "mutants/9/MultipleContracts/C.sol", - "original": "MultipleContracts/C.sol", - }, - { - "description": "BinaryOpMutation", - "diff": "--- original\n+++ mutant\n@@ -8,7 +8,8 @@\n }\n \n function add(int8 a, int8 b) public pure returns (int8) {\n- return a + b;\n+ /// BinaryOpMutation(`+` |==> `/`) of: `return a + b;`\n+ return a/b;\n }\n }\n \n", - "id": "10", - "name": "mutants/10/MultipleContracts/C.sol", - "original": "MultipleContracts/C.sol", - }, - { - "description": "BinaryOpMutation", - "diff": "--- original\n+++ mutant\n@@ -8,7 +8,8 @@\n }\n \n function add(int8 a, int8 b) public pure returns (int8) {\n- return a + b;\n+ /// BinaryOpMutation(`+` |==> `%`) of: `return a + b;`\n+ return a%b;\n }\n }\n \n", - "id": "11", - "name": "mutants/11/MultipleContracts/C.sol", - "original": "MultipleContracts/C.sol", - } -] \ No newline at end of file diff --git a/resources/regressions/test5.json/input_json/C.sol_json.ast b/resources/regressions/test5.json/input_json/C.sol_json.ast deleted file mode 100644 index a3306b6..0000000 --- a/resources/regressions/test5.json/input_json/C.sol_json.ast +++ /dev/null @@ -1,1828 +0,0 @@ -{ - "absolutePath": "benchmarks/MultipleContracts/C.sol", - "exportedSymbols": - { - "C": - [ - 135 - ], - "Utils": - [ - 33 - ] - }, - "id": 136, - "license": "GPL-3.0-only", - "nodeType": "SourceUnit", - "nodes": - [ - { - "id": 1, - "literals": - [ - "solidity", - "^", - "0.8", - ".13" - ], - "nodeType": "PragmaDirective", - "src": "42:24:0" - }, - { - "abstract": false, - "baseContracts": [], - "canonicalName": "Utils", - "contractDependencies": [], - "contractKind": "library", - "fullyImplemented": true, - "id": 33, - "linearizedBaseContracts": - [ - 33 - ], - "name": "Utils", - "nameLocation": "76:5:0", - "nodeType": "ContractDefinition", - "nodes": - [ - { - "body": - { - "id": 17, - "nodeType": "Block", - "src": "151:34:0", - "statements": - [ - { - "expression": - { - "arguments": - [ - { - "commonType": - { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "id": 14, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": - { - "baseExpression": - { - "id": 10, - "name": "c", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4, - "src": "168:1:0", - "typeDescriptions": - { - "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", - "typeString": "address[] memory" - } - }, - "id": 12, - "indexExpression": - { - "hexValue": "30", - "id": 11, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "170:1:0", - "typeDescriptions": - { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - }, - "value": "0" - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "168:4:0", - "typeDescriptions": - { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "nodeType": "BinaryOperation", - "operator": "==", - "rightExpression": - { - "id": 13, - "name": "e", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 6, - "src": "176:1:0", - "typeDescriptions": - { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "src": "168:9:0", - "typeDescriptions": - { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - } - ], - "expression": - { - "argumentTypes": - [ - { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - ], - "id": 9, - "name": "assert", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": -3, - "src": "161:6:0", - "typeDescriptions": - { - "typeIdentifier": "t_function_assert_pure$_t_bool_$returns$__$", - "typeString": "function (bool) pure" - } - }, - "id": 15, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "161:17:0", - "tryCall": false, - "typeDescriptions": - { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 16, - "nodeType": "ExpressionStatement", - "src": "161:17:0" - } - ] - }, - "id": 18, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "getarray", - "nameLocation": "97:8:0", - "nodeType": "FunctionDefinition", - "parameters": - { - "id": 7, - "nodeType": "ParameterList", - "parameters": - [ - { - "constant": false, - "id": 4, - "mutability": "mutable", - "name": "c", - "nameLocation": "123:1:0", - "nodeType": "VariableDeclaration", - "scope": 18, - "src": "106:18:0", - "stateVariable": false, - "storageLocation": "memory", - "typeDescriptions": - { - "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", - "typeString": "address[]" - }, - "typeName": - { - "baseType": - { - "id": 2, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "106:7:0", - "stateMutability": "nonpayable", - "typeDescriptions": - { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "id": 3, - "nodeType": "ArrayTypeName", - "src": "106:9:0", - "typeDescriptions": - { - "typeIdentifier": "t_array$_t_address_$dyn_storage_ptr", - "typeString": "address[]" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 6, - "mutability": "mutable", - "name": "e", - "nameLocation": "134:1:0", - "nodeType": "VariableDeclaration", - "scope": 18, - "src": "126:9:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": - { - "id": 5, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "126:7:0", - "stateMutability": "nonpayable", - "typeDescriptions": - { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "visibility": "internal" - } - ], - "src": "105:31:0" - }, - "returnParameters": - { - "id": 8, - "nodeType": "ParameterList", - "parameters": [], - "src": "151:0:0" - }, - "scope": 33, - "src": "88:97:0", - "stateMutability": "pure", - "virtual": false, - "visibility": "internal" - }, - { - "body": - { - "id": 31, - "nodeType": "Block", - "src": "247:29:0", - "statements": - [ - { - "expression": - { - "commonType": - { - "typeIdentifier": "t_int8", - "typeString": "int8" - }, - "id": 29, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": - { - "id": 27, - "name": "a", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 20, - "src": "264:1:0", - "typeDescriptions": - { - "typeIdentifier": "t_int8", - "typeString": "int8" - } - }, - "nodeType": "BinaryOperation", - "operator": "+", - "rightExpression": - { - "id": 28, - "name": "b", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 22, - "src": "268:1:0", - "typeDescriptions": - { - "typeIdentifier": "t_int8", - "typeString": "int8" - } - }, - "src": "264:5:0", - "typeDescriptions": - { - "typeIdentifier": "t_int8", - "typeString": "int8" - } - }, - "functionReturnParameters": 26, - "id": 30, - "nodeType": "Return", - "src": "257:12:0" - } - ] - }, - "functionSelector": "e2666777", - "id": 32, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "add", - "nameLocation": "200:3:0", - "nodeType": "FunctionDefinition", - "parameters": - { - "id": 23, - "nodeType": "ParameterList", - "parameters": - [ - { - "constant": false, - "id": 20, - "mutability": "mutable", - "name": "a", - "nameLocation": "209:1:0", - "nodeType": "VariableDeclaration", - "scope": 32, - "src": "204:6:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_int8", - "typeString": "int8" - }, - "typeName": - { - "id": 19, - "name": "int8", - "nodeType": "ElementaryTypeName", - "src": "204:4:0", - "typeDescriptions": - { - "typeIdentifier": "t_int8", - "typeString": "int8" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 22, - "mutability": "mutable", - "name": "b", - "nameLocation": "217:1:0", - "nodeType": "VariableDeclaration", - "scope": 32, - "src": "212:6:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_int8", - "typeString": "int8" - }, - "typeName": - { - "id": 21, - "name": "int8", - "nodeType": "ElementaryTypeName", - "src": "212:4:0", - "typeDescriptions": - { - "typeIdentifier": "t_int8", - "typeString": "int8" - } - }, - "visibility": "internal" - } - ], - "src": "203:16:0" - }, - "returnParameters": - { - "id": 26, - "nodeType": "ParameterList", - "parameters": - [ - { - "constant": false, - "id": 25, - "mutability": "mutable", - "name": "", - "nameLocation": "-1:-1:-1", - "nodeType": "VariableDeclaration", - "scope": 32, - "src": "241:4:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_int8", - "typeString": "int8" - }, - "typeName": - { - "id": 24, - "name": "int8", - "nodeType": "ElementaryTypeName", - "src": "241:4:0", - "typeDescriptions": - { - "typeIdentifier": "t_int8", - "typeString": "int8" - } - }, - "visibility": "internal" - } - ], - "src": "240:6:0" - }, - "scope": 33, - "src": "191:85:0", - "stateMutability": "pure", - "virtual": false, - "visibility": "public" - } - ], - "scope": 136, - "src": "68:210:0", - "usedErrors": [] - }, - { - "abstract": false, - "baseContracts": [], - "canonicalName": "C", - "contractDependencies": [], - "contractKind": "contract", - "fullyImplemented": true, - "id": 135, - "linearizedBaseContracts": - [ - 135 - ], - "name": "C", - "nameLocation": "289:1:0", - "nodeType": "ContractDefinition", - "nodes": - [ - { - "body": - { - "id": 59, - "nodeType": "Block", - "src": "353:99:0", - "statements": - [ - { - "assignments": - [ - 43 - ], - "declarations": - [ - { - "constant": false, - "id": 43, - "mutability": "mutable", - "name": "a", - "nameLocation": "380:1:0", - "nodeType": "VariableDeclaration", - "scope": 59, - "src": "363:18:0", - "stateVariable": false, - "storageLocation": "memory", - "typeDescriptions": - { - "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", - "typeString": "address[]" - }, - "typeName": - { - "baseType": - { - "id": 41, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "363:7:0", - "typeDescriptions": - { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "id": 42, - "nodeType": "ArrayTypeName", - "src": "363:9:0", - "typeDescriptions": - { - "typeIdentifier": "t_array$_t_address_$dyn_storage_ptr", - "typeString": "address[]" - } - }, - "visibility": "internal" - } - ], - "id": 49, - "initialValue": - { - "arguments": - [ - { - "hexValue": "31", - "id": 47, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "398:1:0", - "typeDescriptions": - { - "typeIdentifier": "t_rational_1_by_1", - "typeString": "int_const 1" - }, - "value": "1" - } - ], - "expression": - { - "argumentTypes": - [ - { - "typeIdentifier": "t_rational_1_by_1", - "typeString": "int_const 1" - } - ], - "id": 46, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "nodeType": "NewExpression", - "src": "384:13:0", - "typeDescriptions": - { - "typeIdentifier": "t_function_objectcreation_pure$_t_uint256_$returns$_t_array$_t_address_$dyn_memory_ptr_$", - "typeString": "function (uint256) pure returns (address[] memory)" - }, - "typeName": - { - "baseType": - { - "id": 44, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "388:7:0", - "stateMutability": "nonpayable", - "typeDescriptions": - { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "id": 45, - "nodeType": "ArrayTypeName", - "src": "388:9:0", - "typeDescriptions": - { - "typeIdentifier": "t_array$_t_address_$dyn_storage_ptr", - "typeString": "address[]" - } - } - }, - "id": 48, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "384:16:0", - "tryCall": false, - "typeDescriptions": - { - "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", - "typeString": "address[] memory" - } - }, - "nodeType": "VariableDeclarationStatement", - "src": "363:37:0" - }, - { - "expression": - { - "id": 55, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": - { - "baseExpression": - { - "id": 50, - "name": "a", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 43, - "src": "410:1:0", - "typeDescriptions": - { - "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", - "typeString": "address[] memory" - } - }, - "id": 52, - "indexExpression": - { - "hexValue": "30", - "id": 51, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "412:1:0", - "typeDescriptions": - { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - }, - "value": "0" - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": true, - "nodeType": "IndexAccess", - "src": "410:4:0", - "typeDescriptions": - { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": - { - "expression": - { - "id": 53, - "name": "msg", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": -15, - "src": "417:3:0", - "typeDescriptions": - { - "typeIdentifier": "t_magic_message", - "typeString": "msg" - } - }, - "id": 54, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "sender", - "nodeType": "MemberAccess", - "src": "417:10:0", - "typeDescriptions": - { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "src": "410:17:0", - "typeDescriptions": - { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "id": 56, - "nodeType": "ExpressionStatement", - "src": "410:17:0" - }, - { - "expression": - { - "id": 57, - "name": "a", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 43, - "src": "444:1:0", - "typeDescriptions": - { - "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", - "typeString": "address[] memory" - } - }, - "functionReturnParameters": 38, - "id": 58, - "nodeType": "Return", - "src": "437:8:0" - } - ] - }, - "functionSelector": "c2985578", - "id": 60, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "foo", - "nameLocation": "306:3:0", - "nodeType": "FunctionDefinition", - "parameters": - { - "id": 34, - "nodeType": "ParameterList", - "parameters": [], - "src": "309:2:0" - }, - "returnParameters": - { - "id": 38, - "nodeType": "ParameterList", - "parameters": - [ - { - "constant": false, - "id": 37, - "mutability": "mutable", - "name": "", - "nameLocation": "-1:-1:-1", - "nodeType": "VariableDeclaration", - "scope": 60, - "src": "335:16:0", - "stateVariable": false, - "storageLocation": "memory", - "typeDescriptions": - { - "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", - "typeString": "address[]" - }, - "typeName": - { - "baseType": - { - "id": 35, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "335:7:0", - "stateMutability": "nonpayable", - "typeDescriptions": - { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "id": 36, - "nodeType": "ArrayTypeName", - "src": "335:9:0", - "typeDescriptions": - { - "typeIdentifier": "t_array$_t_address_$dyn_storage_ptr", - "typeString": "address[]" - } - }, - "visibility": "internal" - } - ], - "src": "334:18:0" - }, - "scope": 135, - "src": "297:155:0", - "stateMutability": "view", - "virtual": false, - "visibility": "external" - }, - { - "body": - { - "id": 79, - "nodeType": "Block", - "src": "532:88:0", - "statements": - [ - { - "assignments": - [ - 68 - ], - "declarations": - [ - { - "constant": false, - "id": 68, - "mutability": "mutable", - "name": "a", - "nameLocation": "550:1:0", - "nodeType": "VariableDeclaration", - "scope": 79, - "src": "542:9:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": - { - "id": 67, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "542:7:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - } - ], - "id": 70, - "initialValue": - { - "hexValue": "3130", - "id": 69, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "554:2:0", - "typeDescriptions": - { - "typeIdentifier": "t_rational_10_by_1", - "typeString": "int_const 10" - }, - "value": "10" - }, - "nodeType": "VariableDeclarationStatement", - "src": "542:14:0" - }, - { - "assignments": - [ - 72 - ], - "declarations": - [ - { - "constant": false, - "id": 72, - "mutability": "mutable", - "name": "res", - "nameLocation": "574:3:0", - "nodeType": "VariableDeclaration", - "scope": 79, - "src": "566:11:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": - { - "id": 71, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "566:7:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - } - ], - "id": 76, - "initialValue": - { - "commonType": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 75, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": - { - "id": 73, - "name": "a", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 68, - "src": "580:1:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "**", - "rightExpression": - { - "id": 74, - "name": "decimals", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 62, - "src": "585:8:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - } - }, - "src": "580:13:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "VariableDeclarationStatement", - "src": "566:27:0" - }, - { - "expression": - { - "id": 77, - "name": "res", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 72, - "src": "610:3:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "functionReturnParameters": 66, - "id": 78, - "nodeType": "Return", - "src": "603:10:0" - } - ] - }, - "functionSelector": "eb79f1be", - "id": 80, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "get10PowerDecimals", - "nameLocation": "467:18:0", - "nodeType": "FunctionDefinition", - "parameters": - { - "id": 63, - "nodeType": "ParameterList", - "parameters": - [ - { - "constant": false, - "id": 62, - "mutability": "mutable", - "name": "decimals", - "nameLocation": "492:8:0", - "nodeType": "VariableDeclaration", - "scope": 80, - "src": "486:14:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - }, - "typeName": - { - "id": 61, - "name": "uint8", - "nodeType": "ElementaryTypeName", - "src": "486:5:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - } - }, - "visibility": "internal" - } - ], - "src": "485:16:0" - }, - "returnParameters": - { - "id": 66, - "nodeType": "ParameterList", - "parameters": - [ - { - "constant": false, - "id": 65, - "mutability": "mutable", - "name": "", - "nameLocation": "-1:-1:-1", - "nodeType": "VariableDeclaration", - "scope": 80, - "src": "523:7:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": - { - "id": 64, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "523:7:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - } - ], - "src": "522:9:0" - }, - "scope": 135, - "src": "458:162:0", - "stateMutability": "pure", - "virtual": false, - "visibility": "public" - }, - { - "body": - { - "id": 96, - "nodeType": "Block", - "src": "687:34:0", - "statements": - [ - { - "expression": - { - "arguments": - [ - { - "commonType": - { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "id": 93, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": - { - "baseExpression": - { - "id": 89, - "name": "c", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 83, - "src": "704:1:0", - "typeDescriptions": - { - "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", - "typeString": "address[] memory" - } - }, - "id": 91, - "indexExpression": - { - "hexValue": "30", - "id": 90, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "706:1:0", - "typeDescriptions": - { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - }, - "value": "0" - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "704:4:0", - "typeDescriptions": - { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "nodeType": "BinaryOperation", - "operator": "==", - "rightExpression": - { - "id": 92, - "name": "e", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 85, - "src": "712:1:0", - "typeDescriptions": - { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "src": "704:9:0", - "typeDescriptions": - { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - } - ], - "expression": - { - "argumentTypes": - [ - { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - ], - "id": 88, - "name": "assert", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": -3, - "src": "697:6:0", - "typeDescriptions": - { - "typeIdentifier": "t_function_assert_pure$_t_bool_$returns$__$", - "typeString": "function (bool) pure" - } - }, - "id": 94, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "697:17:0", - "tryCall": false, - "typeDescriptions": - { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 95, - "nodeType": "ExpressionStatement", - "src": "697:17:0" - } - ] - }, - "functionSelector": "e5b2857b", - "id": 97, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "getarray", - "nameLocation": "635:8:0", - "nodeType": "FunctionDefinition", - "parameters": - { - "id": 86, - "nodeType": "ParameterList", - "parameters": - [ - { - "constant": false, - "id": 83, - "mutability": "mutable", - "name": "c", - "nameLocation": "661:1:0", - "nodeType": "VariableDeclaration", - "scope": 97, - "src": "644:18:0", - "stateVariable": false, - "storageLocation": "memory", - "typeDescriptions": - { - "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", - "typeString": "address[]" - }, - "typeName": - { - "baseType": - { - "id": 81, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "644:7:0", - "stateMutability": "nonpayable", - "typeDescriptions": - { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "id": 82, - "nodeType": "ArrayTypeName", - "src": "644:9:0", - "typeDescriptions": - { - "typeIdentifier": "t_array$_t_address_$dyn_storage_ptr", - "typeString": "address[]" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 85, - "mutability": "mutable", - "name": "e", - "nameLocation": "672:1:0", - "nodeType": "VariableDeclaration", - "scope": 97, - "src": "664:9:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": - { - "id": 84, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "664:7:0", - "stateMutability": "nonpayable", - "typeDescriptions": - { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "visibility": "internal" - } - ], - "src": "643:31:0" - }, - "returnParameters": - { - "id": 87, - "nodeType": "ParameterList", - "parameters": [], - "src": "687:0:0" - }, - "scope": 135, - "src": "626:95:0", - "stateMutability": "pure", - "virtual": false, - "visibility": "public" - }, - { - "body": - { - "id": 119, - "nodeType": "Block", - "src": "763:90:0", - "statements": - [ - { - "assignments": - [ - 104 - ], - "declarations": - [ - { - "constant": false, - "id": 104, - "mutability": "mutable", - "name": "b", - "nameLocation": "790:1:0", - "nodeType": "VariableDeclaration", - "scope": 119, - "src": "773:18:0", - "stateVariable": false, - "storageLocation": "memory", - "typeDescriptions": - { - "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", - "typeString": "address[]" - }, - "typeName": - { - "baseType": - { - "id": 102, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "773:7:0", - "typeDescriptions": - { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "id": 103, - "nodeType": "ArrayTypeName", - "src": "773:9:0", - "typeDescriptions": - { - "typeIdentifier": "t_array$_t_address_$dyn_storage_ptr", - "typeString": "address[]" - } - }, - "visibility": "internal" - } - ], - "id": 108, - "initialValue": - { - "arguments": [], - "expression": - { - "argumentTypes": [], - "expression": - { - "id": 105, - "name": "this", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": -28, - "src": "794:4:0", - "typeDescriptions": - { - "typeIdentifier": "t_contract$_C_$135", - "typeString": "contract C" - } - }, - "id": 106, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "foo", - "nodeType": "MemberAccess", - "referencedDeclaration": 60, - "src": "794:8:0", - "typeDescriptions": - { - "typeIdentifier": "t_function_external_view$__$returns$_t_array$_t_address_$dyn_memory_ptr_$", - "typeString": "function () view external returns (address[] memory)" - } - }, - "id": 107, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "794:10:0", - "tryCall": false, - "typeDescriptions": - { - "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", - "typeString": "address[] memory" - } - }, - "nodeType": "VariableDeclarationStatement", - "src": "773:31:0" - }, - { - "expression": - { - "arguments": - [ - { - "id": 112, - "name": "b", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 104, - "src": "829:1:0", - "typeDescriptions": - { - "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", - "typeString": "address[] memory" - } - }, - { - "arguments": - [ - { - "id": 115, - "name": "this", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": -28, - "src": "840:4:0", - "typeDescriptions": - { - "typeIdentifier": "t_contract$_C_$135", - "typeString": "contract C" - } - } - ], - "expression": - { - "argumentTypes": - [ - { - "typeIdentifier": "t_contract$_C_$135", - "typeString": "contract C" - } - ], - "id": 114, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "nodeType": "ElementaryTypeNameExpression", - "src": "832:7:0", - "typeDescriptions": - { - "typeIdentifier": "t_type$_t_address_$", - "typeString": "type(address)" - }, - "typeName": - { - "id": 113, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "832:7:0", - "typeDescriptions": {} - } - }, - "id": 116, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "typeConversion", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "832:13:0", - "tryCall": false, - "typeDescriptions": - { - "typeIdentifier": "t_address", - "typeString": "address" - } - } - ], - "expression": - { - "argumentTypes": - [ - { - "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", - "typeString": "address[] memory" - }, - { - "typeIdentifier": "t_address", - "typeString": "address" - } - ], - "expression": - { - "id": 109, - "name": "Utils", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 33, - "src": "814:5:0", - "typeDescriptions": - { - "typeIdentifier": "t_type$_t_contract$_Utils_$33_$", - "typeString": "type(library Utils)" - } - }, - "id": 111, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "getarray", - "nodeType": "MemberAccess", - "referencedDeclaration": 18, - "src": "814:14:0", - "typeDescriptions": - { - "typeIdentifier": "t_function_internal_pure$_t_array$_t_address_$dyn_memory_ptr_$_t_address_$returns$__$", - "typeString": "function (address[] memory,address) pure" - } - }, - "id": 117, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "814:32:0", - "tryCall": false, - "typeDescriptions": - { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 118, - "nodeType": "ExpressionStatement", - "src": "814:32:0" - } - ] - }, - "functionSelector": "d3ab473b", - "id": 120, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "callmyself", - "nameLocation": "736:10:0", - "nodeType": "FunctionDefinition", - "parameters": - { - "id": 98, - "nodeType": "ParameterList", - "parameters": [], - "src": "746:2:0" - }, - "returnParameters": - { - "id": 99, - "nodeType": "ParameterList", - "parameters": [], - "src": "763:0:0" - }, - "scope": 135, - "src": "727:126:0", - "stateMutability": "view", - "virtual": false, - "visibility": "external" - }, - { - "body": - { - "id": 133, - "nodeType": "Block", - "src": "915:29:0", - "statements": - [ - { - "expression": - { - "commonType": - { - "typeIdentifier": "t_int8", - "typeString": "int8" - }, - "id": 131, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": - { - "id": 129, - "name": "c", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 122, - "src": "932:1:0", - "typeDescriptions": - { - "typeIdentifier": "t_int8", - "typeString": "int8" - } - }, - "nodeType": "BinaryOperation", - "operator": "+", - "rightExpression": - { - "id": 130, - "name": "d", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 124, - "src": "936:1:0", - "typeDescriptions": - { - "typeIdentifier": "t_int8", - "typeString": "int8" - } - }, - "src": "932:5:0", - "typeDescriptions": - { - "typeIdentifier": "t_int8", - "typeString": "int8" - } - }, - "functionReturnParameters": 128, - "id": 132, - "nodeType": "Return", - "src": "925:12:0" - } - ] - }, - "functionSelector": "e2666777", - "id": 134, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "add", - "nameLocation": "868:3:0", - "nodeType": "FunctionDefinition", - "parameters": - { - "id": 125, - "nodeType": "ParameterList", - "parameters": - [ - { - "constant": false, - "id": 122, - "mutability": "mutable", - "name": "c", - "nameLocation": "877:1:0", - "nodeType": "VariableDeclaration", - "scope": 134, - "src": "872:6:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_int8", - "typeString": "int8" - }, - "typeName": - { - "id": 121, - "name": "int8", - "nodeType": "ElementaryTypeName", - "src": "872:4:0", - "typeDescriptions": - { - "typeIdentifier": "t_int8", - "typeString": "int8" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 124, - "mutability": "mutable", - "name": "d", - "nameLocation": "885:1:0", - "nodeType": "VariableDeclaration", - "scope": 134, - "src": "880:6:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_int8", - "typeString": "int8" - }, - "typeName": - { - "id": 123, - "name": "int8", - "nodeType": "ElementaryTypeName", - "src": "880:4:0", - "typeDescriptions": - { - "typeIdentifier": "t_int8", - "typeString": "int8" - } - }, - "visibility": "internal" - } - ], - "src": "871:16:0" - }, - "returnParameters": - { - "id": 128, - "nodeType": "ParameterList", - "parameters": - [ - { - "constant": false, - "id": 127, - "mutability": "mutable", - "name": "", - "nameLocation": "-1:-1:-1", - "nodeType": "VariableDeclaration", - "scope": 134, - "src": "909:4:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_int8", - "typeString": "int8" - }, - "typeName": - { - "id": 126, - "name": "int8", - "nodeType": "ElementaryTypeName", - "src": "909:4:0", - "typeDescriptions": - { - "typeIdentifier": "t_int8", - "typeString": "int8" - } - }, - "visibility": "internal" - } - ], - "src": "908:6:0" - }, - "scope": 135, - "src": "859:85:0", - "stateMutability": "pure", - "virtual": false, - "visibility": "public" - } - ], - "scope": 136, - "src": "280:666:0", - "usedErrors": [] - } - ], - "src": "42:905:0" -} \ No newline at end of file diff --git a/resources/regressions/test5.json/input_json/C.sol_json.ast.json b/resources/regressions/test5.json/input_json/C.sol_json.ast.json deleted file mode 100644 index a3306b6..0000000 --- a/resources/regressions/test5.json/input_json/C.sol_json.ast.json +++ /dev/null @@ -1,1828 +0,0 @@ -{ - "absolutePath": "benchmarks/MultipleContracts/C.sol", - "exportedSymbols": - { - "C": - [ - 135 - ], - "Utils": - [ - 33 - ] - }, - "id": 136, - "license": "GPL-3.0-only", - "nodeType": "SourceUnit", - "nodes": - [ - { - "id": 1, - "literals": - [ - "solidity", - "^", - "0.8", - ".13" - ], - "nodeType": "PragmaDirective", - "src": "42:24:0" - }, - { - "abstract": false, - "baseContracts": [], - "canonicalName": "Utils", - "contractDependencies": [], - "contractKind": "library", - "fullyImplemented": true, - "id": 33, - "linearizedBaseContracts": - [ - 33 - ], - "name": "Utils", - "nameLocation": "76:5:0", - "nodeType": "ContractDefinition", - "nodes": - [ - { - "body": - { - "id": 17, - "nodeType": "Block", - "src": "151:34:0", - "statements": - [ - { - "expression": - { - "arguments": - [ - { - "commonType": - { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "id": 14, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": - { - "baseExpression": - { - "id": 10, - "name": "c", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4, - "src": "168:1:0", - "typeDescriptions": - { - "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", - "typeString": "address[] memory" - } - }, - "id": 12, - "indexExpression": - { - "hexValue": "30", - "id": 11, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "170:1:0", - "typeDescriptions": - { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - }, - "value": "0" - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "168:4:0", - "typeDescriptions": - { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "nodeType": "BinaryOperation", - "operator": "==", - "rightExpression": - { - "id": 13, - "name": "e", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 6, - "src": "176:1:0", - "typeDescriptions": - { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "src": "168:9:0", - "typeDescriptions": - { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - } - ], - "expression": - { - "argumentTypes": - [ - { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - ], - "id": 9, - "name": "assert", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": -3, - "src": "161:6:0", - "typeDescriptions": - { - "typeIdentifier": "t_function_assert_pure$_t_bool_$returns$__$", - "typeString": "function (bool) pure" - } - }, - "id": 15, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "161:17:0", - "tryCall": false, - "typeDescriptions": - { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 16, - "nodeType": "ExpressionStatement", - "src": "161:17:0" - } - ] - }, - "id": 18, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "getarray", - "nameLocation": "97:8:0", - "nodeType": "FunctionDefinition", - "parameters": - { - "id": 7, - "nodeType": "ParameterList", - "parameters": - [ - { - "constant": false, - "id": 4, - "mutability": "mutable", - "name": "c", - "nameLocation": "123:1:0", - "nodeType": "VariableDeclaration", - "scope": 18, - "src": "106:18:0", - "stateVariable": false, - "storageLocation": "memory", - "typeDescriptions": - { - "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", - "typeString": "address[]" - }, - "typeName": - { - "baseType": - { - "id": 2, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "106:7:0", - "stateMutability": "nonpayable", - "typeDescriptions": - { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "id": 3, - "nodeType": "ArrayTypeName", - "src": "106:9:0", - "typeDescriptions": - { - "typeIdentifier": "t_array$_t_address_$dyn_storage_ptr", - "typeString": "address[]" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 6, - "mutability": "mutable", - "name": "e", - "nameLocation": "134:1:0", - "nodeType": "VariableDeclaration", - "scope": 18, - "src": "126:9:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": - { - "id": 5, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "126:7:0", - "stateMutability": "nonpayable", - "typeDescriptions": - { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "visibility": "internal" - } - ], - "src": "105:31:0" - }, - "returnParameters": - { - "id": 8, - "nodeType": "ParameterList", - "parameters": [], - "src": "151:0:0" - }, - "scope": 33, - "src": "88:97:0", - "stateMutability": "pure", - "virtual": false, - "visibility": "internal" - }, - { - "body": - { - "id": 31, - "nodeType": "Block", - "src": "247:29:0", - "statements": - [ - { - "expression": - { - "commonType": - { - "typeIdentifier": "t_int8", - "typeString": "int8" - }, - "id": 29, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": - { - "id": 27, - "name": "a", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 20, - "src": "264:1:0", - "typeDescriptions": - { - "typeIdentifier": "t_int8", - "typeString": "int8" - } - }, - "nodeType": "BinaryOperation", - "operator": "+", - "rightExpression": - { - "id": 28, - "name": "b", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 22, - "src": "268:1:0", - "typeDescriptions": - { - "typeIdentifier": "t_int8", - "typeString": "int8" - } - }, - "src": "264:5:0", - "typeDescriptions": - { - "typeIdentifier": "t_int8", - "typeString": "int8" - } - }, - "functionReturnParameters": 26, - "id": 30, - "nodeType": "Return", - "src": "257:12:0" - } - ] - }, - "functionSelector": "e2666777", - "id": 32, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "add", - "nameLocation": "200:3:0", - "nodeType": "FunctionDefinition", - "parameters": - { - "id": 23, - "nodeType": "ParameterList", - "parameters": - [ - { - "constant": false, - "id": 20, - "mutability": "mutable", - "name": "a", - "nameLocation": "209:1:0", - "nodeType": "VariableDeclaration", - "scope": 32, - "src": "204:6:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_int8", - "typeString": "int8" - }, - "typeName": - { - "id": 19, - "name": "int8", - "nodeType": "ElementaryTypeName", - "src": "204:4:0", - "typeDescriptions": - { - "typeIdentifier": "t_int8", - "typeString": "int8" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 22, - "mutability": "mutable", - "name": "b", - "nameLocation": "217:1:0", - "nodeType": "VariableDeclaration", - "scope": 32, - "src": "212:6:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_int8", - "typeString": "int8" - }, - "typeName": - { - "id": 21, - "name": "int8", - "nodeType": "ElementaryTypeName", - "src": "212:4:0", - "typeDescriptions": - { - "typeIdentifier": "t_int8", - "typeString": "int8" - } - }, - "visibility": "internal" - } - ], - "src": "203:16:0" - }, - "returnParameters": - { - "id": 26, - "nodeType": "ParameterList", - "parameters": - [ - { - "constant": false, - "id": 25, - "mutability": "mutable", - "name": "", - "nameLocation": "-1:-1:-1", - "nodeType": "VariableDeclaration", - "scope": 32, - "src": "241:4:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_int8", - "typeString": "int8" - }, - "typeName": - { - "id": 24, - "name": "int8", - "nodeType": "ElementaryTypeName", - "src": "241:4:0", - "typeDescriptions": - { - "typeIdentifier": "t_int8", - "typeString": "int8" - } - }, - "visibility": "internal" - } - ], - "src": "240:6:0" - }, - "scope": 33, - "src": "191:85:0", - "stateMutability": "pure", - "virtual": false, - "visibility": "public" - } - ], - "scope": 136, - "src": "68:210:0", - "usedErrors": [] - }, - { - "abstract": false, - "baseContracts": [], - "canonicalName": "C", - "contractDependencies": [], - "contractKind": "contract", - "fullyImplemented": true, - "id": 135, - "linearizedBaseContracts": - [ - 135 - ], - "name": "C", - "nameLocation": "289:1:0", - "nodeType": "ContractDefinition", - "nodes": - [ - { - "body": - { - "id": 59, - "nodeType": "Block", - "src": "353:99:0", - "statements": - [ - { - "assignments": - [ - 43 - ], - "declarations": - [ - { - "constant": false, - "id": 43, - "mutability": "mutable", - "name": "a", - "nameLocation": "380:1:0", - "nodeType": "VariableDeclaration", - "scope": 59, - "src": "363:18:0", - "stateVariable": false, - "storageLocation": "memory", - "typeDescriptions": - { - "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", - "typeString": "address[]" - }, - "typeName": - { - "baseType": - { - "id": 41, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "363:7:0", - "typeDescriptions": - { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "id": 42, - "nodeType": "ArrayTypeName", - "src": "363:9:0", - "typeDescriptions": - { - "typeIdentifier": "t_array$_t_address_$dyn_storage_ptr", - "typeString": "address[]" - } - }, - "visibility": "internal" - } - ], - "id": 49, - "initialValue": - { - "arguments": - [ - { - "hexValue": "31", - "id": 47, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "398:1:0", - "typeDescriptions": - { - "typeIdentifier": "t_rational_1_by_1", - "typeString": "int_const 1" - }, - "value": "1" - } - ], - "expression": - { - "argumentTypes": - [ - { - "typeIdentifier": "t_rational_1_by_1", - "typeString": "int_const 1" - } - ], - "id": 46, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "nodeType": "NewExpression", - "src": "384:13:0", - "typeDescriptions": - { - "typeIdentifier": "t_function_objectcreation_pure$_t_uint256_$returns$_t_array$_t_address_$dyn_memory_ptr_$", - "typeString": "function (uint256) pure returns (address[] memory)" - }, - "typeName": - { - "baseType": - { - "id": 44, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "388:7:0", - "stateMutability": "nonpayable", - "typeDescriptions": - { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "id": 45, - "nodeType": "ArrayTypeName", - "src": "388:9:0", - "typeDescriptions": - { - "typeIdentifier": "t_array$_t_address_$dyn_storage_ptr", - "typeString": "address[]" - } - } - }, - "id": 48, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "384:16:0", - "tryCall": false, - "typeDescriptions": - { - "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", - "typeString": "address[] memory" - } - }, - "nodeType": "VariableDeclarationStatement", - "src": "363:37:0" - }, - { - "expression": - { - "id": 55, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": - { - "baseExpression": - { - "id": 50, - "name": "a", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 43, - "src": "410:1:0", - "typeDescriptions": - { - "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", - "typeString": "address[] memory" - } - }, - "id": 52, - "indexExpression": - { - "hexValue": "30", - "id": 51, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "412:1:0", - "typeDescriptions": - { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - }, - "value": "0" - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": true, - "nodeType": "IndexAccess", - "src": "410:4:0", - "typeDescriptions": - { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": - { - "expression": - { - "id": 53, - "name": "msg", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": -15, - "src": "417:3:0", - "typeDescriptions": - { - "typeIdentifier": "t_magic_message", - "typeString": "msg" - } - }, - "id": 54, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "sender", - "nodeType": "MemberAccess", - "src": "417:10:0", - "typeDescriptions": - { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "src": "410:17:0", - "typeDescriptions": - { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "id": 56, - "nodeType": "ExpressionStatement", - "src": "410:17:0" - }, - { - "expression": - { - "id": 57, - "name": "a", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 43, - "src": "444:1:0", - "typeDescriptions": - { - "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", - "typeString": "address[] memory" - } - }, - "functionReturnParameters": 38, - "id": 58, - "nodeType": "Return", - "src": "437:8:0" - } - ] - }, - "functionSelector": "c2985578", - "id": 60, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "foo", - "nameLocation": "306:3:0", - "nodeType": "FunctionDefinition", - "parameters": - { - "id": 34, - "nodeType": "ParameterList", - "parameters": [], - "src": "309:2:0" - }, - "returnParameters": - { - "id": 38, - "nodeType": "ParameterList", - "parameters": - [ - { - "constant": false, - "id": 37, - "mutability": "mutable", - "name": "", - "nameLocation": "-1:-1:-1", - "nodeType": "VariableDeclaration", - "scope": 60, - "src": "335:16:0", - "stateVariable": false, - "storageLocation": "memory", - "typeDescriptions": - { - "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", - "typeString": "address[]" - }, - "typeName": - { - "baseType": - { - "id": 35, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "335:7:0", - "stateMutability": "nonpayable", - "typeDescriptions": - { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "id": 36, - "nodeType": "ArrayTypeName", - "src": "335:9:0", - "typeDescriptions": - { - "typeIdentifier": "t_array$_t_address_$dyn_storage_ptr", - "typeString": "address[]" - } - }, - "visibility": "internal" - } - ], - "src": "334:18:0" - }, - "scope": 135, - "src": "297:155:0", - "stateMutability": "view", - "virtual": false, - "visibility": "external" - }, - { - "body": - { - "id": 79, - "nodeType": "Block", - "src": "532:88:0", - "statements": - [ - { - "assignments": - [ - 68 - ], - "declarations": - [ - { - "constant": false, - "id": 68, - "mutability": "mutable", - "name": "a", - "nameLocation": "550:1:0", - "nodeType": "VariableDeclaration", - "scope": 79, - "src": "542:9:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": - { - "id": 67, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "542:7:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - } - ], - "id": 70, - "initialValue": - { - "hexValue": "3130", - "id": 69, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "554:2:0", - "typeDescriptions": - { - "typeIdentifier": "t_rational_10_by_1", - "typeString": "int_const 10" - }, - "value": "10" - }, - "nodeType": "VariableDeclarationStatement", - "src": "542:14:0" - }, - { - "assignments": - [ - 72 - ], - "declarations": - [ - { - "constant": false, - "id": 72, - "mutability": "mutable", - "name": "res", - "nameLocation": "574:3:0", - "nodeType": "VariableDeclaration", - "scope": 79, - "src": "566:11:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": - { - "id": 71, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "566:7:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - } - ], - "id": 76, - "initialValue": - { - "commonType": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 75, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": - { - "id": 73, - "name": "a", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 68, - "src": "580:1:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "**", - "rightExpression": - { - "id": 74, - "name": "decimals", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 62, - "src": "585:8:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - } - }, - "src": "580:13:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "VariableDeclarationStatement", - "src": "566:27:0" - }, - { - "expression": - { - "id": 77, - "name": "res", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 72, - "src": "610:3:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "functionReturnParameters": 66, - "id": 78, - "nodeType": "Return", - "src": "603:10:0" - } - ] - }, - "functionSelector": "eb79f1be", - "id": 80, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "get10PowerDecimals", - "nameLocation": "467:18:0", - "nodeType": "FunctionDefinition", - "parameters": - { - "id": 63, - "nodeType": "ParameterList", - "parameters": - [ - { - "constant": false, - "id": 62, - "mutability": "mutable", - "name": "decimals", - "nameLocation": "492:8:0", - "nodeType": "VariableDeclaration", - "scope": 80, - "src": "486:14:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - }, - "typeName": - { - "id": 61, - "name": "uint8", - "nodeType": "ElementaryTypeName", - "src": "486:5:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - } - }, - "visibility": "internal" - } - ], - "src": "485:16:0" - }, - "returnParameters": - { - "id": 66, - "nodeType": "ParameterList", - "parameters": - [ - { - "constant": false, - "id": 65, - "mutability": "mutable", - "name": "", - "nameLocation": "-1:-1:-1", - "nodeType": "VariableDeclaration", - "scope": 80, - "src": "523:7:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": - { - "id": 64, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "523:7:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - } - ], - "src": "522:9:0" - }, - "scope": 135, - "src": "458:162:0", - "stateMutability": "pure", - "virtual": false, - "visibility": "public" - }, - { - "body": - { - "id": 96, - "nodeType": "Block", - "src": "687:34:0", - "statements": - [ - { - "expression": - { - "arguments": - [ - { - "commonType": - { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "id": 93, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": - { - "baseExpression": - { - "id": 89, - "name": "c", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 83, - "src": "704:1:0", - "typeDescriptions": - { - "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", - "typeString": "address[] memory" - } - }, - "id": 91, - "indexExpression": - { - "hexValue": "30", - "id": 90, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "706:1:0", - "typeDescriptions": - { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - }, - "value": "0" - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "704:4:0", - "typeDescriptions": - { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "nodeType": "BinaryOperation", - "operator": "==", - "rightExpression": - { - "id": 92, - "name": "e", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 85, - "src": "712:1:0", - "typeDescriptions": - { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "src": "704:9:0", - "typeDescriptions": - { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - } - ], - "expression": - { - "argumentTypes": - [ - { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - ], - "id": 88, - "name": "assert", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": -3, - "src": "697:6:0", - "typeDescriptions": - { - "typeIdentifier": "t_function_assert_pure$_t_bool_$returns$__$", - "typeString": "function (bool) pure" - } - }, - "id": 94, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "697:17:0", - "tryCall": false, - "typeDescriptions": - { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 95, - "nodeType": "ExpressionStatement", - "src": "697:17:0" - } - ] - }, - "functionSelector": "e5b2857b", - "id": 97, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "getarray", - "nameLocation": "635:8:0", - "nodeType": "FunctionDefinition", - "parameters": - { - "id": 86, - "nodeType": "ParameterList", - "parameters": - [ - { - "constant": false, - "id": 83, - "mutability": "mutable", - "name": "c", - "nameLocation": "661:1:0", - "nodeType": "VariableDeclaration", - "scope": 97, - "src": "644:18:0", - "stateVariable": false, - "storageLocation": "memory", - "typeDescriptions": - { - "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", - "typeString": "address[]" - }, - "typeName": - { - "baseType": - { - "id": 81, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "644:7:0", - "stateMutability": "nonpayable", - "typeDescriptions": - { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "id": 82, - "nodeType": "ArrayTypeName", - "src": "644:9:0", - "typeDescriptions": - { - "typeIdentifier": "t_array$_t_address_$dyn_storage_ptr", - "typeString": "address[]" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 85, - "mutability": "mutable", - "name": "e", - "nameLocation": "672:1:0", - "nodeType": "VariableDeclaration", - "scope": 97, - "src": "664:9:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": - { - "id": 84, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "664:7:0", - "stateMutability": "nonpayable", - "typeDescriptions": - { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "visibility": "internal" - } - ], - "src": "643:31:0" - }, - "returnParameters": - { - "id": 87, - "nodeType": "ParameterList", - "parameters": [], - "src": "687:0:0" - }, - "scope": 135, - "src": "626:95:0", - "stateMutability": "pure", - "virtual": false, - "visibility": "public" - }, - { - "body": - { - "id": 119, - "nodeType": "Block", - "src": "763:90:0", - "statements": - [ - { - "assignments": - [ - 104 - ], - "declarations": - [ - { - "constant": false, - "id": 104, - "mutability": "mutable", - "name": "b", - "nameLocation": "790:1:0", - "nodeType": "VariableDeclaration", - "scope": 119, - "src": "773:18:0", - "stateVariable": false, - "storageLocation": "memory", - "typeDescriptions": - { - "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", - "typeString": "address[]" - }, - "typeName": - { - "baseType": - { - "id": 102, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "773:7:0", - "typeDescriptions": - { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "id": 103, - "nodeType": "ArrayTypeName", - "src": "773:9:0", - "typeDescriptions": - { - "typeIdentifier": "t_array$_t_address_$dyn_storage_ptr", - "typeString": "address[]" - } - }, - "visibility": "internal" - } - ], - "id": 108, - "initialValue": - { - "arguments": [], - "expression": - { - "argumentTypes": [], - "expression": - { - "id": 105, - "name": "this", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": -28, - "src": "794:4:0", - "typeDescriptions": - { - "typeIdentifier": "t_contract$_C_$135", - "typeString": "contract C" - } - }, - "id": 106, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "foo", - "nodeType": "MemberAccess", - "referencedDeclaration": 60, - "src": "794:8:0", - "typeDescriptions": - { - "typeIdentifier": "t_function_external_view$__$returns$_t_array$_t_address_$dyn_memory_ptr_$", - "typeString": "function () view external returns (address[] memory)" - } - }, - "id": 107, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "794:10:0", - "tryCall": false, - "typeDescriptions": - { - "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", - "typeString": "address[] memory" - } - }, - "nodeType": "VariableDeclarationStatement", - "src": "773:31:0" - }, - { - "expression": - { - "arguments": - [ - { - "id": 112, - "name": "b", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 104, - "src": "829:1:0", - "typeDescriptions": - { - "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", - "typeString": "address[] memory" - } - }, - { - "arguments": - [ - { - "id": 115, - "name": "this", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": -28, - "src": "840:4:0", - "typeDescriptions": - { - "typeIdentifier": "t_contract$_C_$135", - "typeString": "contract C" - } - } - ], - "expression": - { - "argumentTypes": - [ - { - "typeIdentifier": "t_contract$_C_$135", - "typeString": "contract C" - } - ], - "id": 114, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "nodeType": "ElementaryTypeNameExpression", - "src": "832:7:0", - "typeDescriptions": - { - "typeIdentifier": "t_type$_t_address_$", - "typeString": "type(address)" - }, - "typeName": - { - "id": 113, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "832:7:0", - "typeDescriptions": {} - } - }, - "id": 116, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "typeConversion", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "832:13:0", - "tryCall": false, - "typeDescriptions": - { - "typeIdentifier": "t_address", - "typeString": "address" - } - } - ], - "expression": - { - "argumentTypes": - [ - { - "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", - "typeString": "address[] memory" - }, - { - "typeIdentifier": "t_address", - "typeString": "address" - } - ], - "expression": - { - "id": 109, - "name": "Utils", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 33, - "src": "814:5:0", - "typeDescriptions": - { - "typeIdentifier": "t_type$_t_contract$_Utils_$33_$", - "typeString": "type(library Utils)" - } - }, - "id": 111, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "getarray", - "nodeType": "MemberAccess", - "referencedDeclaration": 18, - "src": "814:14:0", - "typeDescriptions": - { - "typeIdentifier": "t_function_internal_pure$_t_array$_t_address_$dyn_memory_ptr_$_t_address_$returns$__$", - "typeString": "function (address[] memory,address) pure" - } - }, - "id": 117, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "814:32:0", - "tryCall": false, - "typeDescriptions": - { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 118, - "nodeType": "ExpressionStatement", - "src": "814:32:0" - } - ] - }, - "functionSelector": "d3ab473b", - "id": 120, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "callmyself", - "nameLocation": "736:10:0", - "nodeType": "FunctionDefinition", - "parameters": - { - "id": 98, - "nodeType": "ParameterList", - "parameters": [], - "src": "746:2:0" - }, - "returnParameters": - { - "id": 99, - "nodeType": "ParameterList", - "parameters": [], - "src": "763:0:0" - }, - "scope": 135, - "src": "727:126:0", - "stateMutability": "view", - "virtual": false, - "visibility": "external" - }, - { - "body": - { - "id": 133, - "nodeType": "Block", - "src": "915:29:0", - "statements": - [ - { - "expression": - { - "commonType": - { - "typeIdentifier": "t_int8", - "typeString": "int8" - }, - "id": 131, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": - { - "id": 129, - "name": "c", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 122, - "src": "932:1:0", - "typeDescriptions": - { - "typeIdentifier": "t_int8", - "typeString": "int8" - } - }, - "nodeType": "BinaryOperation", - "operator": "+", - "rightExpression": - { - "id": 130, - "name": "d", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 124, - "src": "936:1:0", - "typeDescriptions": - { - "typeIdentifier": "t_int8", - "typeString": "int8" - } - }, - "src": "932:5:0", - "typeDescriptions": - { - "typeIdentifier": "t_int8", - "typeString": "int8" - } - }, - "functionReturnParameters": 128, - "id": 132, - "nodeType": "Return", - "src": "925:12:0" - } - ] - }, - "functionSelector": "e2666777", - "id": 134, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "add", - "nameLocation": "868:3:0", - "nodeType": "FunctionDefinition", - "parameters": - { - "id": 125, - "nodeType": "ParameterList", - "parameters": - [ - { - "constant": false, - "id": 122, - "mutability": "mutable", - "name": "c", - "nameLocation": "877:1:0", - "nodeType": "VariableDeclaration", - "scope": 134, - "src": "872:6:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_int8", - "typeString": "int8" - }, - "typeName": - { - "id": 121, - "name": "int8", - "nodeType": "ElementaryTypeName", - "src": "872:4:0", - "typeDescriptions": - { - "typeIdentifier": "t_int8", - "typeString": "int8" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 124, - "mutability": "mutable", - "name": "d", - "nameLocation": "885:1:0", - "nodeType": "VariableDeclaration", - "scope": 134, - "src": "880:6:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_int8", - "typeString": "int8" - }, - "typeName": - { - "id": 123, - "name": "int8", - "nodeType": "ElementaryTypeName", - "src": "880:4:0", - "typeDescriptions": - { - "typeIdentifier": "t_int8", - "typeString": "int8" - } - }, - "visibility": "internal" - } - ], - "src": "871:16:0" - }, - "returnParameters": - { - "id": 128, - "nodeType": "ParameterList", - "parameters": - [ - { - "constant": false, - "id": 127, - "mutability": "mutable", - "name": "", - "nameLocation": "-1:-1:-1", - "nodeType": "VariableDeclaration", - "scope": 134, - "src": "909:4:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_int8", - "typeString": "int8" - }, - "typeName": - { - "id": 126, - "name": "int8", - "nodeType": "ElementaryTypeName", - "src": "909:4:0", - "typeDescriptions": - { - "typeIdentifier": "t_int8", - "typeString": "int8" - } - }, - "visibility": "internal" - } - ], - "src": "908:6:0" - }, - "scope": 135, - "src": "859:85:0", - "stateMutability": "pure", - "virtual": false, - "visibility": "public" - } - ], - "scope": 136, - "src": "280:666:0", - "usedErrors": [] - } - ], - "src": "42:905:0" -} \ No newline at end of file diff --git a/resources/regressions/test5.json/input_json/TenPower.sol_json.ast b/resources/regressions/test5.json/input_json/TenPower.sol_json.ast deleted file mode 100644 index b5bf1c3..0000000 --- a/resources/regressions/test5.json/input_json/TenPower.sol_json.ast +++ /dev/null @@ -1,334 +0,0 @@ -{ - "absolutePath": "benchmarks/10Power/TenPower.sol", - "exportedSymbols": - { - "TenPower": - [ - 23 - ] - }, - "id": 24, - "license": "GPL-3.0-only", - "nodeType": "SourceUnit", - "nodes": - [ - { - "id": 1, - "literals": - [ - "solidity", - ">", - "0.7", - ".0" - ], - "nodeType": "PragmaDirective", - "src": "41:23:0" - }, - { - "id": 2, - "literals": - [ - "experimental", - "ABIEncoderV2" - ], - "nodeType": "PragmaDirective", - "src": "65:33:0" - }, - { - "abstract": false, - "baseContracts": [], - "canonicalName": "TenPower", - "contractDependencies": [], - "contractKind": "contract", - "fullyImplemented": true, - "id": 23, - "linearizedBaseContracts": - [ - 23 - ], - "name": "TenPower", - "nameLocation": "109:8:0", - "nodeType": "ContractDefinition", - "nodes": - [ - { - "body": - { - "id": 21, - "nodeType": "Block", - "src": "198:122:0", - "statements": - [ - { - "assignments": - [ - 10 - ], - "declarations": - [ - { - "constant": false, - "id": 10, - "mutability": "mutable", - "name": "a", - "nameLocation": "216:1:0", - "nodeType": "VariableDeclaration", - "scope": 21, - "src": "208:9:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": - { - "id": 9, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "208:7:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - } - ], - "id": 12, - "initialValue": - { - "hexValue": "3130", - "id": 11, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "220:2:0", - "typeDescriptions": - { - "typeIdentifier": "t_rational_10_by_1", - "typeString": "int_const 10" - }, - "value": "10" - }, - "nodeType": "VariableDeclarationStatement", - "src": "208:14:0" - }, - { - "assignments": - [ - 14 - ], - "declarations": - [ - { - "constant": false, - "id": 14, - "mutability": "mutable", - "name": "res", - "nameLocation": "240:3:0", - "nodeType": "VariableDeclaration", - "scope": 21, - "src": "232:11:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": - { - "id": 13, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "232:7:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - } - ], - "id": 18, - "initialValue": - { - "commonType": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 17, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": - { - "id": 15, - "name": "a", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 10, - "src": "246:1:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "**", - "rightExpression": - { - "id": 16, - "name": "decimals", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4, - "src": "251:8:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - } - }, - "src": "246:13:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "VariableDeclarationStatement", - "src": "232:27:0" - }, - { - "expression": - { - "id": 19, - "name": "res", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 14, - "src": "276:3:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "functionReturnParameters": 8, - "id": 20, - "nodeType": "Return", - "src": "269:10:0" - } - ] - }, - "functionSelector": "eb79f1be", - "id": 22, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "get10PowerDecimals", - "nameLocation": "133:18:0", - "nodeType": "FunctionDefinition", - "parameters": - { - "id": 5, - "nodeType": "ParameterList", - "parameters": - [ - { - "constant": false, - "id": 4, - "mutability": "mutable", - "name": "decimals", - "nameLocation": "158:8:0", - "nodeType": "VariableDeclaration", - "scope": 22, - "src": "152:14:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - }, - "typeName": - { - "id": 3, - "name": "uint8", - "nodeType": "ElementaryTypeName", - "src": "152:5:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - } - }, - "visibility": "internal" - } - ], - "src": "151:16:0" - }, - "returnParameters": - { - "id": 8, - "nodeType": "ParameterList", - "parameters": - [ - { - "constant": false, - "id": 7, - "mutability": "mutable", - "name": "", - "nameLocation": "-1:-1:-1", - "nodeType": "VariableDeclaration", - "scope": 22, - "src": "189:7:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": - { - "id": 6, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "189:7:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - } - ], - "src": "188:9:0" - }, - "scope": 23, - "src": "124:196:0", - "stateMutability": "pure", - "virtual": false, - "visibility": "public" - } - ], - "scope": 24, - "src": "100:222:0", - "usedErrors": [] - } - ], - "src": "41:282:0" -} \ No newline at end of file diff --git a/resources/regressions/test5.json/input_json/TenPower.sol_json.ast.json b/resources/regressions/test5.json/input_json/TenPower.sol_json.ast.json deleted file mode 100644 index b5bf1c3..0000000 --- a/resources/regressions/test5.json/input_json/TenPower.sol_json.ast.json +++ /dev/null @@ -1,334 +0,0 @@ -{ - "absolutePath": "benchmarks/10Power/TenPower.sol", - "exportedSymbols": - { - "TenPower": - [ - 23 - ] - }, - "id": 24, - "license": "GPL-3.0-only", - "nodeType": "SourceUnit", - "nodes": - [ - { - "id": 1, - "literals": - [ - "solidity", - ">", - "0.7", - ".0" - ], - "nodeType": "PragmaDirective", - "src": "41:23:0" - }, - { - "id": 2, - "literals": - [ - "experimental", - "ABIEncoderV2" - ], - "nodeType": "PragmaDirective", - "src": "65:33:0" - }, - { - "abstract": false, - "baseContracts": [], - "canonicalName": "TenPower", - "contractDependencies": [], - "contractKind": "contract", - "fullyImplemented": true, - "id": 23, - "linearizedBaseContracts": - [ - 23 - ], - "name": "TenPower", - "nameLocation": "109:8:0", - "nodeType": "ContractDefinition", - "nodes": - [ - { - "body": - { - "id": 21, - "nodeType": "Block", - "src": "198:122:0", - "statements": - [ - { - "assignments": - [ - 10 - ], - "declarations": - [ - { - "constant": false, - "id": 10, - "mutability": "mutable", - "name": "a", - "nameLocation": "216:1:0", - "nodeType": "VariableDeclaration", - "scope": 21, - "src": "208:9:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": - { - "id": 9, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "208:7:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - } - ], - "id": 12, - "initialValue": - { - "hexValue": "3130", - "id": 11, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "220:2:0", - "typeDescriptions": - { - "typeIdentifier": "t_rational_10_by_1", - "typeString": "int_const 10" - }, - "value": "10" - }, - "nodeType": "VariableDeclarationStatement", - "src": "208:14:0" - }, - { - "assignments": - [ - 14 - ], - "declarations": - [ - { - "constant": false, - "id": 14, - "mutability": "mutable", - "name": "res", - "nameLocation": "240:3:0", - "nodeType": "VariableDeclaration", - "scope": 21, - "src": "232:11:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": - { - "id": 13, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "232:7:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - } - ], - "id": 18, - "initialValue": - { - "commonType": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 17, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": - { - "id": 15, - "name": "a", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 10, - "src": "246:1:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "**", - "rightExpression": - { - "id": 16, - "name": "decimals", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4, - "src": "251:8:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - } - }, - "src": "246:13:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "VariableDeclarationStatement", - "src": "232:27:0" - }, - { - "expression": - { - "id": 19, - "name": "res", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 14, - "src": "276:3:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "functionReturnParameters": 8, - "id": 20, - "nodeType": "Return", - "src": "269:10:0" - } - ] - }, - "functionSelector": "eb79f1be", - "id": 22, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "get10PowerDecimals", - "nameLocation": "133:18:0", - "nodeType": "FunctionDefinition", - "parameters": - { - "id": 5, - "nodeType": "ParameterList", - "parameters": - [ - { - "constant": false, - "id": 4, - "mutability": "mutable", - "name": "decimals", - "nameLocation": "158:8:0", - "nodeType": "VariableDeclaration", - "scope": 22, - "src": "152:14:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - }, - "typeName": - { - "id": 3, - "name": "uint8", - "nodeType": "ElementaryTypeName", - "src": "152:5:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - } - }, - "visibility": "internal" - } - ], - "src": "151:16:0" - }, - "returnParameters": - { - "id": 8, - "nodeType": "ParameterList", - "parameters": - [ - { - "constant": false, - "id": 7, - "mutability": "mutable", - "name": "", - "nameLocation": "-1:-1:-1", - "nodeType": "VariableDeclaration", - "scope": 22, - "src": "189:7:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": - { - "id": 6, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "189:7:0", - "typeDescriptions": - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - } - ], - "src": "188:9:0" - }, - "scope": 23, - "src": "124:196:0", - "stateMutability": "pure", - "virtual": false, - "visibility": "public" - } - ], - "scope": 24, - "src": "100:222:0", - "usedErrors": [] - } - ], - "src": "41:282:0" -} \ No newline at end of file diff --git a/resources/regressions/test5.json/mutants.log b/resources/regressions/test5.json/mutants.log deleted file mode 100644 index c77e470..0000000 --- a/resources/regressions/test5.json/mutants.log +++ /dev/null @@ -1,11 +0,0 @@ -1,BinaryOpMutation,10Power/TenPower.sol,8:24, ** ,+ -2,BinaryOpMutation,10Power/TenPower.sol,8:24, ** ,- -3,BinaryOpMutation,10Power/TenPower.sol,8:24, ** ,* -4,BinaryOpMutation,10Power/TenPower.sol,8:24, ** ,/ -5,BinaryOpMutation,10Power/TenPower.sol,8:24, ** ,% -6,SwapArgumentsOperatorMutation,10Power/TenPower.sol,8:23,a ** decimals,decimals ** a -7,DeleteExpressionMutation,MultipleContracts/C.sol,7:9,assert(c[0] == e),assert(true) -8,BinaryOpMutation,MultipleContracts/C.sol,11:17, + ,- -9,BinaryOpMutation,MultipleContracts/C.sol,11:17, + ,* -10,BinaryOpMutation,MultipleContracts/C.sol,11:17, + ,/ -11,BinaryOpMutation,MultipleContracts/C.sol,11:17, + ,% diff --git a/resources/regressions/test5.json/mutants/1/10Power/TenPower.sol b/resources/regressions/test5.json/mutants/1/10Power/TenPower.sol deleted file mode 100644 index 4990844..0000000 --- a/resources/regressions/test5.json/mutants/1/10Power/TenPower.sol +++ /dev/null @@ -1,13 +0,0 @@ -// SPDX-License-Identifier: GPL-3.0-only -pragma solidity >0.7.0; -pragma experimental ABIEncoderV2; - -contract TenPower { - function get10PowerDecimals(uint8 decimals) public pure returns (uint256) { - uint256 a = 10; - /// BinaryOpMutation(`**` |==> `+`) of: `uint256 res = a ** decimals;` - uint256 res = a+decimals; - return res; - // return 10 ** decimals; - } -} diff --git a/resources/regressions/test5.json/mutants/10/MultipleContracts/C.sol b/resources/regressions/test5.json/mutants/10/MultipleContracts/C.sol deleted file mode 100644 index a5819d3..0000000 --- a/resources/regressions/test5.json/mutants/10/MultipleContracts/C.sol +++ /dev/null @@ -1,41 +0,0 @@ -// SPDX-License-Identifier: GPL-3.0-only - -pragma solidity ^0.8.13; - -library Utils { - function getarray(address[] memory c, address e) internal pure { - assert(c[0] == e); - } - - function add(int8 a, int8 b) public pure returns (int8) { - /// BinaryOpMutation(`+` |==> `/`) of: `return a + b;` - return a/b; - } -} - -contract C { - function foo() external view returns (address[] memory) { - address[] memory a = new address[](1); - a[0] = msg.sender; - return a; - } - - function get10PowerDecimals(uint8 decimals) public pure returns (uint256) { - uint256 a = 10; - uint256 res = a ** decimals; - return res; - } - - function getarray(address[] memory c, address e) public pure { - assert(c[0] == e); - } - - function callmyself() external view { - address[] memory b = this.foo(); - Utils.getarray(b, address(this)); - } - - function add(int8 c, int8 d) public pure returns (int8) { - return c + d; - } -} diff --git a/resources/regressions/test5.json/mutants/11/MultipleContracts/C.sol b/resources/regressions/test5.json/mutants/11/MultipleContracts/C.sol deleted file mode 100644 index 530045e..0000000 --- a/resources/regressions/test5.json/mutants/11/MultipleContracts/C.sol +++ /dev/null @@ -1,41 +0,0 @@ -// SPDX-License-Identifier: GPL-3.0-only - -pragma solidity ^0.8.13; - -library Utils { - function getarray(address[] memory c, address e) internal pure { - assert(c[0] == e); - } - - function add(int8 a, int8 b) public pure returns (int8) { - /// BinaryOpMutation(`+` |==> `%`) of: `return a + b;` - return a%b; - } -} - -contract C { - function foo() external view returns (address[] memory) { - address[] memory a = new address[](1); - a[0] = msg.sender; - return a; - } - - function get10PowerDecimals(uint8 decimals) public pure returns (uint256) { - uint256 a = 10; - uint256 res = a ** decimals; - return res; - } - - function getarray(address[] memory c, address e) public pure { - assert(c[0] == e); - } - - function callmyself() external view { - address[] memory b = this.foo(); - Utils.getarray(b, address(this)); - } - - function add(int8 c, int8 d) public pure returns (int8) { - return c + d; - } -} diff --git a/resources/regressions/test5.json/mutants/2/10Power/TenPower.sol b/resources/regressions/test5.json/mutants/2/10Power/TenPower.sol deleted file mode 100644 index 23654dc..0000000 --- a/resources/regressions/test5.json/mutants/2/10Power/TenPower.sol +++ /dev/null @@ -1,13 +0,0 @@ -// SPDX-License-Identifier: GPL-3.0-only -pragma solidity >0.7.0; -pragma experimental ABIEncoderV2; - -contract TenPower { - function get10PowerDecimals(uint8 decimals) public pure returns (uint256) { - uint256 a = 10; - /// BinaryOpMutation(`**` |==> `-`) of: `uint256 res = a ** decimals;` - uint256 res = a-decimals; - return res; - // return 10 ** decimals; - } -} diff --git a/resources/regressions/test5.json/mutants/3/10Power/TenPower.sol b/resources/regressions/test5.json/mutants/3/10Power/TenPower.sol deleted file mode 100644 index 66d1760..0000000 --- a/resources/regressions/test5.json/mutants/3/10Power/TenPower.sol +++ /dev/null @@ -1,13 +0,0 @@ -// SPDX-License-Identifier: GPL-3.0-only -pragma solidity >0.7.0; -pragma experimental ABIEncoderV2; - -contract TenPower { - function get10PowerDecimals(uint8 decimals) public pure returns (uint256) { - uint256 a = 10; - /// BinaryOpMutation(`**` |==> `*`) of: `uint256 res = a ** decimals;` - uint256 res = a*decimals; - return res; - // return 10 ** decimals; - } -} diff --git a/resources/regressions/test5.json/mutants/4/10Power/TenPower.sol b/resources/regressions/test5.json/mutants/4/10Power/TenPower.sol deleted file mode 100644 index 844dc32..0000000 --- a/resources/regressions/test5.json/mutants/4/10Power/TenPower.sol +++ /dev/null @@ -1,13 +0,0 @@ -// SPDX-License-Identifier: GPL-3.0-only -pragma solidity >0.7.0; -pragma experimental ABIEncoderV2; - -contract TenPower { - function get10PowerDecimals(uint8 decimals) public pure returns (uint256) { - uint256 a = 10; - /// BinaryOpMutation(`**` |==> `/`) of: `uint256 res = a ** decimals;` - uint256 res = a/decimals; - return res; - // return 10 ** decimals; - } -} diff --git a/resources/regressions/test5.json/mutants/5/10Power/TenPower.sol b/resources/regressions/test5.json/mutants/5/10Power/TenPower.sol deleted file mode 100644 index 1461441..0000000 --- a/resources/regressions/test5.json/mutants/5/10Power/TenPower.sol +++ /dev/null @@ -1,13 +0,0 @@ -// SPDX-License-Identifier: GPL-3.0-only -pragma solidity >0.7.0; -pragma experimental ABIEncoderV2; - -contract TenPower { - function get10PowerDecimals(uint8 decimals) public pure returns (uint256) { - uint256 a = 10; - /// BinaryOpMutation(`**` |==> `%`) of: `uint256 res = a ** decimals;` - uint256 res = a%decimals; - return res; - // return 10 ** decimals; - } -} diff --git a/resources/regressions/test5.json/mutants/6/10Power/TenPower.sol b/resources/regressions/test5.json/mutants/6/10Power/TenPower.sol deleted file mode 100644 index 674f128..0000000 --- a/resources/regressions/test5.json/mutants/6/10Power/TenPower.sol +++ /dev/null @@ -1,13 +0,0 @@ -// SPDX-License-Identifier: GPL-3.0-only -pragma solidity >0.7.0; -pragma experimental ABIEncoderV2; - -contract TenPower { - function get10PowerDecimals(uint8 decimals) public pure returns (uint256) { - uint256 a = 10; - /// SwapArgumentsOperatorMutation(`a ** decimals` |==> `decimals ** a`) of: `uint256 res = a ** decimals;` - uint256 res = decimals ** a; - return res; - // return 10 ** decimals; - } -} diff --git a/resources/regressions/test5.json/mutants/7/MultipleContracts/C.sol b/resources/regressions/test5.json/mutants/7/MultipleContracts/C.sol deleted file mode 100644 index dd751c5..0000000 --- a/resources/regressions/test5.json/mutants/7/MultipleContracts/C.sol +++ /dev/null @@ -1,41 +0,0 @@ -// SPDX-License-Identifier: GPL-3.0-only - -pragma solidity ^0.8.13; - -library Utils { - function getarray(address[] memory c, address e) internal pure { - /// DeleteExpressionMutation(`assert(c[0] == e)` |==> `assert(true)`) of: `assert(c[0] == e);` - assert(true); - } - - function add(int8 a, int8 b) public pure returns (int8) { - return a + b; - } -} - -contract C { - function foo() external view returns (address[] memory) { - address[] memory a = new address[](1); - a[0] = msg.sender; - return a; - } - - function get10PowerDecimals(uint8 decimals) public pure returns (uint256) { - uint256 a = 10; - uint256 res = a ** decimals; - return res; - } - - function getarray(address[] memory c, address e) public pure { - assert(c[0] == e); - } - - function callmyself() external view { - address[] memory b = this.foo(); - Utils.getarray(b, address(this)); - } - - function add(int8 c, int8 d) public pure returns (int8) { - return c + d; - } -} diff --git a/resources/regressions/test5.json/mutants/8/MultipleContracts/C.sol b/resources/regressions/test5.json/mutants/8/MultipleContracts/C.sol deleted file mode 100644 index a514961..0000000 --- a/resources/regressions/test5.json/mutants/8/MultipleContracts/C.sol +++ /dev/null @@ -1,41 +0,0 @@ -// SPDX-License-Identifier: GPL-3.0-only - -pragma solidity ^0.8.13; - -library Utils { - function getarray(address[] memory c, address e) internal pure { - assert(c[0] == e); - } - - function add(int8 a, int8 b) public pure returns (int8) { - /// BinaryOpMutation(`+` |==> `-`) of: `return a + b;` - return a-b; - } -} - -contract C { - function foo() external view returns (address[] memory) { - address[] memory a = new address[](1); - a[0] = msg.sender; - return a; - } - - function get10PowerDecimals(uint8 decimals) public pure returns (uint256) { - uint256 a = 10; - uint256 res = a ** decimals; - return res; - } - - function getarray(address[] memory c, address e) public pure { - assert(c[0] == e); - } - - function callmyself() external view { - address[] memory b = this.foo(); - Utils.getarray(b, address(this)); - } - - function add(int8 c, int8 d) public pure returns (int8) { - return c + d; - } -} diff --git a/resources/regressions/test5.json/mutants/9/MultipleContracts/C.sol b/resources/regressions/test5.json/mutants/9/MultipleContracts/C.sol deleted file mode 100644 index b85149e..0000000 --- a/resources/regressions/test5.json/mutants/9/MultipleContracts/C.sol +++ /dev/null @@ -1,41 +0,0 @@ -// SPDX-License-Identifier: GPL-3.0-only - -pragma solidity ^0.8.13; - -library Utils { - function getarray(address[] memory c, address e) internal pure { - assert(c[0] == e); - } - - function add(int8 a, int8 b) public pure returns (int8) { - /// BinaryOpMutation(`+` |==> `*`) of: `return a + b;` - return a*b; - } -} - -contract C { - function foo() external view returns (address[] memory) { - address[] memory a = new address[](1); - a[0] = msg.sender; - return a; - } - - function get10PowerDecimals(uint8 decimals) public pure returns (uint256) { - uint256 a = 10; - uint256 res = a ** decimals; - return res; - } - - function getarray(address[] memory c, address e) public pure { - assert(c[0] == e); - } - - function callmyself() external view { - address[] memory b = this.foo(); - Utils.getarray(b, address(this)); - } - - function add(int8 c, int8 d) public pure returns (int8) { - return c + d; - } -} diff --git a/resources/regressions/test_fallback_mutations.json/gambit_results.json b/resources/regressions/test_fallback_mutations.json/gambit_results.json new file mode 100644 index 0000000..d5f30ad --- /dev/null +++ b/resources/regressions/test_fallback_mutations.json/gambit_results.json @@ -0,0 +1,50 @@ +[ + { + "col": 13, + "description": "ExpressionValueReplacement", + "diff": "--- original\n+++ mutant\n@@ -7,8 +7,9 @@\n uint256 num,\n address addr,\n bool b\n+ /// ExpressionValueReplacement(`num == 0` |==> `true`) of: `if (num == 0) {`\n ) public returns (uint256) {\n- if (num == 0) {\n+ if (true) {\n return 0;\n } else {\n return checkArgumentsAreReplaced(num - 1, addr, !b);\n", + "id": "1", + "line": 11, + "name": "mutants/1/Fallback.sol", + "op": "EVR", + "orig": "num == 0", + "original": "Fallback.sol", + "repl": "true" + }, + { + "col": 13, + "description": "ExpressionValueReplacement", + "diff": "--- original\n+++ mutant\n@@ -7,8 +7,9 @@\n uint256 num,\n address addr,\n bool b\n+ /// ExpressionValueReplacement(`num == 0` |==> `false`) of: `if (num == 0) {`\n ) public returns (uint256) {\n- if (num == 0) {\n+ if (false) {\n return 0;\n } else {\n return checkArgumentsAreReplaced(num - 1, addr, !b);\n", + "id": "2", + "line": 11, + "name": "mutants/2/Fallback.sol", + "op": "EVR", + "orig": "num == 0", + "original": "Fallback.sol", + "repl": "false" + }, + { + "col": 20, + "description": "ExpressionValueReplacement", + "diff": "--- original\n+++ mutant\n@@ -10,8 +10,9 @@\n ) public returns (uint256) {\n if (num == 0) {\n return 0;\n+ /// ExpressionValueReplacement(`checkArgumentsAreReplaced(num - 1, addr, !b)` |==> `0`) of: `return checkArgumentsAreReplaced(num - 1, addr, !b);`\n } else {\n- return checkArgumentsAreReplaced(num - 1, addr, !b);\n+ return 0;\n }\n }\n }\n", + "id": "3", + "line": 14, + "name": "mutants/3/Fallback.sol", + "op": "EVR", + "orig": "checkArgumentsAreReplaced(num - 1, addr, !b)", + "original": "Fallback.sol", + "repl": "0" + }, + { + "col": 20, + "description": "ExpressionValueReplacement", + "diff": "--- original\n+++ mutant\n@@ -10,8 +10,9 @@\n ) public returns (uint256) {\n if (num == 0) {\n return 0;\n+ /// ExpressionValueReplacement(`checkArgumentsAreReplaced(num - 1, addr, !b)` |==> `1`) of: `return checkArgumentsAreReplaced(num - 1, addr, !b);`\n } else {\n- return checkArgumentsAreReplaced(num - 1, addr, !b);\n+ return 1;\n }\n }\n }\n", + "id": "4", + "line": 14, + "name": "mutants/4/Fallback.sol", + "op": "EVR", + "orig": "checkArgumentsAreReplaced(num - 1, addr, !b)", + "original": "Fallback.sol", + "repl": "1" + } +] \ No newline at end of file diff --git a/resources/regressions/test_fallback_mutations.json/mutants.log b/resources/regressions/test_fallback_mutations.json/mutants.log new file mode 100644 index 0000000..f1227dc --- /dev/null +++ b/resources/regressions/test_fallback_mutations.json/mutants.log @@ -0,0 +1,4 @@ +1,EVR,Fallback.sol,11:13,num == 0,true +2,EVR,Fallback.sol,11:13,num == 0,false +3,EVR,Fallback.sol,14:20,"checkArgumentsAreReplaced(num - 1, addr, !b)",0 +4,EVR,Fallback.sol,14:20,"checkArgumentsAreReplaced(num - 1, addr, !b)",1 diff --git a/resources/regressions/test_fallback_mutations.json/mutants/1/Fallback.sol b/resources/regressions/test_fallback_mutations.json/mutants/1/Fallback.sol new file mode 100644 index 0000000..8f353bd --- /dev/null +++ b/resources/regressions/test_fallback_mutations.json/mutants/1/Fallback.sol @@ -0,0 +1,18 @@ +// SPDX-License-Identifier: GPL-3.0-only + +pragma solidity ^0.8.13; + +contract Fallback { + function checkArgumentsAreReplaced( + uint256 num, + address addr, + bool b + /// ExpressionValueReplacement(`num == 0` |==> `true`) of: `if (num == 0) {` + ) public returns (uint256) { + if (true) { + return 0; + } else { + return checkArgumentsAreReplaced(num - 1, addr, !b); + } + } +} diff --git a/resources/regressions/test_fallback_mutations.json/mutants/2/Fallback.sol b/resources/regressions/test_fallback_mutations.json/mutants/2/Fallback.sol new file mode 100644 index 0000000..f2b6001 --- /dev/null +++ b/resources/regressions/test_fallback_mutations.json/mutants/2/Fallback.sol @@ -0,0 +1,18 @@ +// SPDX-License-Identifier: GPL-3.0-only + +pragma solidity ^0.8.13; + +contract Fallback { + function checkArgumentsAreReplaced( + uint256 num, + address addr, + bool b + /// ExpressionValueReplacement(`num == 0` |==> `false`) of: `if (num == 0) {` + ) public returns (uint256) { + if (false) { + return 0; + } else { + return checkArgumentsAreReplaced(num - 1, addr, !b); + } + } +} diff --git a/resources/regressions/test_fallback_mutations.json/mutants/3/Fallback.sol b/resources/regressions/test_fallback_mutations.json/mutants/3/Fallback.sol new file mode 100644 index 0000000..72c0f12 --- /dev/null +++ b/resources/regressions/test_fallback_mutations.json/mutants/3/Fallback.sol @@ -0,0 +1,18 @@ +// SPDX-License-Identifier: GPL-3.0-only + +pragma solidity ^0.8.13; + +contract Fallback { + function checkArgumentsAreReplaced( + uint256 num, + address addr, + bool b + ) public returns (uint256) { + if (num == 0) { + return 0; + /// ExpressionValueReplacement(`checkArgumentsAreReplaced(num - 1, addr, !b)` |==> `0`) of: `return checkArgumentsAreReplaced(num - 1, addr, !b);` + } else { + return 0; + } + } +} diff --git a/resources/regressions/test_fallback_mutations.json/mutants/4/Fallback.sol b/resources/regressions/test_fallback_mutations.json/mutants/4/Fallback.sol new file mode 100644 index 0000000..cf93e15 --- /dev/null +++ b/resources/regressions/test_fallback_mutations.json/mutants/4/Fallback.sol @@ -0,0 +1,18 @@ +// SPDX-License-Identifier: GPL-3.0-only + +pragma solidity ^0.8.13; + +contract Fallback { + function checkArgumentsAreReplaced( + uint256 num, + address addr, + bool b + ) public returns (uint256) { + if (num == 0) { + return 0; + /// ExpressionValueReplacement(`checkArgumentsAreReplaced(num - 1, addr, !b)` |==> `1`) of: `return checkArgumentsAreReplaced(num - 1, addr, !b);` + } else { + return 1; + } + } +} diff --git a/resources/regressions/test_import_map.json/gambit_results.json b/resources/regressions/test_import_map.json/gambit_results.json new file mode 100644 index 0000000..5facf26 --- /dev/null +++ b/resources/regressions/test_import_map.json/gambit_results.json @@ -0,0 +1,50 @@ +[ + { + "col": 18, + "description": "ArithmeticOperatorReplacement", + "diff": "--- original\n+++ mutant\n@@ -5,7 +5,8 @@\n import \"contracts/B.sol\";\n \n contract Contract {\n+ /// ArithmeticOperatorReplacement(`+` |==> `-`) of: `return a + b;`\n function plus(int256 a, int256 b) public pure returns (int256) {\n- return a + b;\n+ return a - b;\n }\n }\n", + "id": "1", + "line": 9, + "name": "mutants/1/contracts/Contract.sol", + "op": "AOR", + "orig": "+", + "original": "contracts/Contract.sol", + "repl": "-" + }, + { + "col": 18, + "description": "ArithmeticOperatorReplacement", + "diff": "--- original\n+++ mutant\n@@ -5,7 +5,8 @@\n import \"contracts/B.sol\";\n \n contract Contract {\n+ /// ArithmeticOperatorReplacement(`+` |==> `*`) of: `return a + b;`\n function plus(int256 a, int256 b) public pure returns (int256) {\n- return a + b;\n+ return a * b;\n }\n }\n", + "id": "2", + "line": 9, + "name": "mutants/2/contracts/Contract.sol", + "op": "AOR", + "orig": "+", + "original": "contracts/Contract.sol", + "repl": "*" + }, + { + "col": 18, + "description": "ArithmeticOperatorReplacement", + "diff": "--- original\n+++ mutant\n@@ -5,7 +5,8 @@\n import \"contracts/B.sol\";\n \n contract Contract {\n+ /// ArithmeticOperatorReplacement(`+` |==> `/`) of: `return a + b;`\n function plus(int256 a, int256 b) public pure returns (int256) {\n- return a + b;\n+ return a / b;\n }\n }\n", + "id": "3", + "line": 9, + "name": "mutants/3/contracts/Contract.sol", + "op": "AOR", + "orig": "+", + "original": "contracts/Contract.sol", + "repl": "/" + }, + { + "col": 18, + "description": "ArithmeticOperatorReplacement", + "diff": "--- original\n+++ mutant\n@@ -5,7 +5,8 @@\n import \"contracts/B.sol\";\n \n contract Contract {\n+ /// ArithmeticOperatorReplacement(`+` |==> `%`) of: `return a + b;`\n function plus(int256 a, int256 b) public pure returns (int256) {\n- return a + b;\n+ return a % b;\n }\n }\n", + "id": "4", + "line": 9, + "name": "mutants/4/contracts/Contract.sol", + "op": "AOR", + "orig": "+", + "original": "contracts/Contract.sol", + "repl": "%" + } +] \ No newline at end of file diff --git a/resources/regressions/test_import_map.json/mutants.log b/resources/regressions/test_import_map.json/mutants.log new file mode 100644 index 0000000..a120aea --- /dev/null +++ b/resources/regressions/test_import_map.json/mutants.log @@ -0,0 +1,4 @@ +1,AOR,contracts/Contract.sol,9:18,+,- +2,AOR,contracts/Contract.sol,9:18,+,* +3,AOR,contracts/Contract.sol,9:18,+,/ +4,AOR,contracts/Contract.sol,9:18,+,% diff --git a/resources/regressions/test_import_map.json/mutants/1/contracts/Contract.sol b/resources/regressions/test_import_map.json/mutants/1/contracts/Contract.sol new file mode 100644 index 0000000..904c745 --- /dev/null +++ b/resources/regressions/test_import_map.json/mutants/1/contracts/Contract.sol @@ -0,0 +1,12 @@ +// SPDX-License-Identifier: GPL-3.0-only +pragma solidity >0.7.0; + +import "@lib/Lib.sol"; +import "contracts/B.sol"; + +contract Contract { + /// ArithmeticOperatorReplacement(`+` |==> `-`) of: `return a + b;` + function plus(int256 a, int256 b) public pure returns (int256) { + return a - b; + } +} diff --git a/resources/regressions/test_import_map.json/mutants/2/contracts/Contract.sol b/resources/regressions/test_import_map.json/mutants/2/contracts/Contract.sol new file mode 100644 index 0000000..ba456fa --- /dev/null +++ b/resources/regressions/test_import_map.json/mutants/2/contracts/Contract.sol @@ -0,0 +1,12 @@ +// SPDX-License-Identifier: GPL-3.0-only +pragma solidity >0.7.0; + +import "@lib/Lib.sol"; +import "contracts/B.sol"; + +contract Contract { + /// ArithmeticOperatorReplacement(`+` |==> `*`) of: `return a + b;` + function plus(int256 a, int256 b) public pure returns (int256) { + return a * b; + } +} diff --git a/resources/regressions/test_import_map.json/mutants/3/contracts/Contract.sol b/resources/regressions/test_import_map.json/mutants/3/contracts/Contract.sol new file mode 100644 index 0000000..98d50aa --- /dev/null +++ b/resources/regressions/test_import_map.json/mutants/3/contracts/Contract.sol @@ -0,0 +1,12 @@ +// SPDX-License-Identifier: GPL-3.0-only +pragma solidity >0.7.0; + +import "@lib/Lib.sol"; +import "contracts/B.sol"; + +contract Contract { + /// ArithmeticOperatorReplacement(`+` |==> `/`) of: `return a + b;` + function plus(int256 a, int256 b) public pure returns (int256) { + return a / b; + } +} diff --git a/resources/regressions/test_import_map.json/mutants/4/contracts/Contract.sol b/resources/regressions/test_import_map.json/mutants/4/contracts/Contract.sol new file mode 100644 index 0000000..cebc7f7 --- /dev/null +++ b/resources/regressions/test_import_map.json/mutants/4/contracts/Contract.sol @@ -0,0 +1,12 @@ +// SPDX-License-Identifier: GPL-3.0-only +pragma solidity >0.7.0; + +import "@lib/Lib.sol"; +import "contracts/B.sol"; + +contract Contract { + /// ArithmeticOperatorReplacement(`+` |==> `%`) of: `return a + b;` + function plus(int256 a, int256 b) public pure returns (int256) { + return a % b; + } +} diff --git a/resources/regressions/test_log_invalid.json/gambit_results.json b/resources/regressions/test_log_invalid.json/gambit_results.json new file mode 100644 index 0000000..1ff0083 --- /dev/null +++ b/resources/regressions/test_log_invalid.json/gambit_results.json @@ -0,0 +1,914 @@ +[ + { + "col": 18, + "description": "ArithmeticOperatorReplacement", + "diff": "--- original\n+++ mutant\n@@ -9,8 +9,9 @@\n // a * b\n // a / b\n // a % b\n+ /// ArithmeticOperatorReplacement(`+` |==> `-`) of: `return a + b;`\n function plus(int256 a, int256 b) public pure returns (int256) {\n- return a + b;\n+ return a - b;\n }\n \n // Expect 4 mutants:\n", + "id": "1", + "line": 13, + "name": "mutants/1/AOR/AOR.sol", + "op": "AOR", + "orig": "+", + "original": "AOR/AOR.sol", + "repl": "-" + }, + { + "col": 18, + "description": "ArithmeticOperatorReplacement", + "diff": "--- original\n+++ mutant\n@@ -9,8 +9,9 @@\n // a * b\n // a / b\n // a % b\n+ /// ArithmeticOperatorReplacement(`+` |==> `*`) of: `return a + b;`\n function plus(int256 a, int256 b) public pure returns (int256) {\n- return a + b;\n+ return a * b;\n }\n \n // Expect 4 mutants:\n", + "id": "2", + "line": 13, + "name": "mutants/2/AOR/AOR.sol", + "op": "AOR", + "orig": "+", + "original": "AOR/AOR.sol", + "repl": "*" + }, + { + "col": 18, + "description": "ArithmeticOperatorReplacement", + "diff": "--- original\n+++ mutant\n@@ -9,8 +9,9 @@\n // a * b\n // a / b\n // a % b\n+ /// ArithmeticOperatorReplacement(`+` |==> `/`) of: `return a + b;`\n function plus(int256 a, int256 b) public pure returns (int256) {\n- return a + b;\n+ return a / b;\n }\n \n // Expect 4 mutants:\n", + "id": "3", + "line": 13, + "name": "mutants/3/AOR/AOR.sol", + "op": "AOR", + "orig": "+", + "original": "AOR/AOR.sol", + "repl": "/" + }, + { + "col": 18, + "description": "ArithmeticOperatorReplacement", + "diff": "--- original\n+++ mutant\n@@ -9,8 +9,9 @@\n // a * b\n // a / b\n // a % b\n+ /// ArithmeticOperatorReplacement(`+` |==> `%`) of: `return a + b;`\n function plus(int256 a, int256 b) public pure returns (int256) {\n- return a + b;\n+ return a % b;\n }\n \n // Expect 4 mutants:\n", + "id": "4", + "line": 13, + "name": "mutants/4/AOR/AOR.sol", + "op": "AOR", + "orig": "+", + "original": "AOR/AOR.sol", + "repl": "%" + }, + { + "col": 18, + "description": "ArithmeticOperatorReplacement", + "diff": "--- original\n+++ mutant\n@@ -18,8 +18,9 @@\n // a * b\n // a / b\n // a % b\n+ /// ArithmeticOperatorReplacement(`-` |==> `+`) of: `return a - b;`\n function minus(int256 a, int256 b) public pure returns (int256) {\n- return a - b;\n+ return a + b;\n }\n \n // Expect 4 mutants:\n", + "id": "5", + "line": 22, + "name": "mutants/5/AOR/AOR.sol", + "op": "AOR", + "orig": "-", + "original": "AOR/AOR.sol", + "repl": "+" + }, + { + "col": 18, + "description": "ArithmeticOperatorReplacement", + "diff": "--- original\n+++ mutant\n@@ -18,8 +18,9 @@\n // a * b\n // a / b\n // a % b\n+ /// ArithmeticOperatorReplacement(`-` |==> `*`) of: `return a - b;`\n function minus(int256 a, int256 b) public pure returns (int256) {\n- return a - b;\n+ return a * b;\n }\n \n // Expect 4 mutants:\n", + "id": "6", + "line": 22, + "name": "mutants/6/AOR/AOR.sol", + "op": "AOR", + "orig": "-", + "original": "AOR/AOR.sol", + "repl": "*" + }, + { + "col": 18, + "description": "ArithmeticOperatorReplacement", + "diff": "--- original\n+++ mutant\n@@ -18,8 +18,9 @@\n // a * b\n // a / b\n // a % b\n+ /// ArithmeticOperatorReplacement(`-` |==> `/`) of: `return a - b;`\n function minus(int256 a, int256 b) public pure returns (int256) {\n- return a - b;\n+ return a / b;\n }\n \n // Expect 4 mutants:\n", + "id": "7", + "line": 22, + "name": "mutants/7/AOR/AOR.sol", + "op": "AOR", + "orig": "-", + "original": "AOR/AOR.sol", + "repl": "/" + }, + { + "col": 18, + "description": "ArithmeticOperatorReplacement", + "diff": "--- original\n+++ mutant\n@@ -18,8 +18,9 @@\n // a * b\n // a / b\n // a % b\n+ /// ArithmeticOperatorReplacement(`-` |==> `%`) of: `return a - b;`\n function minus(int256 a, int256 b) public pure returns (int256) {\n- return a - b;\n+ return a % b;\n }\n \n // Expect 4 mutants:\n", + "id": "8", + "line": 22, + "name": "mutants/8/AOR/AOR.sol", + "op": "AOR", + "orig": "-", + "original": "AOR/AOR.sol", + "repl": "%" + }, + { + "col": 22, + "description": "ArithmeticOperatorReplacement", + "diff": "--- original\n+++ mutant\n@@ -30,8 +30,9 @@\n function times_with_parens(\n int256 a,\n int256 b\n+ /// ArithmeticOperatorReplacement(`*` |==> `+`) of: `return ((a)) * b;`\n ) public pure returns (int256) {\n- return ((a)) * b;\n+ return ((a)) + b;\n }\n \n // Expect 5 mutants:\n", + "id": "9", + "line": 34, + "name": "mutants/9/AOR/AOR.sol", + "op": "AOR", + "orig": "*", + "original": "AOR/AOR.sol", + "repl": "+" + }, + { + "col": 22, + "description": "ArithmeticOperatorReplacement", + "diff": "--- original\n+++ mutant\n@@ -30,8 +30,9 @@\n function times_with_parens(\n int256 a,\n int256 b\n+ /// ArithmeticOperatorReplacement(`*` |==> `-`) of: `return ((a)) * b;`\n ) public pure returns (int256) {\n- return ((a)) * b;\n+ return ((a)) - b;\n }\n \n // Expect 5 mutants:\n", + "id": "10", + "line": 34, + "name": "mutants/10/AOR/AOR.sol", + "op": "AOR", + "orig": "*", + "original": "AOR/AOR.sol", + "repl": "-" + }, + { + "col": 22, + "description": "ArithmeticOperatorReplacement", + "diff": "--- original\n+++ mutant\n@@ -30,8 +30,9 @@\n function times_with_parens(\n int256 a,\n int256 b\n+ /// ArithmeticOperatorReplacement(`*` |==> `/`) of: `return ((a)) * b;`\n ) public pure returns (int256) {\n- return ((a)) * b;\n+ return ((a)) / b;\n }\n \n // Expect 5 mutants:\n", + "id": "11", + "line": 34, + "name": "mutants/11/AOR/AOR.sol", + "op": "AOR", + "orig": "*", + "original": "AOR/AOR.sol", + "repl": "/" + }, + { + "col": 22, + "description": "ArithmeticOperatorReplacement", + "diff": "--- original\n+++ mutant\n@@ -30,8 +30,9 @@\n function times_with_parens(\n int256 a,\n int256 b\n+ /// ArithmeticOperatorReplacement(`*` |==> `%`) of: `return ((a)) * b;`\n ) public pure returns (int256) {\n- return ((a)) * b;\n+ return ((a)) % b;\n }\n \n // Expect 5 mutants:\n", + "id": "12", + "line": 34, + "name": "mutants/12/AOR/AOR.sol", + "op": "AOR", + "orig": "*", + "original": "AOR/AOR.sol", + "repl": "%" + }, + { + "col": 22, + "description": "ArithmeticOperatorReplacement", + "diff": "--- original\n+++ mutant\n@@ -43,8 +43,9 @@\n function unsigned_times_with_parens(\n uint256 a,\n uint256 b\n+ /// ArithmeticOperatorReplacement(`*` |==> `+`) of: `return ((a)) * b;`\n ) public pure returns (uint256) {\n- return ((a)) * b;\n+ return ((a)) + b;\n }\n \n // Expect 5 mutants:\n", + "id": "13", + "line": 47, + "name": "mutants/13/AOR/AOR.sol", + "op": "AOR", + "orig": "*", + "original": "AOR/AOR.sol", + "repl": "+" + }, + { + "col": 22, + "description": "ArithmeticOperatorReplacement", + "diff": "--- original\n+++ mutant\n@@ -43,8 +43,9 @@\n function unsigned_times_with_parens(\n uint256 a,\n uint256 b\n+ /// ArithmeticOperatorReplacement(`*` |==> `-`) of: `return ((a)) * b;`\n ) public pure returns (uint256) {\n- return ((a)) * b;\n+ return ((a)) - b;\n }\n \n // Expect 5 mutants:\n", + "id": "14", + "line": 47, + "name": "mutants/14/AOR/AOR.sol", + "op": "AOR", + "orig": "*", + "original": "AOR/AOR.sol", + "repl": "-" + }, + { + "col": 22, + "description": "ArithmeticOperatorReplacement", + "diff": "--- original\n+++ mutant\n@@ -43,8 +43,9 @@\n function unsigned_times_with_parens(\n uint256 a,\n uint256 b\n+ /// ArithmeticOperatorReplacement(`*` |==> `/`) of: `return ((a)) * b;`\n ) public pure returns (uint256) {\n- return ((a)) * b;\n+ return ((a)) / b;\n }\n \n // Expect 5 mutants:\n", + "id": "15", + "line": 47, + "name": "mutants/15/AOR/AOR.sol", + "op": "AOR", + "orig": "*", + "original": "AOR/AOR.sol", + "repl": "/" + }, + { + "col": 22, + "description": "ArithmeticOperatorReplacement", + "diff": "--- original\n+++ mutant\n@@ -43,8 +43,9 @@\n function unsigned_times_with_parens(\n uint256 a,\n uint256 b\n+ /// ArithmeticOperatorReplacement(`*` |==> `**`) of: `return ((a)) * b;`\n ) public pure returns (uint256) {\n- return ((a)) * b;\n+ return ((a)) ** b;\n }\n \n // Expect 5 mutants:\n", + "id": "16", + "line": 47, + "name": "mutants/16/AOR/AOR.sol", + "op": "AOR", + "orig": "*", + "original": "AOR/AOR.sol", + "repl": "**" + }, + { + "col": 22, + "description": "ArithmeticOperatorReplacement", + "diff": "--- original\n+++ mutant\n@@ -43,8 +43,9 @@\n function unsigned_times_with_parens(\n uint256 a,\n uint256 b\n+ /// ArithmeticOperatorReplacement(`*` |==> `%`) of: `return ((a)) * b;`\n ) public pure returns (uint256) {\n- return ((a)) * b;\n+ return ((a)) % b;\n }\n \n // Expect 5 mutants:\n", + "id": "17", + "line": 47, + "name": "mutants/17/AOR/AOR.sol", + "op": "AOR", + "orig": "*", + "original": "AOR/AOR.sol", + "repl": "%" + }, + { + "col": 18, + "description": "ArithmeticOperatorReplacement", + "diff": "--- original\n+++ mutant\n@@ -54,7 +54,8 @@\n // a * b\n // a % b\n \n+ /// ArithmeticOperatorReplacement(`**` |==> `+`) of: `return a ** b;`\n function power(uint256 a, uint256 b) public pure returns (uint256) {\n- return a ** b;\n+ return a + b;\n }\n }\n", + "id": "18", + "line": 58, + "name": "mutants/18/AOR/AOR.sol", + "op": "AOR", + "orig": "**", + "original": "AOR/AOR.sol", + "repl": "+" + }, + { + "col": 18, + "description": "ArithmeticOperatorReplacement", + "diff": "--- original\n+++ mutant\n@@ -54,7 +54,8 @@\n // a * b\n // a % b\n \n+ /// ArithmeticOperatorReplacement(`**` |==> `-`) of: `return a ** b;`\n function power(uint256 a, uint256 b) public pure returns (uint256) {\n- return a ** b;\n+ return a - b;\n }\n }\n", + "id": "19", + "line": 58, + "name": "mutants/19/AOR/AOR.sol", + "op": "AOR", + "orig": "**", + "original": "AOR/AOR.sol", + "repl": "-" + }, + { + "col": 18, + "description": "ArithmeticOperatorReplacement", + "diff": "--- original\n+++ mutant\n@@ -54,7 +54,8 @@\n // a * b\n // a % b\n \n+ /// ArithmeticOperatorReplacement(`**` |==> `*`) of: `return a ** b;`\n function power(uint256 a, uint256 b) public pure returns (uint256) {\n- return a ** b;\n+ return a * b;\n }\n }\n", + "id": "20", + "line": 58, + "name": "mutants/20/AOR/AOR.sol", + "op": "AOR", + "orig": "**", + "original": "AOR/AOR.sol", + "repl": "*" + }, + { + "col": 18, + "description": "ArithmeticOperatorReplacement", + "diff": "--- original\n+++ mutant\n@@ -54,7 +54,8 @@\n // a * b\n // a % b\n \n+ /// ArithmeticOperatorReplacement(`**` |==> `/`) of: `return a ** b;`\n function power(uint256 a, uint256 b) public pure returns (uint256) {\n- return a ** b;\n+ return a / b;\n }\n }\n", + "id": "21", + "line": 58, + "name": "mutants/21/AOR/AOR.sol", + "op": "AOR", + "orig": "**", + "original": "AOR/AOR.sol", + "repl": "/" + }, + { + "col": 18, + "description": "ArithmeticOperatorReplacement", + "diff": "--- original\n+++ mutant\n@@ -54,7 +54,8 @@\n // a * b\n // a % b\n \n+ /// ArithmeticOperatorReplacement(`**` |==> `%`) of: `return a ** b;`\n function power(uint256 a, uint256 b) public pure returns (uint256) {\n- return a ** b;\n+ return a % b;\n }\n }\n", + "id": "22", + "line": 58, + "name": "mutants/22/AOR/AOR.sol", + "op": "AOR", + "orig": "**", + "original": "AOR/AOR.sol", + "repl": "%" + }, + { + "col": 18, + "description": "ConditionalOperatorReplacement", + "diff": "--- original\n+++ mutant\n@@ -6,8 +6,9 @@\n contract BOR {\n // Expect 1 mutants:\n // a & b;\n+ /// ConditionalOperatorReplacement(`|` |==> `&`) of: `return a | b;`\n function bw_or(int256 a, int256 b) public pure returns (int256) {\n- return a | b;\n+ return a & b;\n }\n \n // Expect 1 mutants:\n", + "id": "23", + "line": 10, + "name": "mutants/23/BOR/BOR.sol", + "op": "BOR", + "orig": "|", + "original": "BOR/BOR.sol", + "repl": "&" + }, + { + "col": 18, + "description": "ConditionalOperatorReplacement", + "diff": "--- original\n+++ mutant\n@@ -12,8 +12,9 @@\n \n // Expect 1 mutants:\n // a | b;\n+ /// ConditionalOperatorReplacement(`&` |==> `|`) of: `return a & b;`\n function bw_and(int256 a, int256 b) public pure returns (int256) {\n- return a & b;\n+ return a | b;\n }\n \n // Expect 1 mutants:\n", + "id": "24", + "line": 16, + "name": "mutants/24/BOR/BOR.sol", + "op": "BOR", + "orig": "&", + "original": "BOR/BOR.sol", + "repl": "|" + }, + { + "col": 18, + "description": "ConditionalOperatorReplacement", + "diff": "--- original\n+++ mutant\n@@ -18,7 +18,8 @@\n \n // Expect 1 mutants:\n // a | b;\n+ /// ConditionalOperatorReplacement(`^` |==> `&`) of: `return a ^ b;`\n function bw_xor(int256 a, int256 b) public pure returns (int256) {\n- return a ^ b;\n+ return a & b;\n }\n }\n", + "id": "25", + "line": 22, + "name": "mutants/25/BOR/BOR.sol", + "op": "BOR", + "orig": "^", + "original": "BOR/BOR.sol", + "repl": "&" + }, + { + "col": 38, + "description": "ElimDelegateCall", + "diff": "--- original\n+++ mutant\n@@ -12,8 +12,9 @@\n bool public delegateSuccessful;\n bytes public myData;\n \n+ /// ElimDelegateCall(`delegatecall` |==> `call`) of: `(bool success, ) = _contract.delegatecall(`\n function setVars(address _contract) public payable {\n- (bool success, ) = _contract.delegatecall(\n+ (bool success, ) = _contract.call(\n abi.encodeWithSignature(\"setVars(uint256)\", 1)\n );\n require(success, \"Delegatecall failed\");\n", + "id": "26", + "line": 16, + "name": "mutants/26/EDC/EDC.sol", + "op": "EDC", + "orig": "delegatecall", + "original": "EDC/EDC.sol", + "repl": "call" + }, + { + "col": 16, + "description": "LogicalOperatorReplacement", + "diff": "--- original\n+++ mutant\n@@ -5,8 +5,9 @@\n // This contract provides test functions for relational operator replacement (ROR)\n contract LOR {\n // Expect three mutants: a, b, false\n+ /// LogicalOperatorReplacement(`a && b` |==> `a`) of: `return a && b;`\n function and(bool a, bool b) public pure returns (bool) {\n- return a && b;\n+ return a;\n }\n \n // Expect three mutants: a, b, true\n", + "id": "27", + "line": 9, + "name": "mutants/27/LOR/LOR.sol", + "op": "LOR", + "orig": "a && b", + "original": "LOR/LOR.sol", + "repl": "a" + }, + { + "col": 16, + "description": "LogicalOperatorReplacement", + "diff": "--- original\n+++ mutant\n@@ -5,8 +5,9 @@\n // This contract provides test functions for relational operator replacement (ROR)\n contract LOR {\n // Expect three mutants: a, b, false\n+ /// LogicalOperatorReplacement(`a && b` |==> `b`) of: `return a && b;`\n function and(bool a, bool b) public pure returns (bool) {\n- return a && b;\n+ return b;\n }\n \n // Expect three mutants: a, b, true\n", + "id": "28", + "line": 9, + "name": "mutants/28/LOR/LOR.sol", + "op": "LOR", + "orig": "a && b", + "original": "LOR/LOR.sol", + "repl": "b" + }, + { + "col": 16, + "description": "LogicalOperatorReplacement", + "diff": "--- original\n+++ mutant\n@@ -5,8 +5,9 @@\n // This contract provides test functions for relational operator replacement (ROR)\n contract LOR {\n // Expect three mutants: a, b, false\n+ /// LogicalOperatorReplacement(`a && b` |==> `false`) of: `return a && b;`\n function and(bool a, bool b) public pure returns (bool) {\n- return a && b;\n+ return false;\n }\n \n // Expect three mutants: a, b, true\n", + "id": "29", + "line": 9, + "name": "mutants/29/LOR/LOR.sol", + "op": "LOR", + "orig": "a && b", + "original": "LOR/LOR.sol", + "repl": "false" + }, + { + "col": 16, + "description": "LogicalOperatorReplacement", + "diff": "--- original\n+++ mutant\n@@ -10,8 +10,9 @@\n }\n \n // Expect three mutants: a, b, true\n+ /// LogicalOperatorReplacement(`a || b` |==> `a`) of: `return a || b;`\n function or(bool a, bool b) public pure returns (bool) {\n- return a || b;\n+ return a;\n }\n \n // Expect three mutants, x < y, a != (x >= y), true\n", + "id": "30", + "line": 14, + "name": "mutants/30/LOR/LOR.sol", + "op": "LOR", + "orig": "a || b", + "original": "LOR/LOR.sol", + "repl": "a" + }, + { + "col": 16, + "description": "LogicalOperatorReplacement", + "diff": "--- original\n+++ mutant\n@@ -10,8 +10,9 @@\n }\n \n // Expect three mutants: a, b, true\n+ /// LogicalOperatorReplacement(`a || b` |==> `b`) of: `return a || b;`\n function or(bool a, bool b) public pure returns (bool) {\n- return a || b;\n+ return b;\n }\n \n // Expect three mutants, x < y, a != (x >= y), true\n", + "id": "31", + "line": 14, + "name": "mutants/31/LOR/LOR.sol", + "op": "LOR", + "orig": "a || b", + "original": "LOR/LOR.sol", + "repl": "b" + }, + { + "col": 16, + "description": "LogicalOperatorReplacement", + "diff": "--- original\n+++ mutant\n@@ -10,8 +10,9 @@\n }\n \n // Expect three mutants: a, b, true\n+ /// LogicalOperatorReplacement(`a || b` |==> `true`) of: `return a || b;`\n function or(bool a, bool b) public pure returns (bool) {\n- return a || b;\n+ return true;\n }\n \n // Expect three mutants, x < y, a != (x >= y), true\n", + "id": "32", + "line": 14, + "name": "mutants/32/LOR/LOR.sol", + "op": "LOR", + "orig": "a || b", + "original": "LOR/LOR.sol", + "repl": "true" + }, + { + "col": 16, + "description": "LogicalOperatorReplacement", + "diff": "--- original\n+++ mutant\n@@ -15,8 +15,9 @@\n }\n \n // Expect three mutants, x < y, a != (x >= y), true\n+ /// LogicalOperatorReplacement(`(x < y) || (a != (x >= y))` |==> `x < y`) of: `return (x < y) || (a != (x >= y));`\n function more_or(bool a, int x, int y) public pure returns (bool) {\n- return (x < y) || (a != (x >= y));\n+ return x < y;\n }\n \n function not(bool a) public pure returns (bool) {\n", + "id": "33", + "line": 19, + "name": "mutants/33/LOR/LOR.sol", + "op": "LOR", + "orig": "(x < y) || (a != (x >= y))", + "original": "LOR/LOR.sol", + "repl": "x < y" + }, + { + "col": 16, + "description": "LogicalOperatorReplacement", + "diff": "--- original\n+++ mutant\n@@ -15,8 +15,9 @@\n }\n \n // Expect three mutants, x < y, a != (x >= y), true\n+ /// LogicalOperatorReplacement(`(x < y) || (a != (x >= y))` |==> `a != (x >= y)`) of: `return (x < y) || (a != (x >= y));`\n function more_or(bool a, int x, int y) public pure returns (bool) {\n- return (x < y) || (a != (x >= y));\n+ return a != (x >= y);\n }\n \n function not(bool a) public pure returns (bool) {\n", + "id": "34", + "line": 19, + "name": "mutants/34/LOR/LOR.sol", + "op": "LOR", + "orig": "(x < y) || (a != (x >= y))", + "original": "LOR/LOR.sol", + "repl": "a != (x >= y)" + }, + { + "col": 16, + "description": "LogicalOperatorReplacement", + "diff": "--- original\n+++ mutant\n@@ -15,8 +15,9 @@\n }\n \n // Expect three mutants, x < y, a != (x >= y), true\n+ /// LogicalOperatorReplacement(`(x < y) || (a != (x >= y))` |==> `true`) of: `return (x < y) || (a != (x >= y));`\n function more_or(bool a, int x, int y) public pure returns (bool) {\n- return (x < y) || (a != (x >= y));\n+ return true;\n }\n \n function not(bool a) public pure returns (bool) {\n", + "id": "35", + "line": 19, + "name": "mutants/35/LOR/LOR.sol", + "op": "LOR", + "orig": "(x < y) || (a != (x >= y))", + "original": "LOR/LOR.sol", + "repl": "true" + }, + { + "col": 16, + "description": "LogicalOperatorReplacement", + "diff": "--- original\n+++ mutant\n@@ -19,7 +19,8 @@\n return (x < y) || (a != (x >= y));\n }\n \n+ /// LogicalOperatorReplacement(`!a` |==> `true`) of: `return !a;`\n function not(bool a) public pure returns (bool) {\n- return !a;\n+ return true;\n }\n }\n", + "id": "36", + "line": 23, + "name": "mutants/36/LOR/LOR.sol", + "op": "LOR", + "orig": "!a", + "original": "LOR/LOR.sol", + "repl": "true" + }, + { + "col": 16, + "description": "LogicalOperatorReplacement", + "diff": "--- original\n+++ mutant\n@@ -19,7 +19,8 @@\n return (x < y) || (a != (x >= y));\n }\n \n+ /// LogicalOperatorReplacement(`!a` |==> `false`) of: `return !a;`\n function not(bool a) public pure returns (bool) {\n- return !a;\n+ return false;\n }\n }\n", + "id": "37", + "line": 23, + "name": "mutants/37/LOR/LOR.sol", + "op": "LOR", + "orig": "!a", + "original": "LOR/LOR.sol", + "repl": "false" + }, + { + "col": 24, + "description": "LiteralValueReplacement", + "diff": "--- original\n+++ mutant\n@@ -11,8 +11,9 @@\n int256 zero_s = 0;\n \n // Expect 1 mutant: 1\n+ /// LiteralValueReplacement(`0` |==> `1`) of: `uint256 zero = 0;`\n function unsigned_zero() public pure returns (uint256) {\n- uint256 zero = 0;\n+ uint256 zero = 1;\n return zero;\n }\n \n", + "id": "38", + "line": 15, + "name": "mutants/38/LVR/LVR.sol", + "op": "LVR", + "orig": "0", + "original": "LVR/LVR.sol", + "repl": "1" + }, + { + "col": 23, + "description": "LiteralValueReplacement", + "diff": "--- original\n+++ mutant\n@@ -17,8 +17,9 @@\n }\n \n // Expect 2 mutant: 0, 2\n+ /// LiteralValueReplacement(`1` |==> `0`) of: `uint256 one = 1;`\n function unsigned_one() public pure returns (uint256) {\n- uint256 one = 1;\n+ uint256 one = 0;\n return one;\n }\n \n", + "id": "39", + "line": 21, + "name": "mutants/39/LVR/LVR.sol", + "op": "LVR", + "orig": "1", + "original": "LVR/LVR.sol", + "repl": "0" + }, + { + "col": 23, + "description": "LiteralValueReplacement", + "diff": "--- original\n+++ mutant\n@@ -17,8 +17,9 @@\n }\n \n // Expect 2 mutant: 0, 2\n+ /// LiteralValueReplacement(`1` |==> `2`) of: `uint256 one = 1;`\n function unsigned_one() public pure returns (uint256) {\n- uint256 one = 1;\n+ uint256 one = 2;\n return one;\n }\n \n", + "id": "40", + "line": 21, + "name": "mutants/40/LVR/LVR.sol", + "op": "LVR", + "orig": "1", + "original": "LVR/LVR.sol", + "repl": "2" + }, + { + "col": 26, + "description": "LiteralValueReplacement", + "diff": "--- original\n+++ mutant\n@@ -23,8 +23,9 @@\n }\n \n // Expect 2 mutants: 0, 1\n+ /// LiteralValueReplacement(`-1` |==> `0`) of: `int256 neg_one = -1;`\n function signed_neg_one() public pure returns (int256) {\n- int256 neg_one = -1;\n+ int256 neg_one = 0;\n return neg_one;\n }\n \n", + "id": "41", + "line": 27, + "name": "mutants/41/LVR/LVR.sol", + "op": "LVR", + "orig": "-1", + "original": "LVR/LVR.sol", + "repl": "0" + }, + { + "col": 26, + "description": "LiteralValueReplacement", + "diff": "--- original\n+++ mutant\n@@ -23,8 +23,9 @@\n }\n \n // Expect 2 mutants: 0, 1\n+ /// LiteralValueReplacement(`-1` |==> `1`) of: `int256 neg_one = -1;`\n function signed_neg_one() public pure returns (int256) {\n- int256 neg_one = -1;\n+ int256 neg_one = 1;\n return neg_one;\n }\n \n", + "id": "42", + "line": 27, + "name": "mutants/42/LVR/LVR.sol", + "op": "LVR", + "orig": "-1", + "original": "LVR/LVR.sol", + "repl": "1" + }, + { + "col": 26, + "description": "LiteralValueReplacement", + "diff": "--- original\n+++ mutant\n@@ -23,8 +23,9 @@\n }\n \n // Expect 2 mutants: 0, 1\n+ /// LiteralValueReplacement(`-1` |==> `-2`) of: `int256 neg_one = -1;`\n function signed_neg_one() public pure returns (int256) {\n- int256 neg_one = -1;\n+ int256 neg_one = -2;\n return neg_one;\n }\n \n", + "id": "43", + "line": 27, + "name": "mutants/43/LVR/LVR.sol", + "op": "LVR", + "orig": "-1", + "original": "LVR/LVR.sol", + "repl": "-2" + }, + { + "col": 26, + "description": "LiteralValueReplacement", + "diff": "--- original\n+++ mutant\n@@ -29,8 +29,9 @@\n }\n \n // Expect 2 mutants: -1, 0\n+ /// LiteralValueReplacement(`1` |==> `0`) of: `int256 pos_one = 1;`\n function signed_pos_one() public pure returns (int256) {\n- int256 pos_one = 1;\n+ int256 pos_one = 0;\n return pos_one;\n }\n \n", + "id": "44", + "line": 33, + "name": "mutants/44/LVR/LVR.sol", + "op": "LVR", + "orig": "1", + "original": "LVR/LVR.sol", + "repl": "0" + }, + { + "col": 26, + "description": "LiteralValueReplacement", + "diff": "--- original\n+++ mutant\n@@ -29,8 +29,9 @@\n }\n \n // Expect 2 mutants: -1, 0\n+ /// LiteralValueReplacement(`1` |==> `-1`) of: `int256 pos_one = 1;`\n function signed_pos_one() public pure returns (int256) {\n- int256 pos_one = 1;\n+ int256 pos_one = -1;\n return pos_one;\n }\n \n", + "id": "45", + "line": 33, + "name": "mutants/45/LVR/LVR.sol", + "op": "LVR", + "orig": "1", + "original": "LVR/LVR.sol", + "repl": "-1" + }, + { + "col": 26, + "description": "LiteralValueReplacement", + "diff": "--- original\n+++ mutant\n@@ -29,8 +29,9 @@\n }\n \n // Expect 2 mutants: -1, 0\n+ /// LiteralValueReplacement(`1` |==> `2`) of: `int256 pos_one = 1;`\n function signed_pos_one() public pure returns (int256) {\n- int256 pos_one = 1;\n+ int256 pos_one = 2;\n return pos_one;\n }\n \n", + "id": "46", + "line": 33, + "name": "mutants/46/LVR/LVR.sol", + "op": "LVR", + "orig": "1", + "original": "LVR/LVR.sol", + "repl": "2" + }, + { + "col": 23, + "description": "LiteralValueReplacement", + "diff": "--- original\n+++ mutant\n@@ -35,8 +35,9 @@\n }\n \n // Expect 2 mutants: -1, 1\n+ /// LiteralValueReplacement(`0` |==> `-1`) of: `int256 zero = 0;`\n function signed_zero() public pure returns (int256) {\n- int256 zero = 0;\n+ int256 zero = -1;\n return zero;\n }\n }\n", + "id": "47", + "line": 39, + "name": "mutants/47/LVR/LVR.sol", + "op": "LVR", + "orig": "0", + "original": "LVR/LVR.sol", + "repl": "-1" + }, + { + "col": 23, + "description": "LiteralValueReplacement", + "diff": "--- original\n+++ mutant\n@@ -35,8 +35,9 @@\n }\n \n // Expect 2 mutants: -1, 1\n+ /// LiteralValueReplacement(`0` |==> `1`) of: `int256 zero = 0;`\n function signed_zero() public pure returns (int256) {\n- int256 zero = 0;\n+ int256 zero = 1;\n return zero;\n }\n }\n", + "id": "48", + "line": 39, + "name": "mutants/48/LVR/LVR.sol", + "op": "LVR", + "orig": "0", + "original": "LVR/LVR.sol", + "repl": "1" + }, + { + "col": 18, + "description": "RelationalOperatorReplacement", + "diff": "--- original\n+++ mutant\n@@ -5,8 +5,9 @@\n // This contract provides test functions for relational operator replacement (ROR)\n contract ROR {\n // Expect 3 mutants: x <= y, x != y, false\n+ /// RelationalOperatorReplacement(`<` |==> `<=`) of: `return x < y;`\n function less(uint256 x, uint256 y) public pure returns (bool) {\n- return x < y;\n+ return x <= y;\n }\n \n // Expect 3 mutants: x < y, x == y, true\n", + "id": "49", + "line": 9, + "name": "mutants/49/ROR/ROR.sol", + "op": "ROR", + "orig": "<", + "original": "ROR/ROR.sol", + "repl": "<=" + }, + { + "col": 18, + "description": "RelationalOperatorReplacement", + "diff": "--- original\n+++ mutant\n@@ -5,8 +5,9 @@\n // This contract provides test functions for relational operator replacement (ROR)\n contract ROR {\n // Expect 3 mutants: x <= y, x != y, false\n+ /// RelationalOperatorReplacement(`<` |==> `!=`) of: `return x < y;`\n function less(uint256 x, uint256 y) public pure returns (bool) {\n- return x < y;\n+ return x != y;\n }\n \n // Expect 3 mutants: x < y, x == y, true\n", + "id": "50", + "line": 9, + "name": "mutants/50/ROR/ROR.sol", + "op": "ROR", + "orig": "<", + "original": "ROR/ROR.sol", + "repl": "!=" + }, + { + "col": 16, + "description": "RelationalOperatorReplacement", + "diff": "--- original\n+++ mutant\n@@ -5,8 +5,9 @@\n // This contract provides test functions for relational operator replacement (ROR)\n contract ROR {\n // Expect 3 mutants: x <= y, x != y, false\n+ /// RelationalOperatorReplacement(`x < y` |==> `false`) of: `return x < y;`\n function less(uint256 x, uint256 y) public pure returns (bool) {\n- return x < y;\n+ return false;\n }\n \n // Expect 3 mutants: x < y, x == y, true\n", + "id": "51", + "line": 9, + "name": "mutants/51/ROR/ROR.sol", + "op": "ROR", + "orig": "x < y", + "original": "ROR/ROR.sol", + "repl": "false" + }, + { + "col": 18, + "description": "RelationalOperatorReplacement", + "diff": "--- original\n+++ mutant\n@@ -10,8 +10,9 @@\n }\n \n // Expect 3 mutants: x < y, x == y, true\n+ /// RelationalOperatorReplacement(`<=` |==> `<`) of: `return x <= y;`\n function less_equal(uint256 x, uint256 y) public pure returns (bool) {\n- return x <= y;\n+ return x < y;\n }\n \n // Expect 3 mutants: x >= y, x != y, false\n", + "id": "52", + "line": 14, + "name": "mutants/52/ROR/ROR.sol", + "op": "ROR", + "orig": "<=", + "original": "ROR/ROR.sol", + "repl": "<" + }, + { + "col": 18, + "description": "RelationalOperatorReplacement", + "diff": "--- original\n+++ mutant\n@@ -10,8 +10,9 @@\n }\n \n // Expect 3 mutants: x < y, x == y, true\n+ /// RelationalOperatorReplacement(`<=` |==> `==`) of: `return x <= y;`\n function less_equal(uint256 x, uint256 y) public pure returns (bool) {\n- return x <= y;\n+ return x == y;\n }\n \n // Expect 3 mutants: x >= y, x != y, false\n", + "id": "53", + "line": 14, + "name": "mutants/53/ROR/ROR.sol", + "op": "ROR", + "orig": "<=", + "original": "ROR/ROR.sol", + "repl": "==" + }, + { + "col": 16, + "description": "RelationalOperatorReplacement", + "diff": "--- original\n+++ mutant\n@@ -10,8 +10,9 @@\n }\n \n // Expect 3 mutants: x < y, x == y, true\n+ /// RelationalOperatorReplacement(`x <= y` |==> `true`) of: `return x <= y;`\n function less_equal(uint256 x, uint256 y) public pure returns (bool) {\n- return x <= y;\n+ return true;\n }\n \n // Expect 3 mutants: x >= y, x != y, false\n", + "id": "54", + "line": 14, + "name": "mutants/54/ROR/ROR.sol", + "op": "ROR", + "orig": "x <= y", + "original": "ROR/ROR.sol", + "repl": "true" + }, + { + "col": 18, + "description": "RelationalOperatorReplacement", + "diff": "--- original\n+++ mutant\n@@ -15,8 +15,9 @@\n }\n \n // Expect 3 mutants: x >= y, x != y, false\n+ /// RelationalOperatorReplacement(`>` |==> `>=`) of: `return x > y;`\n function more(uint256 x, uint256 y) public pure returns (bool) {\n- return x > y;\n+ return x >= y;\n }\n \n // Expect 3 mutants: x > y, x == y, true\n", + "id": "55", + "line": 19, + "name": "mutants/55/ROR/ROR.sol", + "op": "ROR", + "orig": ">", + "original": "ROR/ROR.sol", + "repl": ">=" + }, + { + "col": 18, + "description": "RelationalOperatorReplacement", + "diff": "--- original\n+++ mutant\n@@ -15,8 +15,9 @@\n }\n \n // Expect 3 mutants: x >= y, x != y, false\n+ /// RelationalOperatorReplacement(`>` |==> `!=`) of: `return x > y;`\n function more(uint256 x, uint256 y) public pure returns (bool) {\n- return x > y;\n+ return x != y;\n }\n \n // Expect 3 mutants: x > y, x == y, true\n", + "id": "56", + "line": 19, + "name": "mutants/56/ROR/ROR.sol", + "op": "ROR", + "orig": ">", + "original": "ROR/ROR.sol", + "repl": "!=" + }, + { + "col": 16, + "description": "RelationalOperatorReplacement", + "diff": "--- original\n+++ mutant\n@@ -15,8 +15,9 @@\n }\n \n // Expect 3 mutants: x >= y, x != y, false\n+ /// RelationalOperatorReplacement(`x > y` |==> `false`) of: `return x > y;`\n function more(uint256 x, uint256 y) public pure returns (bool) {\n- return x > y;\n+ return false;\n }\n \n // Expect 3 mutants: x > y, x == y, true\n", + "id": "57", + "line": 19, + "name": "mutants/57/ROR/ROR.sol", + "op": "ROR", + "orig": "x > y", + "original": "ROR/ROR.sol", + "repl": "false" + }, + { + "col": 18, + "description": "RelationalOperatorReplacement", + "diff": "--- original\n+++ mutant\n@@ -20,8 +20,9 @@\n }\n \n // Expect 3 mutants: x > y, x == y, true\n+ /// RelationalOperatorReplacement(`>=` |==> `>`) of: `return x >= y;`\n function more_equal(uint256 x, uint256 y) public pure returns (bool) {\n- return x >= y;\n+ return x > y;\n }\n \n // Expect 3 mutants: x >= y, x <= y, false\n", + "id": "58", + "line": 24, + "name": "mutants/58/ROR/ROR.sol", + "op": "ROR", + "orig": ">=", + "original": "ROR/ROR.sol", + "repl": ">" + }, + { + "col": 18, + "description": "RelationalOperatorReplacement", + "diff": "--- original\n+++ mutant\n@@ -20,8 +20,9 @@\n }\n \n // Expect 3 mutants: x > y, x == y, true\n+ /// RelationalOperatorReplacement(`>=` |==> `==`) of: `return x >= y;`\n function more_equal(uint256 x, uint256 y) public pure returns (bool) {\n- return x >= y;\n+ return x == y;\n }\n \n // Expect 3 mutants: x >= y, x <= y, false\n", + "id": "59", + "line": 24, + "name": "mutants/59/ROR/ROR.sol", + "op": "ROR", + "orig": ">=", + "original": "ROR/ROR.sol", + "repl": "==" + }, + { + "col": 16, + "description": "RelationalOperatorReplacement", + "diff": "--- original\n+++ mutant\n@@ -20,8 +20,9 @@\n }\n \n // Expect 3 mutants: x > y, x == y, true\n+ /// RelationalOperatorReplacement(`x >= y` |==> `true`) of: `return x >= y;`\n function more_equal(uint256 x, uint256 y) public pure returns (bool) {\n- return x >= y;\n+ return true;\n }\n \n // Expect 3 mutants: x >= y, x <= y, false\n", + "id": "60", + "line": 24, + "name": "mutants/60/ROR/ROR.sol", + "op": "ROR", + "orig": "x >= y", + "original": "ROR/ROR.sol", + "repl": "true" + }, + { + "col": 18, + "description": "RelationalOperatorReplacement", + "diff": "--- original\n+++ mutant\n@@ -25,8 +25,9 @@\n }\n \n // Expect 3 mutants: x >= y, x <= y, false\n+ /// RelationalOperatorReplacement(`==` |==> `<=`) of: `return x == y;`\n function equal_ord(uint256 x, uint256 y) public pure returns (bool) {\n- return x == y;\n+ return x <= y;\n }\n \n // Expect 2 mutants: true, false\n", + "id": "61", + "line": 29, + "name": "mutants/61/ROR/ROR.sol", + "op": "ROR", + "orig": "==", + "original": "ROR/ROR.sol", + "repl": "<=" + }, + { + "col": 18, + "description": "RelationalOperatorReplacement", + "diff": "--- original\n+++ mutant\n@@ -25,8 +25,9 @@\n }\n \n // Expect 3 mutants: x >= y, x <= y, false\n+ /// RelationalOperatorReplacement(`==` |==> `>=`) of: `return x == y;`\n function equal_ord(uint256 x, uint256 y) public pure returns (bool) {\n- return x == y;\n+ return x >= y;\n }\n \n // Expect 2 mutants: true, false\n", + "id": "62", + "line": 29, + "name": "mutants/62/ROR/ROR.sol", + "op": "ROR", + "orig": "==", + "original": "ROR/ROR.sol", + "repl": ">=" + }, + { + "col": 16, + "description": "RelationalOperatorReplacement", + "diff": "--- original\n+++ mutant\n@@ -25,8 +25,9 @@\n }\n \n // Expect 3 mutants: x >= y, x <= y, false\n+ /// RelationalOperatorReplacement(`x == y` |==> `false`) of: `return x == y;`\n function equal_ord(uint256 x, uint256 y) public pure returns (bool) {\n- return x == y;\n+ return false;\n }\n \n // Expect 2 mutants: true, false\n", + "id": "63", + "line": 29, + "name": "mutants/63/ROR/ROR.sol", + "op": "ROR", + "orig": "x == y", + "original": "ROR/ROR.sol", + "repl": "false" + }, + { + "col": 16, + "description": "RelationalOperatorReplacement", + "diff": "--- original\n+++ mutant\n@@ -30,8 +30,9 @@\n }\n \n // Expect 2 mutants: true, false\n+ /// RelationalOperatorReplacement(`x == y` |==> `false`) of: `return x == y;`\n function equal_not_ord(bool x, bool y) public pure returns (bool) {\n- return x == y;\n+ return false;\n }\n \n // Expect 3 mutants: x > y, x < y, true\n", + "id": "64", + "line": 34, + "name": "mutants/64/ROR/ROR.sol", + "op": "ROR", + "orig": "x == y", + "original": "ROR/ROR.sol", + "repl": "false" + }, + { + "col": 18, + "description": "RelationalOperatorReplacement", + "diff": "--- original\n+++ mutant\n@@ -35,8 +35,9 @@\n }\n \n // Expect 3 mutants: x > y, x < y, true\n+ /// RelationalOperatorReplacement(`!=` |==> `<`) of: `return x != y;`\n function not_equal_ord(uint256 x, uint256 y) public pure returns (bool) {\n- return x != y;\n+ return x < y;\n }\n \n // Expect 2 mutants: true, false\n", + "id": "65", + "line": 39, + "name": "mutants/65/ROR/ROR.sol", + "op": "ROR", + "orig": "!=", + "original": "ROR/ROR.sol", + "repl": "<" + }, + { + "col": 18, + "description": "RelationalOperatorReplacement", + "diff": "--- original\n+++ mutant\n@@ -35,8 +35,9 @@\n }\n \n // Expect 3 mutants: x > y, x < y, true\n+ /// RelationalOperatorReplacement(`!=` |==> `>`) of: `return x != y;`\n function not_equal_ord(uint256 x, uint256 y) public pure returns (bool) {\n- return x != y;\n+ return x > y;\n }\n \n // Expect 2 mutants: true, false\n", + "id": "66", + "line": 39, + "name": "mutants/66/ROR/ROR.sol", + "op": "ROR", + "orig": "!=", + "original": "ROR/ROR.sol", + "repl": ">" + }, + { + "col": 16, + "description": "RelationalOperatorReplacement", + "diff": "--- original\n+++ mutant\n@@ -35,8 +35,9 @@\n }\n \n // Expect 3 mutants: x > y, x < y, true\n+ /// RelationalOperatorReplacement(`x != y` |==> `true`) of: `return x != y;`\n function not_equal_ord(uint256 x, uint256 y) public pure returns (bool) {\n- return x != y;\n+ return true;\n }\n \n // Expect 2 mutants: true, false\n", + "id": "67", + "line": 39, + "name": "mutants/67/ROR/ROR.sol", + "op": "ROR", + "orig": "x != y", + "original": "ROR/ROR.sol", + "repl": "true" + }, + { + "col": 16, + "description": "RelationalOperatorReplacement", + "diff": "--- original\n+++ mutant\n@@ -40,8 +40,9 @@\n }\n \n // Expect 2 mutants: true, false\n+ /// RelationalOperatorReplacement(`x != y` |==> `true`) of: `return x != y;`\n function not_equal_not_ord(bool x, bool y) public pure returns (bool) {\n- return x != y;\n+ return true;\n }\n \n // Expect 3 mutants: (x + y) > z, (x + y) == z, true\n", + "id": "68", + "line": 44, + "name": "mutants/68/ROR/ROR.sol", + "op": "ROR", + "orig": "x != y", + "original": "ROR/ROR.sol", + "repl": "true" + }, + { + "col": 24, + "description": "RelationalOperatorReplacement", + "diff": "--- original\n+++ mutant\n@@ -49,8 +49,9 @@\n uint256 x,\n uint256 y,\n uint256 z\n+ /// RelationalOperatorReplacement(`>=` |==> `>`) of: `return (x + y) >= z;`\n ) public pure returns (bool) {\n- return (x + y) >= z;\n+ return (x + y) > z;\n }\n \n // Expect 3 mutants: (x + y) > z, (x + y) < z, true\n", + "id": "69", + "line": 53, + "name": "mutants/69/ROR/ROR.sol", + "op": "ROR", + "orig": ">=", + "original": "ROR/ROR.sol", + "repl": ">" + }, + { + "col": 24, + "description": "RelationalOperatorReplacement", + "diff": "--- original\n+++ mutant\n@@ -49,8 +49,9 @@\n uint256 x,\n uint256 y,\n uint256 z\n+ /// RelationalOperatorReplacement(`>=` |==> `==`) of: `return (x + y) >= z;`\n ) public pure returns (bool) {\n- return (x + y) >= z;\n+ return (x + y) == z;\n }\n \n // Expect 3 mutants: (x + y) > z, (x + y) < z, true\n", + "id": "70", + "line": 53, + "name": "mutants/70/ROR/ROR.sol", + "op": "ROR", + "orig": ">=", + "original": "ROR/ROR.sol", + "repl": "==" + }, + { + "col": 16, + "description": "RelationalOperatorReplacement", + "diff": "--- original\n+++ mutant\n@@ -49,8 +49,9 @@\n uint256 x,\n uint256 y,\n uint256 z\n+ /// RelationalOperatorReplacement(`(x + y) >= z` |==> `true`) of: `return (x + y) >= z;`\n ) public pure returns (bool) {\n- return (x + y) >= z;\n+ return true;\n }\n \n // Expect 3 mutants: (x + y) > z, (x + y) < z, true\n", + "id": "71", + "line": 53, + "name": "mutants/71/ROR/ROR.sol", + "op": "ROR", + "orig": "(x + y) >= z", + "original": "ROR/ROR.sol", + "repl": "true" + }, + { + "col": 24, + "description": "RelationalOperatorReplacement", + "diff": "--- original\n+++ mutant\n@@ -58,7 +58,8 @@\n uint256 x,\n uint256 y,\n uint256 z\n+ /// RelationalOperatorReplacement(`!=` |==> `<`) of: `return (x + y) != z;`\n ) public pure returns (bool) {\n- return (x + y) != z;\n+ return (x + y) < z;\n }\n }\n", + "id": "72", + "line": 62, + "name": "mutants/72/ROR/ROR.sol", + "op": "ROR", + "orig": "!=", + "original": "ROR/ROR.sol", + "repl": "<" + }, + { + "col": 24, + "description": "RelationalOperatorReplacement", + "diff": "--- original\n+++ mutant\n@@ -58,7 +58,8 @@\n uint256 x,\n uint256 y,\n uint256 z\n+ /// RelationalOperatorReplacement(`!=` |==> `>`) of: `return (x + y) != z;`\n ) public pure returns (bool) {\n- return (x + y) != z;\n+ return (x + y) > z;\n }\n }\n", + "id": "73", + "line": 62, + "name": "mutants/73/ROR/ROR.sol", + "op": "ROR", + "orig": "!=", + "original": "ROR/ROR.sol", + "repl": ">" + }, + { + "col": 16, + "description": "RelationalOperatorReplacement", + "diff": "--- original\n+++ mutant\n@@ -58,7 +58,8 @@\n uint256 x,\n uint256 y,\n uint256 z\n+ /// RelationalOperatorReplacement(`(x + y) != z` |==> `true`) of: `return (x + y) != z;`\n ) public pure returns (bool) {\n- return (x + y) != z;\n+ return true;\n }\n }\n", + "id": "74", + "line": 62, + "name": "mutants/74/ROR/ROR.sol", + "op": "ROR", + "orig": "(x + y) != z", + "original": "ROR/ROR.sol", + "repl": "true" + }, + { + "col": 16, + "description": "UnaryOperatorReplacement", + "diff": "--- original\n+++ mutant\n@@ -10,8 +10,9 @@\n }\n \n // Expect a single mutant: -x\n+ /// UnaryOperatorReplacement(`~` |==> `-`) of: `return ~x;`\n function signed_bw_not(int256 x) public pure returns (int256) {\n- return ~x;\n+ return -x;\n }\n \n // Expect a single mutant: ~x\n", + "id": "75", + "line": 14, + "name": "mutants/75/UOR/UOR.sol", + "op": "UOR", + "orig": "~", + "original": "UOR/UOR.sol", + "repl": "-" + }, + { + "col": 16, + "description": "UnaryOperatorReplacement", + "diff": "--- original\n+++ mutant\n@@ -15,7 +15,8 @@\n }\n \n // Expect a single mutant: ~x\n+ /// UnaryOperatorReplacement(`-` |==> `~`) of: `return -x;`\n function signed_neg(int256 x) public pure returns (int256) {\n- return -x;\n+ return ~x;\n }\n }\n", + "id": "76", + "line": 19, + "name": "mutants/76/UOR/UOR.sol", + "op": "UOR", + "orig": "-", + "original": "UOR/UOR.sol", + "repl": "~" + } +] \ No newline at end of file diff --git a/resources/regressions/test_log_invalid.json/invalid.log b/resources/regressions/test_log_invalid.json/invalid.log new file mode 100644 index 0000000..c9994f0 --- /dev/null +++ b/resources/regressions/test_log_invalid.json/invalid.log @@ -0,0 +1 @@ +1,UOR,UOR/UOR.sol,8:15,~,- diff --git a/resources/regressions/test_log_invalid.json/mutants.log b/resources/regressions/test_log_invalid.json/mutants.log new file mode 100644 index 0000000..e3828c3 --- /dev/null +++ b/resources/regressions/test_log_invalid.json/mutants.log @@ -0,0 +1,76 @@ +1,AOR,AOR/AOR.sol,13:18,+,- +2,AOR,AOR/AOR.sol,13:18,+,* +3,AOR,AOR/AOR.sol,13:18,+,/ +4,AOR,AOR/AOR.sol,13:18,+,% +5,AOR,AOR/AOR.sol,22:18,-,+ +6,AOR,AOR/AOR.sol,22:18,-,* +7,AOR,AOR/AOR.sol,22:18,-,/ +8,AOR,AOR/AOR.sol,22:18,-,% +9,AOR,AOR/AOR.sol,34:22,*,+ +10,AOR,AOR/AOR.sol,34:22,*,- +11,AOR,AOR/AOR.sol,34:22,*,/ +12,AOR,AOR/AOR.sol,34:22,*,% +13,AOR,AOR/AOR.sol,47:22,*,+ +14,AOR,AOR/AOR.sol,47:22,*,- +15,AOR,AOR/AOR.sol,47:22,*,/ +16,AOR,AOR/AOR.sol,47:22,*,** +17,AOR,AOR/AOR.sol,47:22,*,% +18,AOR,AOR/AOR.sol,58:18,**,+ +19,AOR,AOR/AOR.sol,58:18,**,- +20,AOR,AOR/AOR.sol,58:18,**,* +21,AOR,AOR/AOR.sol,58:18,**,/ +22,AOR,AOR/AOR.sol,58:18,**,% +23,BOR,BOR/BOR.sol,10:18,|,& +24,BOR,BOR/BOR.sol,16:18,&,| +25,BOR,BOR/BOR.sol,22:18,^,& +26,EDC,EDC/EDC.sol,16:38,delegatecall,call +27,LOR,LOR/LOR.sol,9:16,a && b,a +28,LOR,LOR/LOR.sol,9:16,a && b,b +29,LOR,LOR/LOR.sol,9:16,a && b,false +30,LOR,LOR/LOR.sol,14:16,a || b,a +31,LOR,LOR/LOR.sol,14:16,a || b,b +32,LOR,LOR/LOR.sol,14:16,a || b,true +33,LOR,LOR/LOR.sol,19:16,(x < y) || (a != (x >= y)),x < y +34,LOR,LOR/LOR.sol,19:16,(x < y) || (a != (x >= y)),a != (x >= y) +35,LOR,LOR/LOR.sol,19:16,(x < y) || (a != (x >= y)),true +36,LOR,LOR/LOR.sol,23:16,!a,true +37,LOR,LOR/LOR.sol,23:16,!a,false +38,LVR,LVR/LVR.sol,15:24,0,1 +39,LVR,LVR/LVR.sol,21:23,1,0 +40,LVR,LVR/LVR.sol,21:23,1,2 +41,LVR,LVR/LVR.sol,27:26,-1,0 +42,LVR,LVR/LVR.sol,27:26,-1,1 +43,LVR,LVR/LVR.sol,27:26,-1,-2 +44,LVR,LVR/LVR.sol,33:26,1,0 +45,LVR,LVR/LVR.sol,33:26,1,-1 +46,LVR,LVR/LVR.sol,33:26,1,2 +47,LVR,LVR/LVR.sol,39:23,0,-1 +48,LVR,LVR/LVR.sol,39:23,0,1 +49,ROR,ROR/ROR.sol,9:18,<,<= +50,ROR,ROR/ROR.sol,9:18,<,!= +51,ROR,ROR/ROR.sol,9:16,x < y,false +52,ROR,ROR/ROR.sol,14:18,<=,< +53,ROR,ROR/ROR.sol,14:18,<=,== +54,ROR,ROR/ROR.sol,14:16,x <= y,true +55,ROR,ROR/ROR.sol,19:18,>,>= +56,ROR,ROR/ROR.sol,19:18,>,!= +57,ROR,ROR/ROR.sol,19:16,x > y,false +58,ROR,ROR/ROR.sol,24:18,>=,> +59,ROR,ROR/ROR.sol,24:18,>=,== +60,ROR,ROR/ROR.sol,24:16,x >= y,true +61,ROR,ROR/ROR.sol,29:18,==,<= +62,ROR,ROR/ROR.sol,29:18,==,>= +63,ROR,ROR/ROR.sol,29:16,x == y,false +64,ROR,ROR/ROR.sol,34:16,x == y,false +65,ROR,ROR/ROR.sol,39:18,!=,< +66,ROR,ROR/ROR.sol,39:18,!=,> +67,ROR,ROR/ROR.sol,39:16,x != y,true +68,ROR,ROR/ROR.sol,44:16,x != y,true +69,ROR,ROR/ROR.sol,53:24,>=,> +70,ROR,ROR/ROR.sol,53:24,>=,== +71,ROR,ROR/ROR.sol,53:16,(x + y) >= z,true +72,ROR,ROR/ROR.sol,62:24,!=,< +73,ROR,ROR/ROR.sol,62:24,!=,> +74,ROR,ROR/ROR.sol,62:16,(x + y) != z,true +75,UOR,UOR/UOR.sol,14:16,~,- +76,UOR,UOR/UOR.sol,19:16,-,~ diff --git a/resources/regressions/test_log_invalid.json/mutants/1/AOR/AOR.sol b/resources/regressions/test_log_invalid.json/mutants/1/AOR/AOR.sol new file mode 100644 index 0000000..9b516ff --- /dev/null +++ b/resources/regressions/test_log_invalid.json/mutants/1/AOR/AOR.sol @@ -0,0 +1,61 @@ +// SPDX-License-Identifier: GPL-3.0-only +pragma solidity >0.7.0; +pragma experimental ABIEncoderV2; + +// This contract provides test functions for Arithmetic operator replacement +contract AOR { + // Expect 4 mutants: + // a - b + // a * b + // a / b + // a % b + /// ArithmeticOperatorReplacement(`+` |==> `-`) of: `return a + b;` + function plus(int256 a, int256 b) public pure returns (int256) { + return a - b; + } + + // Expect 4 mutants: + // a + b + // a * b + // a / b + // a % b + function minus(int256 a, int256 b) public pure returns (int256) { + return a - b; + } + + // Expect 4 mutants: + // a - b + // a * b + // a / b + // a % b + function times_with_parens( + int256 a, + int256 b + ) public pure returns (int256) { + return ((a)) * b; + } + + // Expect 5 mutants: + // a + b + // a - b + // a / b + // a ** b + // a % b + function unsigned_times_with_parens( + uint256 a, + uint256 b + ) public pure returns (uint256) { + return ((a)) * b; + } + + // Expect 5 mutants: + // a + b + // a - b + // a / b + // a * b + // a % b + + function power(uint256 a, uint256 b) public pure returns (uint256) { + return a ** b; + } +} diff --git a/resources/regressions/test_log_invalid.json/mutants/10/AOR/AOR.sol b/resources/regressions/test_log_invalid.json/mutants/10/AOR/AOR.sol new file mode 100644 index 0000000..c31b43f --- /dev/null +++ b/resources/regressions/test_log_invalid.json/mutants/10/AOR/AOR.sol @@ -0,0 +1,61 @@ +// SPDX-License-Identifier: GPL-3.0-only +pragma solidity >0.7.0; +pragma experimental ABIEncoderV2; + +// This contract provides test functions for Arithmetic operator replacement +contract AOR { + // Expect 4 mutants: + // a - b + // a * b + // a / b + // a % b + function plus(int256 a, int256 b) public pure returns (int256) { + return a + b; + } + + // Expect 4 mutants: + // a + b + // a * b + // a / b + // a % b + function minus(int256 a, int256 b) public pure returns (int256) { + return a - b; + } + + // Expect 4 mutants: + // a - b + // a * b + // a / b + // a % b + function times_with_parens( + int256 a, + int256 b + /// ArithmeticOperatorReplacement(`*` |==> `-`) of: `return ((a)) * b;` + ) public pure returns (int256) { + return ((a)) - b; + } + + // Expect 5 mutants: + // a + b + // a - b + // a / b + // a ** b + // a % b + function unsigned_times_with_parens( + uint256 a, + uint256 b + ) public pure returns (uint256) { + return ((a)) * b; + } + + // Expect 5 mutants: + // a + b + // a - b + // a / b + // a * b + // a % b + + function power(uint256 a, uint256 b) public pure returns (uint256) { + return a ** b; + } +} diff --git a/resources/regressions/test_log_invalid.json/mutants/11/AOR/AOR.sol b/resources/regressions/test_log_invalid.json/mutants/11/AOR/AOR.sol new file mode 100644 index 0000000..823139e --- /dev/null +++ b/resources/regressions/test_log_invalid.json/mutants/11/AOR/AOR.sol @@ -0,0 +1,61 @@ +// SPDX-License-Identifier: GPL-3.0-only +pragma solidity >0.7.0; +pragma experimental ABIEncoderV2; + +// This contract provides test functions for Arithmetic operator replacement +contract AOR { + // Expect 4 mutants: + // a - b + // a * b + // a / b + // a % b + function plus(int256 a, int256 b) public pure returns (int256) { + return a + b; + } + + // Expect 4 mutants: + // a + b + // a * b + // a / b + // a % b + function minus(int256 a, int256 b) public pure returns (int256) { + return a - b; + } + + // Expect 4 mutants: + // a - b + // a * b + // a / b + // a % b + function times_with_parens( + int256 a, + int256 b + /// ArithmeticOperatorReplacement(`*` |==> `/`) of: `return ((a)) * b;` + ) public pure returns (int256) { + return ((a)) / b; + } + + // Expect 5 mutants: + // a + b + // a - b + // a / b + // a ** b + // a % b + function unsigned_times_with_parens( + uint256 a, + uint256 b + ) public pure returns (uint256) { + return ((a)) * b; + } + + // Expect 5 mutants: + // a + b + // a - b + // a / b + // a * b + // a % b + + function power(uint256 a, uint256 b) public pure returns (uint256) { + return a ** b; + } +} diff --git a/resources/regressions/test_log_invalid.json/mutants/12/AOR/AOR.sol b/resources/regressions/test_log_invalid.json/mutants/12/AOR/AOR.sol new file mode 100644 index 0000000..aa4ecd0 --- /dev/null +++ b/resources/regressions/test_log_invalid.json/mutants/12/AOR/AOR.sol @@ -0,0 +1,61 @@ +// SPDX-License-Identifier: GPL-3.0-only +pragma solidity >0.7.0; +pragma experimental ABIEncoderV2; + +// This contract provides test functions for Arithmetic operator replacement +contract AOR { + // Expect 4 mutants: + // a - b + // a * b + // a / b + // a % b + function plus(int256 a, int256 b) public pure returns (int256) { + return a + b; + } + + // Expect 4 mutants: + // a + b + // a * b + // a / b + // a % b + function minus(int256 a, int256 b) public pure returns (int256) { + return a - b; + } + + // Expect 4 mutants: + // a - b + // a * b + // a / b + // a % b + function times_with_parens( + int256 a, + int256 b + /// ArithmeticOperatorReplacement(`*` |==> `%`) of: `return ((a)) * b;` + ) public pure returns (int256) { + return ((a)) % b; + } + + // Expect 5 mutants: + // a + b + // a - b + // a / b + // a ** b + // a % b + function unsigned_times_with_parens( + uint256 a, + uint256 b + ) public pure returns (uint256) { + return ((a)) * b; + } + + // Expect 5 mutants: + // a + b + // a - b + // a / b + // a * b + // a % b + + function power(uint256 a, uint256 b) public pure returns (uint256) { + return a ** b; + } +} diff --git a/resources/regressions/test_log_invalid.json/mutants/13/AOR/AOR.sol b/resources/regressions/test_log_invalid.json/mutants/13/AOR/AOR.sol new file mode 100644 index 0000000..8666cef --- /dev/null +++ b/resources/regressions/test_log_invalid.json/mutants/13/AOR/AOR.sol @@ -0,0 +1,61 @@ +// SPDX-License-Identifier: GPL-3.0-only +pragma solidity >0.7.0; +pragma experimental ABIEncoderV2; + +// This contract provides test functions for Arithmetic operator replacement +contract AOR { + // Expect 4 mutants: + // a - b + // a * b + // a / b + // a % b + function plus(int256 a, int256 b) public pure returns (int256) { + return a + b; + } + + // Expect 4 mutants: + // a + b + // a * b + // a / b + // a % b + function minus(int256 a, int256 b) public pure returns (int256) { + return a - b; + } + + // Expect 4 mutants: + // a - b + // a * b + // a / b + // a % b + function times_with_parens( + int256 a, + int256 b + ) public pure returns (int256) { + return ((a)) * b; + } + + // Expect 5 mutants: + // a + b + // a - b + // a / b + // a ** b + // a % b + function unsigned_times_with_parens( + uint256 a, + uint256 b + /// ArithmeticOperatorReplacement(`*` |==> `+`) of: `return ((a)) * b;` + ) public pure returns (uint256) { + return ((a)) + b; + } + + // Expect 5 mutants: + // a + b + // a - b + // a / b + // a * b + // a % b + + function power(uint256 a, uint256 b) public pure returns (uint256) { + return a ** b; + } +} diff --git a/resources/regressions/test_log_invalid.json/mutants/14/AOR/AOR.sol b/resources/regressions/test_log_invalid.json/mutants/14/AOR/AOR.sol new file mode 100644 index 0000000..4d3c74d --- /dev/null +++ b/resources/regressions/test_log_invalid.json/mutants/14/AOR/AOR.sol @@ -0,0 +1,61 @@ +// SPDX-License-Identifier: GPL-3.0-only +pragma solidity >0.7.0; +pragma experimental ABIEncoderV2; + +// This contract provides test functions for Arithmetic operator replacement +contract AOR { + // Expect 4 mutants: + // a - b + // a * b + // a / b + // a % b + function plus(int256 a, int256 b) public pure returns (int256) { + return a + b; + } + + // Expect 4 mutants: + // a + b + // a * b + // a / b + // a % b + function minus(int256 a, int256 b) public pure returns (int256) { + return a - b; + } + + // Expect 4 mutants: + // a - b + // a * b + // a / b + // a % b + function times_with_parens( + int256 a, + int256 b + ) public pure returns (int256) { + return ((a)) * b; + } + + // Expect 5 mutants: + // a + b + // a - b + // a / b + // a ** b + // a % b + function unsigned_times_with_parens( + uint256 a, + uint256 b + /// ArithmeticOperatorReplacement(`*` |==> `-`) of: `return ((a)) * b;` + ) public pure returns (uint256) { + return ((a)) - b; + } + + // Expect 5 mutants: + // a + b + // a - b + // a / b + // a * b + // a % b + + function power(uint256 a, uint256 b) public pure returns (uint256) { + return a ** b; + } +} diff --git a/resources/regressions/test_log_invalid.json/mutants/15/AOR/AOR.sol b/resources/regressions/test_log_invalid.json/mutants/15/AOR/AOR.sol new file mode 100644 index 0000000..f9a4969 --- /dev/null +++ b/resources/regressions/test_log_invalid.json/mutants/15/AOR/AOR.sol @@ -0,0 +1,61 @@ +// SPDX-License-Identifier: GPL-3.0-only +pragma solidity >0.7.0; +pragma experimental ABIEncoderV2; + +// This contract provides test functions for Arithmetic operator replacement +contract AOR { + // Expect 4 mutants: + // a - b + // a * b + // a / b + // a % b + function plus(int256 a, int256 b) public pure returns (int256) { + return a + b; + } + + // Expect 4 mutants: + // a + b + // a * b + // a / b + // a % b + function minus(int256 a, int256 b) public pure returns (int256) { + return a - b; + } + + // Expect 4 mutants: + // a - b + // a * b + // a / b + // a % b + function times_with_parens( + int256 a, + int256 b + ) public pure returns (int256) { + return ((a)) * b; + } + + // Expect 5 mutants: + // a + b + // a - b + // a / b + // a ** b + // a % b + function unsigned_times_with_parens( + uint256 a, + uint256 b + /// ArithmeticOperatorReplacement(`*` |==> `/`) of: `return ((a)) * b;` + ) public pure returns (uint256) { + return ((a)) / b; + } + + // Expect 5 mutants: + // a + b + // a - b + // a / b + // a * b + // a % b + + function power(uint256 a, uint256 b) public pure returns (uint256) { + return a ** b; + } +} diff --git a/resources/regressions/test_log_invalid.json/mutants/16/AOR/AOR.sol b/resources/regressions/test_log_invalid.json/mutants/16/AOR/AOR.sol new file mode 100644 index 0000000..3706f5c --- /dev/null +++ b/resources/regressions/test_log_invalid.json/mutants/16/AOR/AOR.sol @@ -0,0 +1,61 @@ +// SPDX-License-Identifier: GPL-3.0-only +pragma solidity >0.7.0; +pragma experimental ABIEncoderV2; + +// This contract provides test functions for Arithmetic operator replacement +contract AOR { + // Expect 4 mutants: + // a - b + // a * b + // a / b + // a % b + function plus(int256 a, int256 b) public pure returns (int256) { + return a + b; + } + + // Expect 4 mutants: + // a + b + // a * b + // a / b + // a % b + function minus(int256 a, int256 b) public pure returns (int256) { + return a - b; + } + + // Expect 4 mutants: + // a - b + // a * b + // a / b + // a % b + function times_with_parens( + int256 a, + int256 b + ) public pure returns (int256) { + return ((a)) * b; + } + + // Expect 5 mutants: + // a + b + // a - b + // a / b + // a ** b + // a % b + function unsigned_times_with_parens( + uint256 a, + uint256 b + /// ArithmeticOperatorReplacement(`*` |==> `**`) of: `return ((a)) * b;` + ) public pure returns (uint256) { + return ((a)) ** b; + } + + // Expect 5 mutants: + // a + b + // a - b + // a / b + // a * b + // a % b + + function power(uint256 a, uint256 b) public pure returns (uint256) { + return a ** b; + } +} diff --git a/resources/regressions/test_log_invalid.json/mutants/17/AOR/AOR.sol b/resources/regressions/test_log_invalid.json/mutants/17/AOR/AOR.sol new file mode 100644 index 0000000..67aa6b3 --- /dev/null +++ b/resources/regressions/test_log_invalid.json/mutants/17/AOR/AOR.sol @@ -0,0 +1,61 @@ +// SPDX-License-Identifier: GPL-3.0-only +pragma solidity >0.7.0; +pragma experimental ABIEncoderV2; + +// This contract provides test functions for Arithmetic operator replacement +contract AOR { + // Expect 4 mutants: + // a - b + // a * b + // a / b + // a % b + function plus(int256 a, int256 b) public pure returns (int256) { + return a + b; + } + + // Expect 4 mutants: + // a + b + // a * b + // a / b + // a % b + function minus(int256 a, int256 b) public pure returns (int256) { + return a - b; + } + + // Expect 4 mutants: + // a - b + // a * b + // a / b + // a % b + function times_with_parens( + int256 a, + int256 b + ) public pure returns (int256) { + return ((a)) * b; + } + + // Expect 5 mutants: + // a + b + // a - b + // a / b + // a ** b + // a % b + function unsigned_times_with_parens( + uint256 a, + uint256 b + /// ArithmeticOperatorReplacement(`*` |==> `%`) of: `return ((a)) * b;` + ) public pure returns (uint256) { + return ((a)) % b; + } + + // Expect 5 mutants: + // a + b + // a - b + // a / b + // a * b + // a % b + + function power(uint256 a, uint256 b) public pure returns (uint256) { + return a ** b; + } +} diff --git a/resources/regressions/test_log_invalid.json/mutants/18/AOR/AOR.sol b/resources/regressions/test_log_invalid.json/mutants/18/AOR/AOR.sol new file mode 100644 index 0000000..b577022 --- /dev/null +++ b/resources/regressions/test_log_invalid.json/mutants/18/AOR/AOR.sol @@ -0,0 +1,61 @@ +// SPDX-License-Identifier: GPL-3.0-only +pragma solidity >0.7.0; +pragma experimental ABIEncoderV2; + +// This contract provides test functions for Arithmetic operator replacement +contract AOR { + // Expect 4 mutants: + // a - b + // a * b + // a / b + // a % b + function plus(int256 a, int256 b) public pure returns (int256) { + return a + b; + } + + // Expect 4 mutants: + // a + b + // a * b + // a / b + // a % b + function minus(int256 a, int256 b) public pure returns (int256) { + return a - b; + } + + // Expect 4 mutants: + // a - b + // a * b + // a / b + // a % b + function times_with_parens( + int256 a, + int256 b + ) public pure returns (int256) { + return ((a)) * b; + } + + // Expect 5 mutants: + // a + b + // a - b + // a / b + // a ** b + // a % b + function unsigned_times_with_parens( + uint256 a, + uint256 b + ) public pure returns (uint256) { + return ((a)) * b; + } + + // Expect 5 mutants: + // a + b + // a - b + // a / b + // a * b + // a % b + + /// ArithmeticOperatorReplacement(`**` |==> `+`) of: `return a ** b;` + function power(uint256 a, uint256 b) public pure returns (uint256) { + return a + b; + } +} diff --git a/resources/regressions/test_log_invalid.json/mutants/19/AOR/AOR.sol b/resources/regressions/test_log_invalid.json/mutants/19/AOR/AOR.sol new file mode 100644 index 0000000..fbde14d --- /dev/null +++ b/resources/regressions/test_log_invalid.json/mutants/19/AOR/AOR.sol @@ -0,0 +1,61 @@ +// SPDX-License-Identifier: GPL-3.0-only +pragma solidity >0.7.0; +pragma experimental ABIEncoderV2; + +// This contract provides test functions for Arithmetic operator replacement +contract AOR { + // Expect 4 mutants: + // a - b + // a * b + // a / b + // a % b + function plus(int256 a, int256 b) public pure returns (int256) { + return a + b; + } + + // Expect 4 mutants: + // a + b + // a * b + // a / b + // a % b + function minus(int256 a, int256 b) public pure returns (int256) { + return a - b; + } + + // Expect 4 mutants: + // a - b + // a * b + // a / b + // a % b + function times_with_parens( + int256 a, + int256 b + ) public pure returns (int256) { + return ((a)) * b; + } + + // Expect 5 mutants: + // a + b + // a - b + // a / b + // a ** b + // a % b + function unsigned_times_with_parens( + uint256 a, + uint256 b + ) public pure returns (uint256) { + return ((a)) * b; + } + + // Expect 5 mutants: + // a + b + // a - b + // a / b + // a * b + // a % b + + /// ArithmeticOperatorReplacement(`**` |==> `-`) of: `return a ** b;` + function power(uint256 a, uint256 b) public pure returns (uint256) { + return a - b; + } +} diff --git a/resources/regressions/test_log_invalid.json/mutants/2/AOR/AOR.sol b/resources/regressions/test_log_invalid.json/mutants/2/AOR/AOR.sol new file mode 100644 index 0000000..2e38a56 --- /dev/null +++ b/resources/regressions/test_log_invalid.json/mutants/2/AOR/AOR.sol @@ -0,0 +1,61 @@ +// SPDX-License-Identifier: GPL-3.0-only +pragma solidity >0.7.0; +pragma experimental ABIEncoderV2; + +// This contract provides test functions for Arithmetic operator replacement +contract AOR { + // Expect 4 mutants: + // a - b + // a * b + // a / b + // a % b + /// ArithmeticOperatorReplacement(`+` |==> `*`) of: `return a + b;` + function plus(int256 a, int256 b) public pure returns (int256) { + return a * b; + } + + // Expect 4 mutants: + // a + b + // a * b + // a / b + // a % b + function minus(int256 a, int256 b) public pure returns (int256) { + return a - b; + } + + // Expect 4 mutants: + // a - b + // a * b + // a / b + // a % b + function times_with_parens( + int256 a, + int256 b + ) public pure returns (int256) { + return ((a)) * b; + } + + // Expect 5 mutants: + // a + b + // a - b + // a / b + // a ** b + // a % b + function unsigned_times_with_parens( + uint256 a, + uint256 b + ) public pure returns (uint256) { + return ((a)) * b; + } + + // Expect 5 mutants: + // a + b + // a - b + // a / b + // a * b + // a % b + + function power(uint256 a, uint256 b) public pure returns (uint256) { + return a ** b; + } +} diff --git a/resources/regressions/test_log_invalid.json/mutants/20/AOR/AOR.sol b/resources/regressions/test_log_invalid.json/mutants/20/AOR/AOR.sol new file mode 100644 index 0000000..92cbf4d --- /dev/null +++ b/resources/regressions/test_log_invalid.json/mutants/20/AOR/AOR.sol @@ -0,0 +1,61 @@ +// SPDX-License-Identifier: GPL-3.0-only +pragma solidity >0.7.0; +pragma experimental ABIEncoderV2; + +// This contract provides test functions for Arithmetic operator replacement +contract AOR { + // Expect 4 mutants: + // a - b + // a * b + // a / b + // a % b + function plus(int256 a, int256 b) public pure returns (int256) { + return a + b; + } + + // Expect 4 mutants: + // a + b + // a * b + // a / b + // a % b + function minus(int256 a, int256 b) public pure returns (int256) { + return a - b; + } + + // Expect 4 mutants: + // a - b + // a * b + // a / b + // a % b + function times_with_parens( + int256 a, + int256 b + ) public pure returns (int256) { + return ((a)) * b; + } + + // Expect 5 mutants: + // a + b + // a - b + // a / b + // a ** b + // a % b + function unsigned_times_with_parens( + uint256 a, + uint256 b + ) public pure returns (uint256) { + return ((a)) * b; + } + + // Expect 5 mutants: + // a + b + // a - b + // a / b + // a * b + // a % b + + /// ArithmeticOperatorReplacement(`**` |==> `*`) of: `return a ** b;` + function power(uint256 a, uint256 b) public pure returns (uint256) { + return a * b; + } +} diff --git a/resources/regressions/test_log_invalid.json/mutants/21/AOR/AOR.sol b/resources/regressions/test_log_invalid.json/mutants/21/AOR/AOR.sol new file mode 100644 index 0000000..e3c6067 --- /dev/null +++ b/resources/regressions/test_log_invalid.json/mutants/21/AOR/AOR.sol @@ -0,0 +1,61 @@ +// SPDX-License-Identifier: GPL-3.0-only +pragma solidity >0.7.0; +pragma experimental ABIEncoderV2; + +// This contract provides test functions for Arithmetic operator replacement +contract AOR { + // Expect 4 mutants: + // a - b + // a * b + // a / b + // a % b + function plus(int256 a, int256 b) public pure returns (int256) { + return a + b; + } + + // Expect 4 mutants: + // a + b + // a * b + // a / b + // a % b + function minus(int256 a, int256 b) public pure returns (int256) { + return a - b; + } + + // Expect 4 mutants: + // a - b + // a * b + // a / b + // a % b + function times_with_parens( + int256 a, + int256 b + ) public pure returns (int256) { + return ((a)) * b; + } + + // Expect 5 mutants: + // a + b + // a - b + // a / b + // a ** b + // a % b + function unsigned_times_with_parens( + uint256 a, + uint256 b + ) public pure returns (uint256) { + return ((a)) * b; + } + + // Expect 5 mutants: + // a + b + // a - b + // a / b + // a * b + // a % b + + /// ArithmeticOperatorReplacement(`**` |==> `/`) of: `return a ** b;` + function power(uint256 a, uint256 b) public pure returns (uint256) { + return a / b; + } +} diff --git a/resources/regressions/test_log_invalid.json/mutants/22/AOR/AOR.sol b/resources/regressions/test_log_invalid.json/mutants/22/AOR/AOR.sol new file mode 100644 index 0000000..c63f66b --- /dev/null +++ b/resources/regressions/test_log_invalid.json/mutants/22/AOR/AOR.sol @@ -0,0 +1,61 @@ +// SPDX-License-Identifier: GPL-3.0-only +pragma solidity >0.7.0; +pragma experimental ABIEncoderV2; + +// This contract provides test functions for Arithmetic operator replacement +contract AOR { + // Expect 4 mutants: + // a - b + // a * b + // a / b + // a % b + function plus(int256 a, int256 b) public pure returns (int256) { + return a + b; + } + + // Expect 4 mutants: + // a + b + // a * b + // a / b + // a % b + function minus(int256 a, int256 b) public pure returns (int256) { + return a - b; + } + + // Expect 4 mutants: + // a - b + // a * b + // a / b + // a % b + function times_with_parens( + int256 a, + int256 b + ) public pure returns (int256) { + return ((a)) * b; + } + + // Expect 5 mutants: + // a + b + // a - b + // a / b + // a ** b + // a % b + function unsigned_times_with_parens( + uint256 a, + uint256 b + ) public pure returns (uint256) { + return ((a)) * b; + } + + // Expect 5 mutants: + // a + b + // a - b + // a / b + // a * b + // a % b + + /// ArithmeticOperatorReplacement(`**` |==> `%`) of: `return a ** b;` + function power(uint256 a, uint256 b) public pure returns (uint256) { + return a % b; + } +} diff --git a/resources/regressions/test_log_invalid.json/mutants/23/BOR/BOR.sol b/resources/regressions/test_log_invalid.json/mutants/23/BOR/BOR.sol new file mode 100644 index 0000000..34a280f --- /dev/null +++ b/resources/regressions/test_log_invalid.json/mutants/23/BOR/BOR.sol @@ -0,0 +1,25 @@ +// SPDX-License-Identifier: GPL-3.0-only +pragma solidity >0.7.0; +pragma experimental ABIEncoderV2; + +// This contract provides test functions for Bitwise Operator Replacement (BOR) +contract BOR { + // Expect 1 mutants: + // a & b; + /// ConditionalOperatorReplacement(`|` |==> `&`) of: `return a | b;` + function bw_or(int256 a, int256 b) public pure returns (int256) { + return a & b; + } + + // Expect 1 mutants: + // a | b; + function bw_and(int256 a, int256 b) public pure returns (int256) { + return a & b; + } + + // Expect 1 mutants: + // a | b; + function bw_xor(int256 a, int256 b) public pure returns (int256) { + return a ^ b; + } +} diff --git a/resources/regressions/test_log_invalid.json/mutants/24/BOR/BOR.sol b/resources/regressions/test_log_invalid.json/mutants/24/BOR/BOR.sol new file mode 100644 index 0000000..4bfbc16 --- /dev/null +++ b/resources/regressions/test_log_invalid.json/mutants/24/BOR/BOR.sol @@ -0,0 +1,25 @@ +// SPDX-License-Identifier: GPL-3.0-only +pragma solidity >0.7.0; +pragma experimental ABIEncoderV2; + +// This contract provides test functions for Bitwise Operator Replacement (BOR) +contract BOR { + // Expect 1 mutants: + // a & b; + function bw_or(int256 a, int256 b) public pure returns (int256) { + return a | b; + } + + // Expect 1 mutants: + // a | b; + /// ConditionalOperatorReplacement(`&` |==> `|`) of: `return a & b;` + function bw_and(int256 a, int256 b) public pure returns (int256) { + return a | b; + } + + // Expect 1 mutants: + // a | b; + function bw_xor(int256 a, int256 b) public pure returns (int256) { + return a ^ b; + } +} diff --git a/resources/regressions/test_log_invalid.json/mutants/25/BOR/BOR.sol b/resources/regressions/test_log_invalid.json/mutants/25/BOR/BOR.sol new file mode 100644 index 0000000..d4ee434 --- /dev/null +++ b/resources/regressions/test_log_invalid.json/mutants/25/BOR/BOR.sol @@ -0,0 +1,25 @@ +// SPDX-License-Identifier: GPL-3.0-only +pragma solidity >0.7.0; +pragma experimental ABIEncoderV2; + +// This contract provides test functions for Bitwise Operator Replacement (BOR) +contract BOR { + // Expect 1 mutants: + // a & b; + function bw_or(int256 a, int256 b) public pure returns (int256) { + return a | b; + } + + // Expect 1 mutants: + // a | b; + function bw_and(int256 a, int256 b) public pure returns (int256) { + return a & b; + } + + // Expect 1 mutants: + // a | b; + /// ConditionalOperatorReplacement(`^` |==> `&`) of: `return a ^ b;` + function bw_xor(int256 a, int256 b) public pure returns (int256) { + return a & b; + } +} diff --git a/resources/regressions/test_log_invalid.json/mutants/26/EDC/EDC.sol b/resources/regressions/test_log_invalid.json/mutants/26/EDC/EDC.sol new file mode 100644 index 0000000..1975497 --- /dev/null +++ b/resources/regressions/test_log_invalid.json/mutants/26/EDC/EDC.sol @@ -0,0 +1,22 @@ +// SPDX-License-Identifier: GPL-3.0-only +pragma solidity ^0.8.13; + +contract Helper { + function setVars(uint _num) public payable {} +} + +contract EDC { + uint public num; + address public sender; + uint public value; + bool public delegateSuccessful; + bytes public myData; + + /// ElimDelegateCall(`delegatecall` |==> `call`) of: `(bool success, ) = _contract.delegatecall(` + function setVars(address _contract) public payable { + (bool success, ) = _contract.call( + abi.encodeWithSignature("setVars(uint256)", 1) + ); + require(success, "Delegatecall failed"); + } +} diff --git a/resources/regressions/test_log_invalid.json/mutants/27/LOR/LOR.sol b/resources/regressions/test_log_invalid.json/mutants/27/LOR/LOR.sol new file mode 100644 index 0000000..01536cd --- /dev/null +++ b/resources/regressions/test_log_invalid.json/mutants/27/LOR/LOR.sol @@ -0,0 +1,26 @@ +// SPDX-License-Identifier: GPL-3.0-only +pragma solidity >0.7.0; +pragma experimental ABIEncoderV2; + +// This contract provides test functions for relational operator replacement (ROR) +contract LOR { + // Expect three mutants: a, b, false + /// LogicalOperatorReplacement(`a && b` |==> `a`) of: `return a && b;` + function and(bool a, bool b) public pure returns (bool) { + return a; + } + + // Expect three mutants: a, b, true + function or(bool a, bool b) public pure returns (bool) { + return a || b; + } + + // Expect three mutants, x < y, a != (x >= y), true + function more_or(bool a, int x, int y) public pure returns (bool) { + return (x < y) || (a != (x >= y)); + } + + function not(bool a) public pure returns (bool) { + return !a; + } +} diff --git a/resources/regressions/test_log_invalid.json/mutants/28/LOR/LOR.sol b/resources/regressions/test_log_invalid.json/mutants/28/LOR/LOR.sol new file mode 100644 index 0000000..c97e867 --- /dev/null +++ b/resources/regressions/test_log_invalid.json/mutants/28/LOR/LOR.sol @@ -0,0 +1,26 @@ +// SPDX-License-Identifier: GPL-3.0-only +pragma solidity >0.7.0; +pragma experimental ABIEncoderV2; + +// This contract provides test functions for relational operator replacement (ROR) +contract LOR { + // Expect three mutants: a, b, false + /// LogicalOperatorReplacement(`a && b` |==> `b`) of: `return a && b;` + function and(bool a, bool b) public pure returns (bool) { + return b; + } + + // Expect three mutants: a, b, true + function or(bool a, bool b) public pure returns (bool) { + return a || b; + } + + // Expect three mutants, x < y, a != (x >= y), true + function more_or(bool a, int x, int y) public pure returns (bool) { + return (x < y) || (a != (x >= y)); + } + + function not(bool a) public pure returns (bool) { + return !a; + } +} diff --git a/resources/regressions/test_log_invalid.json/mutants/29/LOR/LOR.sol b/resources/regressions/test_log_invalid.json/mutants/29/LOR/LOR.sol new file mode 100644 index 0000000..492dc45 --- /dev/null +++ b/resources/regressions/test_log_invalid.json/mutants/29/LOR/LOR.sol @@ -0,0 +1,26 @@ +// SPDX-License-Identifier: GPL-3.0-only +pragma solidity >0.7.0; +pragma experimental ABIEncoderV2; + +// This contract provides test functions for relational operator replacement (ROR) +contract LOR { + // Expect three mutants: a, b, false + /// LogicalOperatorReplacement(`a && b` |==> `false`) of: `return a && b;` + function and(bool a, bool b) public pure returns (bool) { + return false; + } + + // Expect three mutants: a, b, true + function or(bool a, bool b) public pure returns (bool) { + return a || b; + } + + // Expect three mutants, x < y, a != (x >= y), true + function more_or(bool a, int x, int y) public pure returns (bool) { + return (x < y) || (a != (x >= y)); + } + + function not(bool a) public pure returns (bool) { + return !a; + } +} diff --git a/resources/regressions/test_log_invalid.json/mutants/3/AOR/AOR.sol b/resources/regressions/test_log_invalid.json/mutants/3/AOR/AOR.sol new file mode 100644 index 0000000..60a969d --- /dev/null +++ b/resources/regressions/test_log_invalid.json/mutants/3/AOR/AOR.sol @@ -0,0 +1,61 @@ +// SPDX-License-Identifier: GPL-3.0-only +pragma solidity >0.7.0; +pragma experimental ABIEncoderV2; + +// This contract provides test functions for Arithmetic operator replacement +contract AOR { + // Expect 4 mutants: + // a - b + // a * b + // a / b + // a % b + /// ArithmeticOperatorReplacement(`+` |==> `/`) of: `return a + b;` + function plus(int256 a, int256 b) public pure returns (int256) { + return a / b; + } + + // Expect 4 mutants: + // a + b + // a * b + // a / b + // a % b + function minus(int256 a, int256 b) public pure returns (int256) { + return a - b; + } + + // Expect 4 mutants: + // a - b + // a * b + // a / b + // a % b + function times_with_parens( + int256 a, + int256 b + ) public pure returns (int256) { + return ((a)) * b; + } + + // Expect 5 mutants: + // a + b + // a - b + // a / b + // a ** b + // a % b + function unsigned_times_with_parens( + uint256 a, + uint256 b + ) public pure returns (uint256) { + return ((a)) * b; + } + + // Expect 5 mutants: + // a + b + // a - b + // a / b + // a * b + // a % b + + function power(uint256 a, uint256 b) public pure returns (uint256) { + return a ** b; + } +} diff --git a/resources/regressions/test_log_invalid.json/mutants/30/LOR/LOR.sol b/resources/regressions/test_log_invalid.json/mutants/30/LOR/LOR.sol new file mode 100644 index 0000000..7f62ba0 --- /dev/null +++ b/resources/regressions/test_log_invalid.json/mutants/30/LOR/LOR.sol @@ -0,0 +1,26 @@ +// SPDX-License-Identifier: GPL-3.0-only +pragma solidity >0.7.0; +pragma experimental ABIEncoderV2; + +// This contract provides test functions for relational operator replacement (ROR) +contract LOR { + // Expect three mutants: a, b, false + function and(bool a, bool b) public pure returns (bool) { + return a && b; + } + + // Expect three mutants: a, b, true + /// LogicalOperatorReplacement(`a || b` |==> `a`) of: `return a || b;` + function or(bool a, bool b) public pure returns (bool) { + return a; + } + + // Expect three mutants, x < y, a != (x >= y), true + function more_or(bool a, int x, int y) public pure returns (bool) { + return (x < y) || (a != (x >= y)); + } + + function not(bool a) public pure returns (bool) { + return !a; + } +} diff --git a/resources/regressions/test_log_invalid.json/mutants/31/LOR/LOR.sol b/resources/regressions/test_log_invalid.json/mutants/31/LOR/LOR.sol new file mode 100644 index 0000000..efb5d5a --- /dev/null +++ b/resources/regressions/test_log_invalid.json/mutants/31/LOR/LOR.sol @@ -0,0 +1,26 @@ +// SPDX-License-Identifier: GPL-3.0-only +pragma solidity >0.7.0; +pragma experimental ABIEncoderV2; + +// This contract provides test functions for relational operator replacement (ROR) +contract LOR { + // Expect three mutants: a, b, false + function and(bool a, bool b) public pure returns (bool) { + return a && b; + } + + // Expect three mutants: a, b, true + /// LogicalOperatorReplacement(`a || b` |==> `b`) of: `return a || b;` + function or(bool a, bool b) public pure returns (bool) { + return b; + } + + // Expect three mutants, x < y, a != (x >= y), true + function more_or(bool a, int x, int y) public pure returns (bool) { + return (x < y) || (a != (x >= y)); + } + + function not(bool a) public pure returns (bool) { + return !a; + } +} diff --git a/resources/regressions/test_log_invalid.json/mutants/32/LOR/LOR.sol b/resources/regressions/test_log_invalid.json/mutants/32/LOR/LOR.sol new file mode 100644 index 0000000..7d3c811 --- /dev/null +++ b/resources/regressions/test_log_invalid.json/mutants/32/LOR/LOR.sol @@ -0,0 +1,26 @@ +// SPDX-License-Identifier: GPL-3.0-only +pragma solidity >0.7.0; +pragma experimental ABIEncoderV2; + +// This contract provides test functions for relational operator replacement (ROR) +contract LOR { + // Expect three mutants: a, b, false + function and(bool a, bool b) public pure returns (bool) { + return a && b; + } + + // Expect three mutants: a, b, true + /// LogicalOperatorReplacement(`a || b` |==> `true`) of: `return a || b;` + function or(bool a, bool b) public pure returns (bool) { + return true; + } + + // Expect three mutants, x < y, a != (x >= y), true + function more_or(bool a, int x, int y) public pure returns (bool) { + return (x < y) || (a != (x >= y)); + } + + function not(bool a) public pure returns (bool) { + return !a; + } +} diff --git a/resources/regressions/test_log_invalid.json/mutants/33/LOR/LOR.sol b/resources/regressions/test_log_invalid.json/mutants/33/LOR/LOR.sol new file mode 100644 index 0000000..4ceda90 --- /dev/null +++ b/resources/regressions/test_log_invalid.json/mutants/33/LOR/LOR.sol @@ -0,0 +1,26 @@ +// SPDX-License-Identifier: GPL-3.0-only +pragma solidity >0.7.0; +pragma experimental ABIEncoderV2; + +// This contract provides test functions for relational operator replacement (ROR) +contract LOR { + // Expect three mutants: a, b, false + function and(bool a, bool b) public pure returns (bool) { + return a && b; + } + + // Expect three mutants: a, b, true + function or(bool a, bool b) public pure returns (bool) { + return a || b; + } + + // Expect three mutants, x < y, a != (x >= y), true + /// LogicalOperatorReplacement(`(x < y) || (a != (x >= y))` |==> `x < y`) of: `return (x < y) || (a != (x >= y));` + function more_or(bool a, int x, int y) public pure returns (bool) { + return x < y; + } + + function not(bool a) public pure returns (bool) { + return !a; + } +} diff --git a/resources/regressions/test_log_invalid.json/mutants/34/LOR/LOR.sol b/resources/regressions/test_log_invalid.json/mutants/34/LOR/LOR.sol new file mode 100644 index 0000000..690fae8 --- /dev/null +++ b/resources/regressions/test_log_invalid.json/mutants/34/LOR/LOR.sol @@ -0,0 +1,26 @@ +// SPDX-License-Identifier: GPL-3.0-only +pragma solidity >0.7.0; +pragma experimental ABIEncoderV2; + +// This contract provides test functions for relational operator replacement (ROR) +contract LOR { + // Expect three mutants: a, b, false + function and(bool a, bool b) public pure returns (bool) { + return a && b; + } + + // Expect three mutants: a, b, true + function or(bool a, bool b) public pure returns (bool) { + return a || b; + } + + // Expect three mutants, x < y, a != (x >= y), true + /// LogicalOperatorReplacement(`(x < y) || (a != (x >= y))` |==> `a != (x >= y)`) of: `return (x < y) || (a != (x >= y));` + function more_or(bool a, int x, int y) public pure returns (bool) { + return a != (x >= y); + } + + function not(bool a) public pure returns (bool) { + return !a; + } +} diff --git a/resources/regressions/test_log_invalid.json/mutants/35/LOR/LOR.sol b/resources/regressions/test_log_invalid.json/mutants/35/LOR/LOR.sol new file mode 100644 index 0000000..2ef1564 --- /dev/null +++ b/resources/regressions/test_log_invalid.json/mutants/35/LOR/LOR.sol @@ -0,0 +1,26 @@ +// SPDX-License-Identifier: GPL-3.0-only +pragma solidity >0.7.0; +pragma experimental ABIEncoderV2; + +// This contract provides test functions for relational operator replacement (ROR) +contract LOR { + // Expect three mutants: a, b, false + function and(bool a, bool b) public pure returns (bool) { + return a && b; + } + + // Expect three mutants: a, b, true + function or(bool a, bool b) public pure returns (bool) { + return a || b; + } + + // Expect three mutants, x < y, a != (x >= y), true + /// LogicalOperatorReplacement(`(x < y) || (a != (x >= y))` |==> `true`) of: `return (x < y) || (a != (x >= y));` + function more_or(bool a, int x, int y) public pure returns (bool) { + return true; + } + + function not(bool a) public pure returns (bool) { + return !a; + } +} diff --git a/resources/regressions/test_log_invalid.json/mutants/36/LOR/LOR.sol b/resources/regressions/test_log_invalid.json/mutants/36/LOR/LOR.sol new file mode 100644 index 0000000..be0e75f --- /dev/null +++ b/resources/regressions/test_log_invalid.json/mutants/36/LOR/LOR.sol @@ -0,0 +1,26 @@ +// SPDX-License-Identifier: GPL-3.0-only +pragma solidity >0.7.0; +pragma experimental ABIEncoderV2; + +// This contract provides test functions for relational operator replacement (ROR) +contract LOR { + // Expect three mutants: a, b, false + function and(bool a, bool b) public pure returns (bool) { + return a && b; + } + + // Expect three mutants: a, b, true + function or(bool a, bool b) public pure returns (bool) { + return a || b; + } + + // Expect three mutants, x < y, a != (x >= y), true + function more_or(bool a, int x, int y) public pure returns (bool) { + return (x < y) || (a != (x >= y)); + } + + /// LogicalOperatorReplacement(`!a` |==> `true`) of: `return !a;` + function not(bool a) public pure returns (bool) { + return true; + } +} diff --git a/resources/regressions/test_log_invalid.json/mutants/37/LOR/LOR.sol b/resources/regressions/test_log_invalid.json/mutants/37/LOR/LOR.sol new file mode 100644 index 0000000..35ee575 --- /dev/null +++ b/resources/regressions/test_log_invalid.json/mutants/37/LOR/LOR.sol @@ -0,0 +1,26 @@ +// SPDX-License-Identifier: GPL-3.0-only +pragma solidity >0.7.0; +pragma experimental ABIEncoderV2; + +// This contract provides test functions for relational operator replacement (ROR) +contract LOR { + // Expect three mutants: a, b, false + function and(bool a, bool b) public pure returns (bool) { + return a && b; + } + + // Expect three mutants: a, b, true + function or(bool a, bool b) public pure returns (bool) { + return a || b; + } + + // Expect three mutants, x < y, a != (x >= y), true + function more_or(bool a, int x, int y) public pure returns (bool) { + return (x < y) || (a != (x >= y)); + } + + /// LogicalOperatorReplacement(`!a` |==> `false`) of: `return !a;` + function not(bool a) public pure returns (bool) { + return false; + } +} diff --git a/resources/regressions/test_log_invalid.json/mutants/38/LVR/LVR.sol b/resources/regressions/test_log_invalid.json/mutants/38/LVR/LVR.sol new file mode 100644 index 0000000..e06271e --- /dev/null +++ b/resources/regressions/test_log_invalid.json/mutants/38/LVR/LVR.sol @@ -0,0 +1,43 @@ +// SPDX-License-Identifier: GPL-3.0-only +pragma solidity >0.7.0; +pragma experimental ABIEncoderV2; + +// This contract provides test functions for relational operator replacement (ROR) +contract LVR { + uint256 one_u = 1; + uint256 zero_u = 0; + int256 n_one_s = -1; + int256 one_s = 1; + int256 zero_s = 0; + + // Expect 1 mutant: 1 + /// LiteralValueReplacement(`0` |==> `1`) of: `uint256 zero = 0;` + function unsigned_zero() public pure returns (uint256) { + uint256 zero = 1; + return zero; + } + + // Expect 2 mutant: 0, 2 + function unsigned_one() public pure returns (uint256) { + uint256 one = 1; + return one; + } + + // Expect 2 mutants: 0, 1 + function signed_neg_one() public pure returns (int256) { + int256 neg_one = -1; + return neg_one; + } + + // Expect 2 mutants: -1, 0 + function signed_pos_one() public pure returns (int256) { + int256 pos_one = 1; + return pos_one; + } + + // Expect 2 mutants: -1, 1 + function signed_zero() public pure returns (int256) { + int256 zero = 0; + return zero; + } +} diff --git a/resources/regressions/test_log_invalid.json/mutants/39/LVR/LVR.sol b/resources/regressions/test_log_invalid.json/mutants/39/LVR/LVR.sol new file mode 100644 index 0000000..f2cb829 --- /dev/null +++ b/resources/regressions/test_log_invalid.json/mutants/39/LVR/LVR.sol @@ -0,0 +1,43 @@ +// SPDX-License-Identifier: GPL-3.0-only +pragma solidity >0.7.0; +pragma experimental ABIEncoderV2; + +// This contract provides test functions for relational operator replacement (ROR) +contract LVR { + uint256 one_u = 1; + uint256 zero_u = 0; + int256 n_one_s = -1; + int256 one_s = 1; + int256 zero_s = 0; + + // Expect 1 mutant: 1 + function unsigned_zero() public pure returns (uint256) { + uint256 zero = 0; + return zero; + } + + // Expect 2 mutant: 0, 2 + /// LiteralValueReplacement(`1` |==> `0`) of: `uint256 one = 1;` + function unsigned_one() public pure returns (uint256) { + uint256 one = 0; + return one; + } + + // Expect 2 mutants: 0, 1 + function signed_neg_one() public pure returns (int256) { + int256 neg_one = -1; + return neg_one; + } + + // Expect 2 mutants: -1, 0 + function signed_pos_one() public pure returns (int256) { + int256 pos_one = 1; + return pos_one; + } + + // Expect 2 mutants: -1, 1 + function signed_zero() public pure returns (int256) { + int256 zero = 0; + return zero; + } +} diff --git a/resources/regressions/test_log_invalid.json/mutants/4/AOR/AOR.sol b/resources/regressions/test_log_invalid.json/mutants/4/AOR/AOR.sol new file mode 100644 index 0000000..61a8854 --- /dev/null +++ b/resources/regressions/test_log_invalid.json/mutants/4/AOR/AOR.sol @@ -0,0 +1,61 @@ +// SPDX-License-Identifier: GPL-3.0-only +pragma solidity >0.7.0; +pragma experimental ABIEncoderV2; + +// This contract provides test functions for Arithmetic operator replacement +contract AOR { + // Expect 4 mutants: + // a - b + // a * b + // a / b + // a % b + /// ArithmeticOperatorReplacement(`+` |==> `%`) of: `return a + b;` + function plus(int256 a, int256 b) public pure returns (int256) { + return a % b; + } + + // Expect 4 mutants: + // a + b + // a * b + // a / b + // a % b + function minus(int256 a, int256 b) public pure returns (int256) { + return a - b; + } + + // Expect 4 mutants: + // a - b + // a * b + // a / b + // a % b + function times_with_parens( + int256 a, + int256 b + ) public pure returns (int256) { + return ((a)) * b; + } + + // Expect 5 mutants: + // a + b + // a - b + // a / b + // a ** b + // a % b + function unsigned_times_with_parens( + uint256 a, + uint256 b + ) public pure returns (uint256) { + return ((a)) * b; + } + + // Expect 5 mutants: + // a + b + // a - b + // a / b + // a * b + // a % b + + function power(uint256 a, uint256 b) public pure returns (uint256) { + return a ** b; + } +} diff --git a/resources/regressions/test_log_invalid.json/mutants/40/LVR/LVR.sol b/resources/regressions/test_log_invalid.json/mutants/40/LVR/LVR.sol new file mode 100644 index 0000000..d18c6c4 --- /dev/null +++ b/resources/regressions/test_log_invalid.json/mutants/40/LVR/LVR.sol @@ -0,0 +1,43 @@ +// SPDX-License-Identifier: GPL-3.0-only +pragma solidity >0.7.0; +pragma experimental ABIEncoderV2; + +// This contract provides test functions for relational operator replacement (ROR) +contract LVR { + uint256 one_u = 1; + uint256 zero_u = 0; + int256 n_one_s = -1; + int256 one_s = 1; + int256 zero_s = 0; + + // Expect 1 mutant: 1 + function unsigned_zero() public pure returns (uint256) { + uint256 zero = 0; + return zero; + } + + // Expect 2 mutant: 0, 2 + /// LiteralValueReplacement(`1` |==> `2`) of: `uint256 one = 1;` + function unsigned_one() public pure returns (uint256) { + uint256 one = 2; + return one; + } + + // Expect 2 mutants: 0, 1 + function signed_neg_one() public pure returns (int256) { + int256 neg_one = -1; + return neg_one; + } + + // Expect 2 mutants: -1, 0 + function signed_pos_one() public pure returns (int256) { + int256 pos_one = 1; + return pos_one; + } + + // Expect 2 mutants: -1, 1 + function signed_zero() public pure returns (int256) { + int256 zero = 0; + return zero; + } +} diff --git a/resources/regressions/test_log_invalid.json/mutants/41/LVR/LVR.sol b/resources/regressions/test_log_invalid.json/mutants/41/LVR/LVR.sol new file mode 100644 index 0000000..173dc54 --- /dev/null +++ b/resources/regressions/test_log_invalid.json/mutants/41/LVR/LVR.sol @@ -0,0 +1,43 @@ +// SPDX-License-Identifier: GPL-3.0-only +pragma solidity >0.7.0; +pragma experimental ABIEncoderV2; + +// This contract provides test functions for relational operator replacement (ROR) +contract LVR { + uint256 one_u = 1; + uint256 zero_u = 0; + int256 n_one_s = -1; + int256 one_s = 1; + int256 zero_s = 0; + + // Expect 1 mutant: 1 + function unsigned_zero() public pure returns (uint256) { + uint256 zero = 0; + return zero; + } + + // Expect 2 mutant: 0, 2 + function unsigned_one() public pure returns (uint256) { + uint256 one = 1; + return one; + } + + // Expect 2 mutants: 0, 1 + /// LiteralValueReplacement(`-1` |==> `0`) of: `int256 neg_one = -1;` + function signed_neg_one() public pure returns (int256) { + int256 neg_one = 0; + return neg_one; + } + + // Expect 2 mutants: -1, 0 + function signed_pos_one() public pure returns (int256) { + int256 pos_one = 1; + return pos_one; + } + + // Expect 2 mutants: -1, 1 + function signed_zero() public pure returns (int256) { + int256 zero = 0; + return zero; + } +} diff --git a/resources/regressions/test_log_invalid.json/mutants/42/LVR/LVR.sol b/resources/regressions/test_log_invalid.json/mutants/42/LVR/LVR.sol new file mode 100644 index 0000000..72ffaed --- /dev/null +++ b/resources/regressions/test_log_invalid.json/mutants/42/LVR/LVR.sol @@ -0,0 +1,43 @@ +// SPDX-License-Identifier: GPL-3.0-only +pragma solidity >0.7.0; +pragma experimental ABIEncoderV2; + +// This contract provides test functions for relational operator replacement (ROR) +contract LVR { + uint256 one_u = 1; + uint256 zero_u = 0; + int256 n_one_s = -1; + int256 one_s = 1; + int256 zero_s = 0; + + // Expect 1 mutant: 1 + function unsigned_zero() public pure returns (uint256) { + uint256 zero = 0; + return zero; + } + + // Expect 2 mutant: 0, 2 + function unsigned_one() public pure returns (uint256) { + uint256 one = 1; + return one; + } + + // Expect 2 mutants: 0, 1 + /// LiteralValueReplacement(`-1` |==> `1`) of: `int256 neg_one = -1;` + function signed_neg_one() public pure returns (int256) { + int256 neg_one = 1; + return neg_one; + } + + // Expect 2 mutants: -1, 0 + function signed_pos_one() public pure returns (int256) { + int256 pos_one = 1; + return pos_one; + } + + // Expect 2 mutants: -1, 1 + function signed_zero() public pure returns (int256) { + int256 zero = 0; + return zero; + } +} diff --git a/resources/regressions/test_log_invalid.json/mutants/43/LVR/LVR.sol b/resources/regressions/test_log_invalid.json/mutants/43/LVR/LVR.sol new file mode 100644 index 0000000..1e24417 --- /dev/null +++ b/resources/regressions/test_log_invalid.json/mutants/43/LVR/LVR.sol @@ -0,0 +1,43 @@ +// SPDX-License-Identifier: GPL-3.0-only +pragma solidity >0.7.0; +pragma experimental ABIEncoderV2; + +// This contract provides test functions for relational operator replacement (ROR) +contract LVR { + uint256 one_u = 1; + uint256 zero_u = 0; + int256 n_one_s = -1; + int256 one_s = 1; + int256 zero_s = 0; + + // Expect 1 mutant: 1 + function unsigned_zero() public pure returns (uint256) { + uint256 zero = 0; + return zero; + } + + // Expect 2 mutant: 0, 2 + function unsigned_one() public pure returns (uint256) { + uint256 one = 1; + return one; + } + + // Expect 2 mutants: 0, 1 + /// LiteralValueReplacement(`-1` |==> `-2`) of: `int256 neg_one = -1;` + function signed_neg_one() public pure returns (int256) { + int256 neg_one = -2; + return neg_one; + } + + // Expect 2 mutants: -1, 0 + function signed_pos_one() public pure returns (int256) { + int256 pos_one = 1; + return pos_one; + } + + // Expect 2 mutants: -1, 1 + function signed_zero() public pure returns (int256) { + int256 zero = 0; + return zero; + } +} diff --git a/resources/regressions/test_log_invalid.json/mutants/44/LVR/LVR.sol b/resources/regressions/test_log_invalid.json/mutants/44/LVR/LVR.sol new file mode 100644 index 0000000..e088a4e --- /dev/null +++ b/resources/regressions/test_log_invalid.json/mutants/44/LVR/LVR.sol @@ -0,0 +1,43 @@ +// SPDX-License-Identifier: GPL-3.0-only +pragma solidity >0.7.0; +pragma experimental ABIEncoderV2; + +// This contract provides test functions for relational operator replacement (ROR) +contract LVR { + uint256 one_u = 1; + uint256 zero_u = 0; + int256 n_one_s = -1; + int256 one_s = 1; + int256 zero_s = 0; + + // Expect 1 mutant: 1 + function unsigned_zero() public pure returns (uint256) { + uint256 zero = 0; + return zero; + } + + // Expect 2 mutant: 0, 2 + function unsigned_one() public pure returns (uint256) { + uint256 one = 1; + return one; + } + + // Expect 2 mutants: 0, 1 + function signed_neg_one() public pure returns (int256) { + int256 neg_one = -1; + return neg_one; + } + + // Expect 2 mutants: -1, 0 + /// LiteralValueReplacement(`1` |==> `0`) of: `int256 pos_one = 1;` + function signed_pos_one() public pure returns (int256) { + int256 pos_one = 0; + return pos_one; + } + + // Expect 2 mutants: -1, 1 + function signed_zero() public pure returns (int256) { + int256 zero = 0; + return zero; + } +} diff --git a/resources/regressions/test_log_invalid.json/mutants/45/LVR/LVR.sol b/resources/regressions/test_log_invalid.json/mutants/45/LVR/LVR.sol new file mode 100644 index 0000000..2407079 --- /dev/null +++ b/resources/regressions/test_log_invalid.json/mutants/45/LVR/LVR.sol @@ -0,0 +1,43 @@ +// SPDX-License-Identifier: GPL-3.0-only +pragma solidity >0.7.0; +pragma experimental ABIEncoderV2; + +// This contract provides test functions for relational operator replacement (ROR) +contract LVR { + uint256 one_u = 1; + uint256 zero_u = 0; + int256 n_one_s = -1; + int256 one_s = 1; + int256 zero_s = 0; + + // Expect 1 mutant: 1 + function unsigned_zero() public pure returns (uint256) { + uint256 zero = 0; + return zero; + } + + // Expect 2 mutant: 0, 2 + function unsigned_one() public pure returns (uint256) { + uint256 one = 1; + return one; + } + + // Expect 2 mutants: 0, 1 + function signed_neg_one() public pure returns (int256) { + int256 neg_one = -1; + return neg_one; + } + + // Expect 2 mutants: -1, 0 + /// LiteralValueReplacement(`1` |==> `-1`) of: `int256 pos_one = 1;` + function signed_pos_one() public pure returns (int256) { + int256 pos_one = -1; + return pos_one; + } + + // Expect 2 mutants: -1, 1 + function signed_zero() public pure returns (int256) { + int256 zero = 0; + return zero; + } +} diff --git a/resources/regressions/test_log_invalid.json/mutants/46/LVR/LVR.sol b/resources/regressions/test_log_invalid.json/mutants/46/LVR/LVR.sol new file mode 100644 index 0000000..a5082f3 --- /dev/null +++ b/resources/regressions/test_log_invalid.json/mutants/46/LVR/LVR.sol @@ -0,0 +1,43 @@ +// SPDX-License-Identifier: GPL-3.0-only +pragma solidity >0.7.0; +pragma experimental ABIEncoderV2; + +// This contract provides test functions for relational operator replacement (ROR) +contract LVR { + uint256 one_u = 1; + uint256 zero_u = 0; + int256 n_one_s = -1; + int256 one_s = 1; + int256 zero_s = 0; + + // Expect 1 mutant: 1 + function unsigned_zero() public pure returns (uint256) { + uint256 zero = 0; + return zero; + } + + // Expect 2 mutant: 0, 2 + function unsigned_one() public pure returns (uint256) { + uint256 one = 1; + return one; + } + + // Expect 2 mutants: 0, 1 + function signed_neg_one() public pure returns (int256) { + int256 neg_one = -1; + return neg_one; + } + + // Expect 2 mutants: -1, 0 + /// LiteralValueReplacement(`1` |==> `2`) of: `int256 pos_one = 1;` + function signed_pos_one() public pure returns (int256) { + int256 pos_one = 2; + return pos_one; + } + + // Expect 2 mutants: -1, 1 + function signed_zero() public pure returns (int256) { + int256 zero = 0; + return zero; + } +} diff --git a/resources/regressions/test_log_invalid.json/mutants/47/LVR/LVR.sol b/resources/regressions/test_log_invalid.json/mutants/47/LVR/LVR.sol new file mode 100644 index 0000000..22af418 --- /dev/null +++ b/resources/regressions/test_log_invalid.json/mutants/47/LVR/LVR.sol @@ -0,0 +1,43 @@ +// SPDX-License-Identifier: GPL-3.0-only +pragma solidity >0.7.0; +pragma experimental ABIEncoderV2; + +// This contract provides test functions for relational operator replacement (ROR) +contract LVR { + uint256 one_u = 1; + uint256 zero_u = 0; + int256 n_one_s = -1; + int256 one_s = 1; + int256 zero_s = 0; + + // Expect 1 mutant: 1 + function unsigned_zero() public pure returns (uint256) { + uint256 zero = 0; + return zero; + } + + // Expect 2 mutant: 0, 2 + function unsigned_one() public pure returns (uint256) { + uint256 one = 1; + return one; + } + + // Expect 2 mutants: 0, 1 + function signed_neg_one() public pure returns (int256) { + int256 neg_one = -1; + return neg_one; + } + + // Expect 2 mutants: -1, 0 + function signed_pos_one() public pure returns (int256) { + int256 pos_one = 1; + return pos_one; + } + + // Expect 2 mutants: -1, 1 + /// LiteralValueReplacement(`0` |==> `-1`) of: `int256 zero = 0;` + function signed_zero() public pure returns (int256) { + int256 zero = -1; + return zero; + } +} diff --git a/resources/regressions/test_log_invalid.json/mutants/48/LVR/LVR.sol b/resources/regressions/test_log_invalid.json/mutants/48/LVR/LVR.sol new file mode 100644 index 0000000..e241973 --- /dev/null +++ b/resources/regressions/test_log_invalid.json/mutants/48/LVR/LVR.sol @@ -0,0 +1,43 @@ +// SPDX-License-Identifier: GPL-3.0-only +pragma solidity >0.7.0; +pragma experimental ABIEncoderV2; + +// This contract provides test functions for relational operator replacement (ROR) +contract LVR { + uint256 one_u = 1; + uint256 zero_u = 0; + int256 n_one_s = -1; + int256 one_s = 1; + int256 zero_s = 0; + + // Expect 1 mutant: 1 + function unsigned_zero() public pure returns (uint256) { + uint256 zero = 0; + return zero; + } + + // Expect 2 mutant: 0, 2 + function unsigned_one() public pure returns (uint256) { + uint256 one = 1; + return one; + } + + // Expect 2 mutants: 0, 1 + function signed_neg_one() public pure returns (int256) { + int256 neg_one = -1; + return neg_one; + } + + // Expect 2 mutants: -1, 0 + function signed_pos_one() public pure returns (int256) { + int256 pos_one = 1; + return pos_one; + } + + // Expect 2 mutants: -1, 1 + /// LiteralValueReplacement(`0` |==> `1`) of: `int256 zero = 0;` + function signed_zero() public pure returns (int256) { + int256 zero = 1; + return zero; + } +} diff --git a/resources/regressions/test_log_invalid.json/mutants/49/ROR/ROR.sol b/resources/regressions/test_log_invalid.json/mutants/49/ROR/ROR.sol new file mode 100644 index 0000000..dec84f2 --- /dev/null +++ b/resources/regressions/test_log_invalid.json/mutants/49/ROR/ROR.sol @@ -0,0 +1,65 @@ +// SPDX-License-Identifier: GPL-3.0-only +pragma solidity >0.7.0; +pragma experimental ABIEncoderV2; + +// This contract provides test functions for relational operator replacement (ROR) +contract ROR { + // Expect 3 mutants: x <= y, x != y, false + /// RelationalOperatorReplacement(`<` |==> `<=`) of: `return x < y;` + function less(uint256 x, uint256 y) public pure returns (bool) { + return x <= y; + } + + // Expect 3 mutants: x < y, x == y, true + function less_equal(uint256 x, uint256 y) public pure returns (bool) { + return x <= y; + } + + // Expect 3 mutants: x >= y, x != y, false + function more(uint256 x, uint256 y) public pure returns (bool) { + return x > y; + } + + // Expect 3 mutants: x > y, x == y, true + function more_equal(uint256 x, uint256 y) public pure returns (bool) { + return x >= y; + } + + // Expect 3 mutants: x >= y, x <= y, false + function equal_ord(uint256 x, uint256 y) public pure returns (bool) { + return x == y; + } + + // Expect 2 mutants: true, false + function equal_not_ord(bool x, bool y) public pure returns (bool) { + return x == y; + } + + // Expect 3 mutants: x > y, x < y, true + function not_equal_ord(uint256 x, uint256 y) public pure returns (bool) { + return x != y; + } + + // Expect 2 mutants: true, false + function not_equal_not_ord(bool x, bool y) public pure returns (bool) { + return x != y; + } + + // Expect 3 mutants: (x + y) > z, (x + y) == z, true + function more_equal_over_aor( + uint256 x, + uint256 y, + uint256 z + ) public pure returns (bool) { + return (x + y) >= z; + } + + // Expect 3 mutants: (x + y) > z, (x + y) < z, true + function not_equal_over_aor( + uint256 x, + uint256 y, + uint256 z + ) public pure returns (bool) { + return (x + y) != z; + } +} diff --git a/resources/regressions/test_log_invalid.json/mutants/5/AOR/AOR.sol b/resources/regressions/test_log_invalid.json/mutants/5/AOR/AOR.sol new file mode 100644 index 0000000..60846bd --- /dev/null +++ b/resources/regressions/test_log_invalid.json/mutants/5/AOR/AOR.sol @@ -0,0 +1,61 @@ +// SPDX-License-Identifier: GPL-3.0-only +pragma solidity >0.7.0; +pragma experimental ABIEncoderV2; + +// This contract provides test functions for Arithmetic operator replacement +contract AOR { + // Expect 4 mutants: + // a - b + // a * b + // a / b + // a % b + function plus(int256 a, int256 b) public pure returns (int256) { + return a + b; + } + + // Expect 4 mutants: + // a + b + // a * b + // a / b + // a % b + /// ArithmeticOperatorReplacement(`-` |==> `+`) of: `return a - b;` + function minus(int256 a, int256 b) public pure returns (int256) { + return a + b; + } + + // Expect 4 mutants: + // a - b + // a * b + // a / b + // a % b + function times_with_parens( + int256 a, + int256 b + ) public pure returns (int256) { + return ((a)) * b; + } + + // Expect 5 mutants: + // a + b + // a - b + // a / b + // a ** b + // a % b + function unsigned_times_with_parens( + uint256 a, + uint256 b + ) public pure returns (uint256) { + return ((a)) * b; + } + + // Expect 5 mutants: + // a + b + // a - b + // a / b + // a * b + // a % b + + function power(uint256 a, uint256 b) public pure returns (uint256) { + return a ** b; + } +} diff --git a/resources/regressions/test_log_invalid.json/mutants/50/ROR/ROR.sol b/resources/regressions/test_log_invalid.json/mutants/50/ROR/ROR.sol new file mode 100644 index 0000000..0c05265 --- /dev/null +++ b/resources/regressions/test_log_invalid.json/mutants/50/ROR/ROR.sol @@ -0,0 +1,65 @@ +// SPDX-License-Identifier: GPL-3.0-only +pragma solidity >0.7.0; +pragma experimental ABIEncoderV2; + +// This contract provides test functions for relational operator replacement (ROR) +contract ROR { + // Expect 3 mutants: x <= y, x != y, false + /// RelationalOperatorReplacement(`<` |==> `!=`) of: `return x < y;` + function less(uint256 x, uint256 y) public pure returns (bool) { + return x != y; + } + + // Expect 3 mutants: x < y, x == y, true + function less_equal(uint256 x, uint256 y) public pure returns (bool) { + return x <= y; + } + + // Expect 3 mutants: x >= y, x != y, false + function more(uint256 x, uint256 y) public pure returns (bool) { + return x > y; + } + + // Expect 3 mutants: x > y, x == y, true + function more_equal(uint256 x, uint256 y) public pure returns (bool) { + return x >= y; + } + + // Expect 3 mutants: x >= y, x <= y, false + function equal_ord(uint256 x, uint256 y) public pure returns (bool) { + return x == y; + } + + // Expect 2 mutants: true, false + function equal_not_ord(bool x, bool y) public pure returns (bool) { + return x == y; + } + + // Expect 3 mutants: x > y, x < y, true + function not_equal_ord(uint256 x, uint256 y) public pure returns (bool) { + return x != y; + } + + // Expect 2 mutants: true, false + function not_equal_not_ord(bool x, bool y) public pure returns (bool) { + return x != y; + } + + // Expect 3 mutants: (x + y) > z, (x + y) == z, true + function more_equal_over_aor( + uint256 x, + uint256 y, + uint256 z + ) public pure returns (bool) { + return (x + y) >= z; + } + + // Expect 3 mutants: (x + y) > z, (x + y) < z, true + function not_equal_over_aor( + uint256 x, + uint256 y, + uint256 z + ) public pure returns (bool) { + return (x + y) != z; + } +} diff --git a/resources/regressions/test_log_invalid.json/mutants/51/ROR/ROR.sol b/resources/regressions/test_log_invalid.json/mutants/51/ROR/ROR.sol new file mode 100644 index 0000000..6141947 --- /dev/null +++ b/resources/regressions/test_log_invalid.json/mutants/51/ROR/ROR.sol @@ -0,0 +1,65 @@ +// SPDX-License-Identifier: GPL-3.0-only +pragma solidity >0.7.0; +pragma experimental ABIEncoderV2; + +// This contract provides test functions for relational operator replacement (ROR) +contract ROR { + // Expect 3 mutants: x <= y, x != y, false + /// RelationalOperatorReplacement(`x < y` |==> `false`) of: `return x < y;` + function less(uint256 x, uint256 y) public pure returns (bool) { + return false; + } + + // Expect 3 mutants: x < y, x == y, true + function less_equal(uint256 x, uint256 y) public pure returns (bool) { + return x <= y; + } + + // Expect 3 mutants: x >= y, x != y, false + function more(uint256 x, uint256 y) public pure returns (bool) { + return x > y; + } + + // Expect 3 mutants: x > y, x == y, true + function more_equal(uint256 x, uint256 y) public pure returns (bool) { + return x >= y; + } + + // Expect 3 mutants: x >= y, x <= y, false + function equal_ord(uint256 x, uint256 y) public pure returns (bool) { + return x == y; + } + + // Expect 2 mutants: true, false + function equal_not_ord(bool x, bool y) public pure returns (bool) { + return x == y; + } + + // Expect 3 mutants: x > y, x < y, true + function not_equal_ord(uint256 x, uint256 y) public pure returns (bool) { + return x != y; + } + + // Expect 2 mutants: true, false + function not_equal_not_ord(bool x, bool y) public pure returns (bool) { + return x != y; + } + + // Expect 3 mutants: (x + y) > z, (x + y) == z, true + function more_equal_over_aor( + uint256 x, + uint256 y, + uint256 z + ) public pure returns (bool) { + return (x + y) >= z; + } + + // Expect 3 mutants: (x + y) > z, (x + y) < z, true + function not_equal_over_aor( + uint256 x, + uint256 y, + uint256 z + ) public pure returns (bool) { + return (x + y) != z; + } +} diff --git a/resources/regressions/test_log_invalid.json/mutants/52/ROR/ROR.sol b/resources/regressions/test_log_invalid.json/mutants/52/ROR/ROR.sol new file mode 100644 index 0000000..9f8ccd0 --- /dev/null +++ b/resources/regressions/test_log_invalid.json/mutants/52/ROR/ROR.sol @@ -0,0 +1,65 @@ +// SPDX-License-Identifier: GPL-3.0-only +pragma solidity >0.7.0; +pragma experimental ABIEncoderV2; + +// This contract provides test functions for relational operator replacement (ROR) +contract ROR { + // Expect 3 mutants: x <= y, x != y, false + function less(uint256 x, uint256 y) public pure returns (bool) { + return x < y; + } + + // Expect 3 mutants: x < y, x == y, true + /// RelationalOperatorReplacement(`<=` |==> `<`) of: `return x <= y;` + function less_equal(uint256 x, uint256 y) public pure returns (bool) { + return x < y; + } + + // Expect 3 mutants: x >= y, x != y, false + function more(uint256 x, uint256 y) public pure returns (bool) { + return x > y; + } + + // Expect 3 mutants: x > y, x == y, true + function more_equal(uint256 x, uint256 y) public pure returns (bool) { + return x >= y; + } + + // Expect 3 mutants: x >= y, x <= y, false + function equal_ord(uint256 x, uint256 y) public pure returns (bool) { + return x == y; + } + + // Expect 2 mutants: true, false + function equal_not_ord(bool x, bool y) public pure returns (bool) { + return x == y; + } + + // Expect 3 mutants: x > y, x < y, true + function not_equal_ord(uint256 x, uint256 y) public pure returns (bool) { + return x != y; + } + + // Expect 2 mutants: true, false + function not_equal_not_ord(bool x, bool y) public pure returns (bool) { + return x != y; + } + + // Expect 3 mutants: (x + y) > z, (x + y) == z, true + function more_equal_over_aor( + uint256 x, + uint256 y, + uint256 z + ) public pure returns (bool) { + return (x + y) >= z; + } + + // Expect 3 mutants: (x + y) > z, (x + y) < z, true + function not_equal_over_aor( + uint256 x, + uint256 y, + uint256 z + ) public pure returns (bool) { + return (x + y) != z; + } +} diff --git a/resources/regressions/test_log_invalid.json/mutants/53/ROR/ROR.sol b/resources/regressions/test_log_invalid.json/mutants/53/ROR/ROR.sol new file mode 100644 index 0000000..18e38f3 --- /dev/null +++ b/resources/regressions/test_log_invalid.json/mutants/53/ROR/ROR.sol @@ -0,0 +1,65 @@ +// SPDX-License-Identifier: GPL-3.0-only +pragma solidity >0.7.0; +pragma experimental ABIEncoderV2; + +// This contract provides test functions for relational operator replacement (ROR) +contract ROR { + // Expect 3 mutants: x <= y, x != y, false + function less(uint256 x, uint256 y) public pure returns (bool) { + return x < y; + } + + // Expect 3 mutants: x < y, x == y, true + /// RelationalOperatorReplacement(`<=` |==> `==`) of: `return x <= y;` + function less_equal(uint256 x, uint256 y) public pure returns (bool) { + return x == y; + } + + // Expect 3 mutants: x >= y, x != y, false + function more(uint256 x, uint256 y) public pure returns (bool) { + return x > y; + } + + // Expect 3 mutants: x > y, x == y, true + function more_equal(uint256 x, uint256 y) public pure returns (bool) { + return x >= y; + } + + // Expect 3 mutants: x >= y, x <= y, false + function equal_ord(uint256 x, uint256 y) public pure returns (bool) { + return x == y; + } + + // Expect 2 mutants: true, false + function equal_not_ord(bool x, bool y) public pure returns (bool) { + return x == y; + } + + // Expect 3 mutants: x > y, x < y, true + function not_equal_ord(uint256 x, uint256 y) public pure returns (bool) { + return x != y; + } + + // Expect 2 mutants: true, false + function not_equal_not_ord(bool x, bool y) public pure returns (bool) { + return x != y; + } + + // Expect 3 mutants: (x + y) > z, (x + y) == z, true + function more_equal_over_aor( + uint256 x, + uint256 y, + uint256 z + ) public pure returns (bool) { + return (x + y) >= z; + } + + // Expect 3 mutants: (x + y) > z, (x + y) < z, true + function not_equal_over_aor( + uint256 x, + uint256 y, + uint256 z + ) public pure returns (bool) { + return (x + y) != z; + } +} diff --git a/resources/regressions/test_log_invalid.json/mutants/54/ROR/ROR.sol b/resources/regressions/test_log_invalid.json/mutants/54/ROR/ROR.sol new file mode 100644 index 0000000..55dd7c7 --- /dev/null +++ b/resources/regressions/test_log_invalid.json/mutants/54/ROR/ROR.sol @@ -0,0 +1,65 @@ +// SPDX-License-Identifier: GPL-3.0-only +pragma solidity >0.7.0; +pragma experimental ABIEncoderV2; + +// This contract provides test functions for relational operator replacement (ROR) +contract ROR { + // Expect 3 mutants: x <= y, x != y, false + function less(uint256 x, uint256 y) public pure returns (bool) { + return x < y; + } + + // Expect 3 mutants: x < y, x == y, true + /// RelationalOperatorReplacement(`x <= y` |==> `true`) of: `return x <= y;` + function less_equal(uint256 x, uint256 y) public pure returns (bool) { + return true; + } + + // Expect 3 mutants: x >= y, x != y, false + function more(uint256 x, uint256 y) public pure returns (bool) { + return x > y; + } + + // Expect 3 mutants: x > y, x == y, true + function more_equal(uint256 x, uint256 y) public pure returns (bool) { + return x >= y; + } + + // Expect 3 mutants: x >= y, x <= y, false + function equal_ord(uint256 x, uint256 y) public pure returns (bool) { + return x == y; + } + + // Expect 2 mutants: true, false + function equal_not_ord(bool x, bool y) public pure returns (bool) { + return x == y; + } + + // Expect 3 mutants: x > y, x < y, true + function not_equal_ord(uint256 x, uint256 y) public pure returns (bool) { + return x != y; + } + + // Expect 2 mutants: true, false + function not_equal_not_ord(bool x, bool y) public pure returns (bool) { + return x != y; + } + + // Expect 3 mutants: (x + y) > z, (x + y) == z, true + function more_equal_over_aor( + uint256 x, + uint256 y, + uint256 z + ) public pure returns (bool) { + return (x + y) >= z; + } + + // Expect 3 mutants: (x + y) > z, (x + y) < z, true + function not_equal_over_aor( + uint256 x, + uint256 y, + uint256 z + ) public pure returns (bool) { + return (x + y) != z; + } +} diff --git a/resources/regressions/test_log_invalid.json/mutants/55/ROR/ROR.sol b/resources/regressions/test_log_invalid.json/mutants/55/ROR/ROR.sol new file mode 100644 index 0000000..52949d0 --- /dev/null +++ b/resources/regressions/test_log_invalid.json/mutants/55/ROR/ROR.sol @@ -0,0 +1,65 @@ +// SPDX-License-Identifier: GPL-3.0-only +pragma solidity >0.7.0; +pragma experimental ABIEncoderV2; + +// This contract provides test functions for relational operator replacement (ROR) +contract ROR { + // Expect 3 mutants: x <= y, x != y, false + function less(uint256 x, uint256 y) public pure returns (bool) { + return x < y; + } + + // Expect 3 mutants: x < y, x == y, true + function less_equal(uint256 x, uint256 y) public pure returns (bool) { + return x <= y; + } + + // Expect 3 mutants: x >= y, x != y, false + /// RelationalOperatorReplacement(`>` |==> `>=`) of: `return x > y;` + function more(uint256 x, uint256 y) public pure returns (bool) { + return x >= y; + } + + // Expect 3 mutants: x > y, x == y, true + function more_equal(uint256 x, uint256 y) public pure returns (bool) { + return x >= y; + } + + // Expect 3 mutants: x >= y, x <= y, false + function equal_ord(uint256 x, uint256 y) public pure returns (bool) { + return x == y; + } + + // Expect 2 mutants: true, false + function equal_not_ord(bool x, bool y) public pure returns (bool) { + return x == y; + } + + // Expect 3 mutants: x > y, x < y, true + function not_equal_ord(uint256 x, uint256 y) public pure returns (bool) { + return x != y; + } + + // Expect 2 mutants: true, false + function not_equal_not_ord(bool x, bool y) public pure returns (bool) { + return x != y; + } + + // Expect 3 mutants: (x + y) > z, (x + y) == z, true + function more_equal_over_aor( + uint256 x, + uint256 y, + uint256 z + ) public pure returns (bool) { + return (x + y) >= z; + } + + // Expect 3 mutants: (x + y) > z, (x + y) < z, true + function not_equal_over_aor( + uint256 x, + uint256 y, + uint256 z + ) public pure returns (bool) { + return (x + y) != z; + } +} diff --git a/resources/regressions/test_log_invalid.json/mutants/56/ROR/ROR.sol b/resources/regressions/test_log_invalid.json/mutants/56/ROR/ROR.sol new file mode 100644 index 0000000..a3e1632 --- /dev/null +++ b/resources/regressions/test_log_invalid.json/mutants/56/ROR/ROR.sol @@ -0,0 +1,65 @@ +// SPDX-License-Identifier: GPL-3.0-only +pragma solidity >0.7.0; +pragma experimental ABIEncoderV2; + +// This contract provides test functions for relational operator replacement (ROR) +contract ROR { + // Expect 3 mutants: x <= y, x != y, false + function less(uint256 x, uint256 y) public pure returns (bool) { + return x < y; + } + + // Expect 3 mutants: x < y, x == y, true + function less_equal(uint256 x, uint256 y) public pure returns (bool) { + return x <= y; + } + + // Expect 3 mutants: x >= y, x != y, false + /// RelationalOperatorReplacement(`>` |==> `!=`) of: `return x > y;` + function more(uint256 x, uint256 y) public pure returns (bool) { + return x != y; + } + + // Expect 3 mutants: x > y, x == y, true + function more_equal(uint256 x, uint256 y) public pure returns (bool) { + return x >= y; + } + + // Expect 3 mutants: x >= y, x <= y, false + function equal_ord(uint256 x, uint256 y) public pure returns (bool) { + return x == y; + } + + // Expect 2 mutants: true, false + function equal_not_ord(bool x, bool y) public pure returns (bool) { + return x == y; + } + + // Expect 3 mutants: x > y, x < y, true + function not_equal_ord(uint256 x, uint256 y) public pure returns (bool) { + return x != y; + } + + // Expect 2 mutants: true, false + function not_equal_not_ord(bool x, bool y) public pure returns (bool) { + return x != y; + } + + // Expect 3 mutants: (x + y) > z, (x + y) == z, true + function more_equal_over_aor( + uint256 x, + uint256 y, + uint256 z + ) public pure returns (bool) { + return (x + y) >= z; + } + + // Expect 3 mutants: (x + y) > z, (x + y) < z, true + function not_equal_over_aor( + uint256 x, + uint256 y, + uint256 z + ) public pure returns (bool) { + return (x + y) != z; + } +} diff --git a/resources/regressions/test_log_invalid.json/mutants/57/ROR/ROR.sol b/resources/regressions/test_log_invalid.json/mutants/57/ROR/ROR.sol new file mode 100644 index 0000000..a902442 --- /dev/null +++ b/resources/regressions/test_log_invalid.json/mutants/57/ROR/ROR.sol @@ -0,0 +1,65 @@ +// SPDX-License-Identifier: GPL-3.0-only +pragma solidity >0.7.0; +pragma experimental ABIEncoderV2; + +// This contract provides test functions for relational operator replacement (ROR) +contract ROR { + // Expect 3 mutants: x <= y, x != y, false + function less(uint256 x, uint256 y) public pure returns (bool) { + return x < y; + } + + // Expect 3 mutants: x < y, x == y, true + function less_equal(uint256 x, uint256 y) public pure returns (bool) { + return x <= y; + } + + // Expect 3 mutants: x >= y, x != y, false + /// RelationalOperatorReplacement(`x > y` |==> `false`) of: `return x > y;` + function more(uint256 x, uint256 y) public pure returns (bool) { + return false; + } + + // Expect 3 mutants: x > y, x == y, true + function more_equal(uint256 x, uint256 y) public pure returns (bool) { + return x >= y; + } + + // Expect 3 mutants: x >= y, x <= y, false + function equal_ord(uint256 x, uint256 y) public pure returns (bool) { + return x == y; + } + + // Expect 2 mutants: true, false + function equal_not_ord(bool x, bool y) public pure returns (bool) { + return x == y; + } + + // Expect 3 mutants: x > y, x < y, true + function not_equal_ord(uint256 x, uint256 y) public pure returns (bool) { + return x != y; + } + + // Expect 2 mutants: true, false + function not_equal_not_ord(bool x, bool y) public pure returns (bool) { + return x != y; + } + + // Expect 3 mutants: (x + y) > z, (x + y) == z, true + function more_equal_over_aor( + uint256 x, + uint256 y, + uint256 z + ) public pure returns (bool) { + return (x + y) >= z; + } + + // Expect 3 mutants: (x + y) > z, (x + y) < z, true + function not_equal_over_aor( + uint256 x, + uint256 y, + uint256 z + ) public pure returns (bool) { + return (x + y) != z; + } +} diff --git a/resources/regressions/test_log_invalid.json/mutants/58/ROR/ROR.sol b/resources/regressions/test_log_invalid.json/mutants/58/ROR/ROR.sol new file mode 100644 index 0000000..337c9a9 --- /dev/null +++ b/resources/regressions/test_log_invalid.json/mutants/58/ROR/ROR.sol @@ -0,0 +1,65 @@ +// SPDX-License-Identifier: GPL-3.0-only +pragma solidity >0.7.0; +pragma experimental ABIEncoderV2; + +// This contract provides test functions for relational operator replacement (ROR) +contract ROR { + // Expect 3 mutants: x <= y, x != y, false + function less(uint256 x, uint256 y) public pure returns (bool) { + return x < y; + } + + // Expect 3 mutants: x < y, x == y, true + function less_equal(uint256 x, uint256 y) public pure returns (bool) { + return x <= y; + } + + // Expect 3 mutants: x >= y, x != y, false + function more(uint256 x, uint256 y) public pure returns (bool) { + return x > y; + } + + // Expect 3 mutants: x > y, x == y, true + /// RelationalOperatorReplacement(`>=` |==> `>`) of: `return x >= y;` + function more_equal(uint256 x, uint256 y) public pure returns (bool) { + return x > y; + } + + // Expect 3 mutants: x >= y, x <= y, false + function equal_ord(uint256 x, uint256 y) public pure returns (bool) { + return x == y; + } + + // Expect 2 mutants: true, false + function equal_not_ord(bool x, bool y) public pure returns (bool) { + return x == y; + } + + // Expect 3 mutants: x > y, x < y, true + function not_equal_ord(uint256 x, uint256 y) public pure returns (bool) { + return x != y; + } + + // Expect 2 mutants: true, false + function not_equal_not_ord(bool x, bool y) public pure returns (bool) { + return x != y; + } + + // Expect 3 mutants: (x + y) > z, (x + y) == z, true + function more_equal_over_aor( + uint256 x, + uint256 y, + uint256 z + ) public pure returns (bool) { + return (x + y) >= z; + } + + // Expect 3 mutants: (x + y) > z, (x + y) < z, true + function not_equal_over_aor( + uint256 x, + uint256 y, + uint256 z + ) public pure returns (bool) { + return (x + y) != z; + } +} diff --git a/resources/regressions/test_log_invalid.json/mutants/59/ROR/ROR.sol b/resources/regressions/test_log_invalid.json/mutants/59/ROR/ROR.sol new file mode 100644 index 0000000..7c02b73 --- /dev/null +++ b/resources/regressions/test_log_invalid.json/mutants/59/ROR/ROR.sol @@ -0,0 +1,65 @@ +// SPDX-License-Identifier: GPL-3.0-only +pragma solidity >0.7.0; +pragma experimental ABIEncoderV2; + +// This contract provides test functions for relational operator replacement (ROR) +contract ROR { + // Expect 3 mutants: x <= y, x != y, false + function less(uint256 x, uint256 y) public pure returns (bool) { + return x < y; + } + + // Expect 3 mutants: x < y, x == y, true + function less_equal(uint256 x, uint256 y) public pure returns (bool) { + return x <= y; + } + + // Expect 3 mutants: x >= y, x != y, false + function more(uint256 x, uint256 y) public pure returns (bool) { + return x > y; + } + + // Expect 3 mutants: x > y, x == y, true + /// RelationalOperatorReplacement(`>=` |==> `==`) of: `return x >= y;` + function more_equal(uint256 x, uint256 y) public pure returns (bool) { + return x == y; + } + + // Expect 3 mutants: x >= y, x <= y, false + function equal_ord(uint256 x, uint256 y) public pure returns (bool) { + return x == y; + } + + // Expect 2 mutants: true, false + function equal_not_ord(bool x, bool y) public pure returns (bool) { + return x == y; + } + + // Expect 3 mutants: x > y, x < y, true + function not_equal_ord(uint256 x, uint256 y) public pure returns (bool) { + return x != y; + } + + // Expect 2 mutants: true, false + function not_equal_not_ord(bool x, bool y) public pure returns (bool) { + return x != y; + } + + // Expect 3 mutants: (x + y) > z, (x + y) == z, true + function more_equal_over_aor( + uint256 x, + uint256 y, + uint256 z + ) public pure returns (bool) { + return (x + y) >= z; + } + + // Expect 3 mutants: (x + y) > z, (x + y) < z, true + function not_equal_over_aor( + uint256 x, + uint256 y, + uint256 z + ) public pure returns (bool) { + return (x + y) != z; + } +} diff --git a/resources/regressions/test_log_invalid.json/mutants/6/AOR/AOR.sol b/resources/regressions/test_log_invalid.json/mutants/6/AOR/AOR.sol new file mode 100644 index 0000000..2ca17b1 --- /dev/null +++ b/resources/regressions/test_log_invalid.json/mutants/6/AOR/AOR.sol @@ -0,0 +1,61 @@ +// SPDX-License-Identifier: GPL-3.0-only +pragma solidity >0.7.0; +pragma experimental ABIEncoderV2; + +// This contract provides test functions for Arithmetic operator replacement +contract AOR { + // Expect 4 mutants: + // a - b + // a * b + // a / b + // a % b + function plus(int256 a, int256 b) public pure returns (int256) { + return a + b; + } + + // Expect 4 mutants: + // a + b + // a * b + // a / b + // a % b + /// ArithmeticOperatorReplacement(`-` |==> `*`) of: `return a - b;` + function minus(int256 a, int256 b) public pure returns (int256) { + return a * b; + } + + // Expect 4 mutants: + // a - b + // a * b + // a / b + // a % b + function times_with_parens( + int256 a, + int256 b + ) public pure returns (int256) { + return ((a)) * b; + } + + // Expect 5 mutants: + // a + b + // a - b + // a / b + // a ** b + // a % b + function unsigned_times_with_parens( + uint256 a, + uint256 b + ) public pure returns (uint256) { + return ((a)) * b; + } + + // Expect 5 mutants: + // a + b + // a - b + // a / b + // a * b + // a % b + + function power(uint256 a, uint256 b) public pure returns (uint256) { + return a ** b; + } +} diff --git a/resources/regressions/test_log_invalid.json/mutants/60/ROR/ROR.sol b/resources/regressions/test_log_invalid.json/mutants/60/ROR/ROR.sol new file mode 100644 index 0000000..3d299df --- /dev/null +++ b/resources/regressions/test_log_invalid.json/mutants/60/ROR/ROR.sol @@ -0,0 +1,65 @@ +// SPDX-License-Identifier: GPL-3.0-only +pragma solidity >0.7.0; +pragma experimental ABIEncoderV2; + +// This contract provides test functions for relational operator replacement (ROR) +contract ROR { + // Expect 3 mutants: x <= y, x != y, false + function less(uint256 x, uint256 y) public pure returns (bool) { + return x < y; + } + + // Expect 3 mutants: x < y, x == y, true + function less_equal(uint256 x, uint256 y) public pure returns (bool) { + return x <= y; + } + + // Expect 3 mutants: x >= y, x != y, false + function more(uint256 x, uint256 y) public pure returns (bool) { + return x > y; + } + + // Expect 3 mutants: x > y, x == y, true + /// RelationalOperatorReplacement(`x >= y` |==> `true`) of: `return x >= y;` + function more_equal(uint256 x, uint256 y) public pure returns (bool) { + return true; + } + + // Expect 3 mutants: x >= y, x <= y, false + function equal_ord(uint256 x, uint256 y) public pure returns (bool) { + return x == y; + } + + // Expect 2 mutants: true, false + function equal_not_ord(bool x, bool y) public pure returns (bool) { + return x == y; + } + + // Expect 3 mutants: x > y, x < y, true + function not_equal_ord(uint256 x, uint256 y) public pure returns (bool) { + return x != y; + } + + // Expect 2 mutants: true, false + function not_equal_not_ord(bool x, bool y) public pure returns (bool) { + return x != y; + } + + // Expect 3 mutants: (x + y) > z, (x + y) == z, true + function more_equal_over_aor( + uint256 x, + uint256 y, + uint256 z + ) public pure returns (bool) { + return (x + y) >= z; + } + + // Expect 3 mutants: (x + y) > z, (x + y) < z, true + function not_equal_over_aor( + uint256 x, + uint256 y, + uint256 z + ) public pure returns (bool) { + return (x + y) != z; + } +} diff --git a/resources/regressions/test_log_invalid.json/mutants/61/ROR/ROR.sol b/resources/regressions/test_log_invalid.json/mutants/61/ROR/ROR.sol new file mode 100644 index 0000000..c865469 --- /dev/null +++ b/resources/regressions/test_log_invalid.json/mutants/61/ROR/ROR.sol @@ -0,0 +1,65 @@ +// SPDX-License-Identifier: GPL-3.0-only +pragma solidity >0.7.0; +pragma experimental ABIEncoderV2; + +// This contract provides test functions for relational operator replacement (ROR) +contract ROR { + // Expect 3 mutants: x <= y, x != y, false + function less(uint256 x, uint256 y) public pure returns (bool) { + return x < y; + } + + // Expect 3 mutants: x < y, x == y, true + function less_equal(uint256 x, uint256 y) public pure returns (bool) { + return x <= y; + } + + // Expect 3 mutants: x >= y, x != y, false + function more(uint256 x, uint256 y) public pure returns (bool) { + return x > y; + } + + // Expect 3 mutants: x > y, x == y, true + function more_equal(uint256 x, uint256 y) public pure returns (bool) { + return x >= y; + } + + // Expect 3 mutants: x >= y, x <= y, false + /// RelationalOperatorReplacement(`==` |==> `<=`) of: `return x == y;` + function equal_ord(uint256 x, uint256 y) public pure returns (bool) { + return x <= y; + } + + // Expect 2 mutants: true, false + function equal_not_ord(bool x, bool y) public pure returns (bool) { + return x == y; + } + + // Expect 3 mutants: x > y, x < y, true + function not_equal_ord(uint256 x, uint256 y) public pure returns (bool) { + return x != y; + } + + // Expect 2 mutants: true, false + function not_equal_not_ord(bool x, bool y) public pure returns (bool) { + return x != y; + } + + // Expect 3 mutants: (x + y) > z, (x + y) == z, true + function more_equal_over_aor( + uint256 x, + uint256 y, + uint256 z + ) public pure returns (bool) { + return (x + y) >= z; + } + + // Expect 3 mutants: (x + y) > z, (x + y) < z, true + function not_equal_over_aor( + uint256 x, + uint256 y, + uint256 z + ) public pure returns (bool) { + return (x + y) != z; + } +} diff --git a/resources/regressions/test_log_invalid.json/mutants/62/ROR/ROR.sol b/resources/regressions/test_log_invalid.json/mutants/62/ROR/ROR.sol new file mode 100644 index 0000000..8cdc1c1 --- /dev/null +++ b/resources/regressions/test_log_invalid.json/mutants/62/ROR/ROR.sol @@ -0,0 +1,65 @@ +// SPDX-License-Identifier: GPL-3.0-only +pragma solidity >0.7.0; +pragma experimental ABIEncoderV2; + +// This contract provides test functions for relational operator replacement (ROR) +contract ROR { + // Expect 3 mutants: x <= y, x != y, false + function less(uint256 x, uint256 y) public pure returns (bool) { + return x < y; + } + + // Expect 3 mutants: x < y, x == y, true + function less_equal(uint256 x, uint256 y) public pure returns (bool) { + return x <= y; + } + + // Expect 3 mutants: x >= y, x != y, false + function more(uint256 x, uint256 y) public pure returns (bool) { + return x > y; + } + + // Expect 3 mutants: x > y, x == y, true + function more_equal(uint256 x, uint256 y) public pure returns (bool) { + return x >= y; + } + + // Expect 3 mutants: x >= y, x <= y, false + /// RelationalOperatorReplacement(`==` |==> `>=`) of: `return x == y;` + function equal_ord(uint256 x, uint256 y) public pure returns (bool) { + return x >= y; + } + + // Expect 2 mutants: true, false + function equal_not_ord(bool x, bool y) public pure returns (bool) { + return x == y; + } + + // Expect 3 mutants: x > y, x < y, true + function not_equal_ord(uint256 x, uint256 y) public pure returns (bool) { + return x != y; + } + + // Expect 2 mutants: true, false + function not_equal_not_ord(bool x, bool y) public pure returns (bool) { + return x != y; + } + + // Expect 3 mutants: (x + y) > z, (x + y) == z, true + function more_equal_over_aor( + uint256 x, + uint256 y, + uint256 z + ) public pure returns (bool) { + return (x + y) >= z; + } + + // Expect 3 mutants: (x + y) > z, (x + y) < z, true + function not_equal_over_aor( + uint256 x, + uint256 y, + uint256 z + ) public pure returns (bool) { + return (x + y) != z; + } +} diff --git a/resources/regressions/test_log_invalid.json/mutants/63/ROR/ROR.sol b/resources/regressions/test_log_invalid.json/mutants/63/ROR/ROR.sol new file mode 100644 index 0000000..de6a436 --- /dev/null +++ b/resources/regressions/test_log_invalid.json/mutants/63/ROR/ROR.sol @@ -0,0 +1,65 @@ +// SPDX-License-Identifier: GPL-3.0-only +pragma solidity >0.7.0; +pragma experimental ABIEncoderV2; + +// This contract provides test functions for relational operator replacement (ROR) +contract ROR { + // Expect 3 mutants: x <= y, x != y, false + function less(uint256 x, uint256 y) public pure returns (bool) { + return x < y; + } + + // Expect 3 mutants: x < y, x == y, true + function less_equal(uint256 x, uint256 y) public pure returns (bool) { + return x <= y; + } + + // Expect 3 mutants: x >= y, x != y, false + function more(uint256 x, uint256 y) public pure returns (bool) { + return x > y; + } + + // Expect 3 mutants: x > y, x == y, true + function more_equal(uint256 x, uint256 y) public pure returns (bool) { + return x >= y; + } + + // Expect 3 mutants: x >= y, x <= y, false + /// RelationalOperatorReplacement(`x == y` |==> `false`) of: `return x == y;` + function equal_ord(uint256 x, uint256 y) public pure returns (bool) { + return false; + } + + // Expect 2 mutants: true, false + function equal_not_ord(bool x, bool y) public pure returns (bool) { + return x == y; + } + + // Expect 3 mutants: x > y, x < y, true + function not_equal_ord(uint256 x, uint256 y) public pure returns (bool) { + return x != y; + } + + // Expect 2 mutants: true, false + function not_equal_not_ord(bool x, bool y) public pure returns (bool) { + return x != y; + } + + // Expect 3 mutants: (x + y) > z, (x + y) == z, true + function more_equal_over_aor( + uint256 x, + uint256 y, + uint256 z + ) public pure returns (bool) { + return (x + y) >= z; + } + + // Expect 3 mutants: (x + y) > z, (x + y) < z, true + function not_equal_over_aor( + uint256 x, + uint256 y, + uint256 z + ) public pure returns (bool) { + return (x + y) != z; + } +} diff --git a/resources/regressions/test_log_invalid.json/mutants/64/ROR/ROR.sol b/resources/regressions/test_log_invalid.json/mutants/64/ROR/ROR.sol new file mode 100644 index 0000000..ab40e6c --- /dev/null +++ b/resources/regressions/test_log_invalid.json/mutants/64/ROR/ROR.sol @@ -0,0 +1,65 @@ +// SPDX-License-Identifier: GPL-3.0-only +pragma solidity >0.7.0; +pragma experimental ABIEncoderV2; + +// This contract provides test functions for relational operator replacement (ROR) +contract ROR { + // Expect 3 mutants: x <= y, x != y, false + function less(uint256 x, uint256 y) public pure returns (bool) { + return x < y; + } + + // Expect 3 mutants: x < y, x == y, true + function less_equal(uint256 x, uint256 y) public pure returns (bool) { + return x <= y; + } + + // Expect 3 mutants: x >= y, x != y, false + function more(uint256 x, uint256 y) public pure returns (bool) { + return x > y; + } + + // Expect 3 mutants: x > y, x == y, true + function more_equal(uint256 x, uint256 y) public pure returns (bool) { + return x >= y; + } + + // Expect 3 mutants: x >= y, x <= y, false + function equal_ord(uint256 x, uint256 y) public pure returns (bool) { + return x == y; + } + + // Expect 2 mutants: true, false + /// RelationalOperatorReplacement(`x == y` |==> `false`) of: `return x == y;` + function equal_not_ord(bool x, bool y) public pure returns (bool) { + return false; + } + + // Expect 3 mutants: x > y, x < y, true + function not_equal_ord(uint256 x, uint256 y) public pure returns (bool) { + return x != y; + } + + // Expect 2 mutants: true, false + function not_equal_not_ord(bool x, bool y) public pure returns (bool) { + return x != y; + } + + // Expect 3 mutants: (x + y) > z, (x + y) == z, true + function more_equal_over_aor( + uint256 x, + uint256 y, + uint256 z + ) public pure returns (bool) { + return (x + y) >= z; + } + + // Expect 3 mutants: (x + y) > z, (x + y) < z, true + function not_equal_over_aor( + uint256 x, + uint256 y, + uint256 z + ) public pure returns (bool) { + return (x + y) != z; + } +} diff --git a/resources/regressions/test_log_invalid.json/mutants/65/ROR/ROR.sol b/resources/regressions/test_log_invalid.json/mutants/65/ROR/ROR.sol new file mode 100644 index 0000000..f42e7b7 --- /dev/null +++ b/resources/regressions/test_log_invalid.json/mutants/65/ROR/ROR.sol @@ -0,0 +1,65 @@ +// SPDX-License-Identifier: GPL-3.0-only +pragma solidity >0.7.0; +pragma experimental ABIEncoderV2; + +// This contract provides test functions for relational operator replacement (ROR) +contract ROR { + // Expect 3 mutants: x <= y, x != y, false + function less(uint256 x, uint256 y) public pure returns (bool) { + return x < y; + } + + // Expect 3 mutants: x < y, x == y, true + function less_equal(uint256 x, uint256 y) public pure returns (bool) { + return x <= y; + } + + // Expect 3 mutants: x >= y, x != y, false + function more(uint256 x, uint256 y) public pure returns (bool) { + return x > y; + } + + // Expect 3 mutants: x > y, x == y, true + function more_equal(uint256 x, uint256 y) public pure returns (bool) { + return x >= y; + } + + // Expect 3 mutants: x >= y, x <= y, false + function equal_ord(uint256 x, uint256 y) public pure returns (bool) { + return x == y; + } + + // Expect 2 mutants: true, false + function equal_not_ord(bool x, bool y) public pure returns (bool) { + return x == y; + } + + // Expect 3 mutants: x > y, x < y, true + /// RelationalOperatorReplacement(`!=` |==> `<`) of: `return x != y;` + function not_equal_ord(uint256 x, uint256 y) public pure returns (bool) { + return x < y; + } + + // Expect 2 mutants: true, false + function not_equal_not_ord(bool x, bool y) public pure returns (bool) { + return x != y; + } + + // Expect 3 mutants: (x + y) > z, (x + y) == z, true + function more_equal_over_aor( + uint256 x, + uint256 y, + uint256 z + ) public pure returns (bool) { + return (x + y) >= z; + } + + // Expect 3 mutants: (x + y) > z, (x + y) < z, true + function not_equal_over_aor( + uint256 x, + uint256 y, + uint256 z + ) public pure returns (bool) { + return (x + y) != z; + } +} diff --git a/resources/regressions/test_log_invalid.json/mutants/66/ROR/ROR.sol b/resources/regressions/test_log_invalid.json/mutants/66/ROR/ROR.sol new file mode 100644 index 0000000..e5f5032 --- /dev/null +++ b/resources/regressions/test_log_invalid.json/mutants/66/ROR/ROR.sol @@ -0,0 +1,65 @@ +// SPDX-License-Identifier: GPL-3.0-only +pragma solidity >0.7.0; +pragma experimental ABIEncoderV2; + +// This contract provides test functions for relational operator replacement (ROR) +contract ROR { + // Expect 3 mutants: x <= y, x != y, false + function less(uint256 x, uint256 y) public pure returns (bool) { + return x < y; + } + + // Expect 3 mutants: x < y, x == y, true + function less_equal(uint256 x, uint256 y) public pure returns (bool) { + return x <= y; + } + + // Expect 3 mutants: x >= y, x != y, false + function more(uint256 x, uint256 y) public pure returns (bool) { + return x > y; + } + + // Expect 3 mutants: x > y, x == y, true + function more_equal(uint256 x, uint256 y) public pure returns (bool) { + return x >= y; + } + + // Expect 3 mutants: x >= y, x <= y, false + function equal_ord(uint256 x, uint256 y) public pure returns (bool) { + return x == y; + } + + // Expect 2 mutants: true, false + function equal_not_ord(bool x, bool y) public pure returns (bool) { + return x == y; + } + + // Expect 3 mutants: x > y, x < y, true + /// RelationalOperatorReplacement(`!=` |==> `>`) of: `return x != y;` + function not_equal_ord(uint256 x, uint256 y) public pure returns (bool) { + return x > y; + } + + // Expect 2 mutants: true, false + function not_equal_not_ord(bool x, bool y) public pure returns (bool) { + return x != y; + } + + // Expect 3 mutants: (x + y) > z, (x + y) == z, true + function more_equal_over_aor( + uint256 x, + uint256 y, + uint256 z + ) public pure returns (bool) { + return (x + y) >= z; + } + + // Expect 3 mutants: (x + y) > z, (x + y) < z, true + function not_equal_over_aor( + uint256 x, + uint256 y, + uint256 z + ) public pure returns (bool) { + return (x + y) != z; + } +} diff --git a/resources/regressions/test_log_invalid.json/mutants/67/ROR/ROR.sol b/resources/regressions/test_log_invalid.json/mutants/67/ROR/ROR.sol new file mode 100644 index 0000000..8368448 --- /dev/null +++ b/resources/regressions/test_log_invalid.json/mutants/67/ROR/ROR.sol @@ -0,0 +1,65 @@ +// SPDX-License-Identifier: GPL-3.0-only +pragma solidity >0.7.0; +pragma experimental ABIEncoderV2; + +// This contract provides test functions for relational operator replacement (ROR) +contract ROR { + // Expect 3 mutants: x <= y, x != y, false + function less(uint256 x, uint256 y) public pure returns (bool) { + return x < y; + } + + // Expect 3 mutants: x < y, x == y, true + function less_equal(uint256 x, uint256 y) public pure returns (bool) { + return x <= y; + } + + // Expect 3 mutants: x >= y, x != y, false + function more(uint256 x, uint256 y) public pure returns (bool) { + return x > y; + } + + // Expect 3 mutants: x > y, x == y, true + function more_equal(uint256 x, uint256 y) public pure returns (bool) { + return x >= y; + } + + // Expect 3 mutants: x >= y, x <= y, false + function equal_ord(uint256 x, uint256 y) public pure returns (bool) { + return x == y; + } + + // Expect 2 mutants: true, false + function equal_not_ord(bool x, bool y) public pure returns (bool) { + return x == y; + } + + // Expect 3 mutants: x > y, x < y, true + /// RelationalOperatorReplacement(`x != y` |==> `true`) of: `return x != y;` + function not_equal_ord(uint256 x, uint256 y) public pure returns (bool) { + return true; + } + + // Expect 2 mutants: true, false + function not_equal_not_ord(bool x, bool y) public pure returns (bool) { + return x != y; + } + + // Expect 3 mutants: (x + y) > z, (x + y) == z, true + function more_equal_over_aor( + uint256 x, + uint256 y, + uint256 z + ) public pure returns (bool) { + return (x + y) >= z; + } + + // Expect 3 mutants: (x + y) > z, (x + y) < z, true + function not_equal_over_aor( + uint256 x, + uint256 y, + uint256 z + ) public pure returns (bool) { + return (x + y) != z; + } +} diff --git a/resources/regressions/test_log_invalid.json/mutants/68/ROR/ROR.sol b/resources/regressions/test_log_invalid.json/mutants/68/ROR/ROR.sol new file mode 100644 index 0000000..3ae9213 --- /dev/null +++ b/resources/regressions/test_log_invalid.json/mutants/68/ROR/ROR.sol @@ -0,0 +1,65 @@ +// SPDX-License-Identifier: GPL-3.0-only +pragma solidity >0.7.0; +pragma experimental ABIEncoderV2; + +// This contract provides test functions for relational operator replacement (ROR) +contract ROR { + // Expect 3 mutants: x <= y, x != y, false + function less(uint256 x, uint256 y) public pure returns (bool) { + return x < y; + } + + // Expect 3 mutants: x < y, x == y, true + function less_equal(uint256 x, uint256 y) public pure returns (bool) { + return x <= y; + } + + // Expect 3 mutants: x >= y, x != y, false + function more(uint256 x, uint256 y) public pure returns (bool) { + return x > y; + } + + // Expect 3 mutants: x > y, x == y, true + function more_equal(uint256 x, uint256 y) public pure returns (bool) { + return x >= y; + } + + // Expect 3 mutants: x >= y, x <= y, false + function equal_ord(uint256 x, uint256 y) public pure returns (bool) { + return x == y; + } + + // Expect 2 mutants: true, false + function equal_not_ord(bool x, bool y) public pure returns (bool) { + return x == y; + } + + // Expect 3 mutants: x > y, x < y, true + function not_equal_ord(uint256 x, uint256 y) public pure returns (bool) { + return x != y; + } + + // Expect 2 mutants: true, false + /// RelationalOperatorReplacement(`x != y` |==> `true`) of: `return x != y;` + function not_equal_not_ord(bool x, bool y) public pure returns (bool) { + return true; + } + + // Expect 3 mutants: (x + y) > z, (x + y) == z, true + function more_equal_over_aor( + uint256 x, + uint256 y, + uint256 z + ) public pure returns (bool) { + return (x + y) >= z; + } + + // Expect 3 mutants: (x + y) > z, (x + y) < z, true + function not_equal_over_aor( + uint256 x, + uint256 y, + uint256 z + ) public pure returns (bool) { + return (x + y) != z; + } +} diff --git a/resources/regressions/test_log_invalid.json/mutants/69/ROR/ROR.sol b/resources/regressions/test_log_invalid.json/mutants/69/ROR/ROR.sol new file mode 100644 index 0000000..bdeac3a --- /dev/null +++ b/resources/regressions/test_log_invalid.json/mutants/69/ROR/ROR.sol @@ -0,0 +1,65 @@ +// SPDX-License-Identifier: GPL-3.0-only +pragma solidity >0.7.0; +pragma experimental ABIEncoderV2; + +// This contract provides test functions for relational operator replacement (ROR) +contract ROR { + // Expect 3 mutants: x <= y, x != y, false + function less(uint256 x, uint256 y) public pure returns (bool) { + return x < y; + } + + // Expect 3 mutants: x < y, x == y, true + function less_equal(uint256 x, uint256 y) public pure returns (bool) { + return x <= y; + } + + // Expect 3 mutants: x >= y, x != y, false + function more(uint256 x, uint256 y) public pure returns (bool) { + return x > y; + } + + // Expect 3 mutants: x > y, x == y, true + function more_equal(uint256 x, uint256 y) public pure returns (bool) { + return x >= y; + } + + // Expect 3 mutants: x >= y, x <= y, false + function equal_ord(uint256 x, uint256 y) public pure returns (bool) { + return x == y; + } + + // Expect 2 mutants: true, false + function equal_not_ord(bool x, bool y) public pure returns (bool) { + return x == y; + } + + // Expect 3 mutants: x > y, x < y, true + function not_equal_ord(uint256 x, uint256 y) public pure returns (bool) { + return x != y; + } + + // Expect 2 mutants: true, false + function not_equal_not_ord(bool x, bool y) public pure returns (bool) { + return x != y; + } + + // Expect 3 mutants: (x + y) > z, (x + y) == z, true + function more_equal_over_aor( + uint256 x, + uint256 y, + uint256 z + /// RelationalOperatorReplacement(`>=` |==> `>`) of: `return (x + y) >= z;` + ) public pure returns (bool) { + return (x + y) > z; + } + + // Expect 3 mutants: (x + y) > z, (x + y) < z, true + function not_equal_over_aor( + uint256 x, + uint256 y, + uint256 z + ) public pure returns (bool) { + return (x + y) != z; + } +} diff --git a/resources/regressions/test_log_invalid.json/mutants/7/AOR/AOR.sol b/resources/regressions/test_log_invalid.json/mutants/7/AOR/AOR.sol new file mode 100644 index 0000000..c07a6ae --- /dev/null +++ b/resources/regressions/test_log_invalid.json/mutants/7/AOR/AOR.sol @@ -0,0 +1,61 @@ +// SPDX-License-Identifier: GPL-3.0-only +pragma solidity >0.7.0; +pragma experimental ABIEncoderV2; + +// This contract provides test functions for Arithmetic operator replacement +contract AOR { + // Expect 4 mutants: + // a - b + // a * b + // a / b + // a % b + function plus(int256 a, int256 b) public pure returns (int256) { + return a + b; + } + + // Expect 4 mutants: + // a + b + // a * b + // a / b + // a % b + /// ArithmeticOperatorReplacement(`-` |==> `/`) of: `return a - b;` + function minus(int256 a, int256 b) public pure returns (int256) { + return a / b; + } + + // Expect 4 mutants: + // a - b + // a * b + // a / b + // a % b + function times_with_parens( + int256 a, + int256 b + ) public pure returns (int256) { + return ((a)) * b; + } + + // Expect 5 mutants: + // a + b + // a - b + // a / b + // a ** b + // a % b + function unsigned_times_with_parens( + uint256 a, + uint256 b + ) public pure returns (uint256) { + return ((a)) * b; + } + + // Expect 5 mutants: + // a + b + // a - b + // a / b + // a * b + // a % b + + function power(uint256 a, uint256 b) public pure returns (uint256) { + return a ** b; + } +} diff --git a/resources/regressions/test_log_invalid.json/mutants/70/ROR/ROR.sol b/resources/regressions/test_log_invalid.json/mutants/70/ROR/ROR.sol new file mode 100644 index 0000000..430379f --- /dev/null +++ b/resources/regressions/test_log_invalid.json/mutants/70/ROR/ROR.sol @@ -0,0 +1,65 @@ +// SPDX-License-Identifier: GPL-3.0-only +pragma solidity >0.7.0; +pragma experimental ABIEncoderV2; + +// This contract provides test functions for relational operator replacement (ROR) +contract ROR { + // Expect 3 mutants: x <= y, x != y, false + function less(uint256 x, uint256 y) public pure returns (bool) { + return x < y; + } + + // Expect 3 mutants: x < y, x == y, true + function less_equal(uint256 x, uint256 y) public pure returns (bool) { + return x <= y; + } + + // Expect 3 mutants: x >= y, x != y, false + function more(uint256 x, uint256 y) public pure returns (bool) { + return x > y; + } + + // Expect 3 mutants: x > y, x == y, true + function more_equal(uint256 x, uint256 y) public pure returns (bool) { + return x >= y; + } + + // Expect 3 mutants: x >= y, x <= y, false + function equal_ord(uint256 x, uint256 y) public pure returns (bool) { + return x == y; + } + + // Expect 2 mutants: true, false + function equal_not_ord(bool x, bool y) public pure returns (bool) { + return x == y; + } + + // Expect 3 mutants: x > y, x < y, true + function not_equal_ord(uint256 x, uint256 y) public pure returns (bool) { + return x != y; + } + + // Expect 2 mutants: true, false + function not_equal_not_ord(bool x, bool y) public pure returns (bool) { + return x != y; + } + + // Expect 3 mutants: (x + y) > z, (x + y) == z, true + function more_equal_over_aor( + uint256 x, + uint256 y, + uint256 z + /// RelationalOperatorReplacement(`>=` |==> `==`) of: `return (x + y) >= z;` + ) public pure returns (bool) { + return (x + y) == z; + } + + // Expect 3 mutants: (x + y) > z, (x + y) < z, true + function not_equal_over_aor( + uint256 x, + uint256 y, + uint256 z + ) public pure returns (bool) { + return (x + y) != z; + } +} diff --git a/resources/regressions/test_log_invalid.json/mutants/71/ROR/ROR.sol b/resources/regressions/test_log_invalid.json/mutants/71/ROR/ROR.sol new file mode 100644 index 0000000..3d67c15 --- /dev/null +++ b/resources/regressions/test_log_invalid.json/mutants/71/ROR/ROR.sol @@ -0,0 +1,65 @@ +// SPDX-License-Identifier: GPL-3.0-only +pragma solidity >0.7.0; +pragma experimental ABIEncoderV2; + +// This contract provides test functions for relational operator replacement (ROR) +contract ROR { + // Expect 3 mutants: x <= y, x != y, false + function less(uint256 x, uint256 y) public pure returns (bool) { + return x < y; + } + + // Expect 3 mutants: x < y, x == y, true + function less_equal(uint256 x, uint256 y) public pure returns (bool) { + return x <= y; + } + + // Expect 3 mutants: x >= y, x != y, false + function more(uint256 x, uint256 y) public pure returns (bool) { + return x > y; + } + + // Expect 3 mutants: x > y, x == y, true + function more_equal(uint256 x, uint256 y) public pure returns (bool) { + return x >= y; + } + + // Expect 3 mutants: x >= y, x <= y, false + function equal_ord(uint256 x, uint256 y) public pure returns (bool) { + return x == y; + } + + // Expect 2 mutants: true, false + function equal_not_ord(bool x, bool y) public pure returns (bool) { + return x == y; + } + + // Expect 3 mutants: x > y, x < y, true + function not_equal_ord(uint256 x, uint256 y) public pure returns (bool) { + return x != y; + } + + // Expect 2 mutants: true, false + function not_equal_not_ord(bool x, bool y) public pure returns (bool) { + return x != y; + } + + // Expect 3 mutants: (x + y) > z, (x + y) == z, true + function more_equal_over_aor( + uint256 x, + uint256 y, + uint256 z + /// RelationalOperatorReplacement(`(x + y) >= z` |==> `true`) of: `return (x + y) >= z;` + ) public pure returns (bool) { + return true; + } + + // Expect 3 mutants: (x + y) > z, (x + y) < z, true + function not_equal_over_aor( + uint256 x, + uint256 y, + uint256 z + ) public pure returns (bool) { + return (x + y) != z; + } +} diff --git a/resources/regressions/test_log_invalid.json/mutants/72/ROR/ROR.sol b/resources/regressions/test_log_invalid.json/mutants/72/ROR/ROR.sol new file mode 100644 index 0000000..1361261 --- /dev/null +++ b/resources/regressions/test_log_invalid.json/mutants/72/ROR/ROR.sol @@ -0,0 +1,65 @@ +// SPDX-License-Identifier: GPL-3.0-only +pragma solidity >0.7.0; +pragma experimental ABIEncoderV2; + +// This contract provides test functions for relational operator replacement (ROR) +contract ROR { + // Expect 3 mutants: x <= y, x != y, false + function less(uint256 x, uint256 y) public pure returns (bool) { + return x < y; + } + + // Expect 3 mutants: x < y, x == y, true + function less_equal(uint256 x, uint256 y) public pure returns (bool) { + return x <= y; + } + + // Expect 3 mutants: x >= y, x != y, false + function more(uint256 x, uint256 y) public pure returns (bool) { + return x > y; + } + + // Expect 3 mutants: x > y, x == y, true + function more_equal(uint256 x, uint256 y) public pure returns (bool) { + return x >= y; + } + + // Expect 3 mutants: x >= y, x <= y, false + function equal_ord(uint256 x, uint256 y) public pure returns (bool) { + return x == y; + } + + // Expect 2 mutants: true, false + function equal_not_ord(bool x, bool y) public pure returns (bool) { + return x == y; + } + + // Expect 3 mutants: x > y, x < y, true + function not_equal_ord(uint256 x, uint256 y) public pure returns (bool) { + return x != y; + } + + // Expect 2 mutants: true, false + function not_equal_not_ord(bool x, bool y) public pure returns (bool) { + return x != y; + } + + // Expect 3 mutants: (x + y) > z, (x + y) == z, true + function more_equal_over_aor( + uint256 x, + uint256 y, + uint256 z + ) public pure returns (bool) { + return (x + y) >= z; + } + + // Expect 3 mutants: (x + y) > z, (x + y) < z, true + function not_equal_over_aor( + uint256 x, + uint256 y, + uint256 z + /// RelationalOperatorReplacement(`!=` |==> `<`) of: `return (x + y) != z;` + ) public pure returns (bool) { + return (x + y) < z; + } +} diff --git a/resources/regressions/test_log_invalid.json/mutants/73/ROR/ROR.sol b/resources/regressions/test_log_invalid.json/mutants/73/ROR/ROR.sol new file mode 100644 index 0000000..dd0c83c --- /dev/null +++ b/resources/regressions/test_log_invalid.json/mutants/73/ROR/ROR.sol @@ -0,0 +1,65 @@ +// SPDX-License-Identifier: GPL-3.0-only +pragma solidity >0.7.0; +pragma experimental ABIEncoderV2; + +// This contract provides test functions for relational operator replacement (ROR) +contract ROR { + // Expect 3 mutants: x <= y, x != y, false + function less(uint256 x, uint256 y) public pure returns (bool) { + return x < y; + } + + // Expect 3 mutants: x < y, x == y, true + function less_equal(uint256 x, uint256 y) public pure returns (bool) { + return x <= y; + } + + // Expect 3 mutants: x >= y, x != y, false + function more(uint256 x, uint256 y) public pure returns (bool) { + return x > y; + } + + // Expect 3 mutants: x > y, x == y, true + function more_equal(uint256 x, uint256 y) public pure returns (bool) { + return x >= y; + } + + // Expect 3 mutants: x >= y, x <= y, false + function equal_ord(uint256 x, uint256 y) public pure returns (bool) { + return x == y; + } + + // Expect 2 mutants: true, false + function equal_not_ord(bool x, bool y) public pure returns (bool) { + return x == y; + } + + // Expect 3 mutants: x > y, x < y, true + function not_equal_ord(uint256 x, uint256 y) public pure returns (bool) { + return x != y; + } + + // Expect 2 mutants: true, false + function not_equal_not_ord(bool x, bool y) public pure returns (bool) { + return x != y; + } + + // Expect 3 mutants: (x + y) > z, (x + y) == z, true + function more_equal_over_aor( + uint256 x, + uint256 y, + uint256 z + ) public pure returns (bool) { + return (x + y) >= z; + } + + // Expect 3 mutants: (x + y) > z, (x + y) < z, true + function not_equal_over_aor( + uint256 x, + uint256 y, + uint256 z + /// RelationalOperatorReplacement(`!=` |==> `>`) of: `return (x + y) != z;` + ) public pure returns (bool) { + return (x + y) > z; + } +} diff --git a/resources/regressions/test_log_invalid.json/mutants/74/ROR/ROR.sol b/resources/regressions/test_log_invalid.json/mutants/74/ROR/ROR.sol new file mode 100644 index 0000000..8488911 --- /dev/null +++ b/resources/regressions/test_log_invalid.json/mutants/74/ROR/ROR.sol @@ -0,0 +1,65 @@ +// SPDX-License-Identifier: GPL-3.0-only +pragma solidity >0.7.0; +pragma experimental ABIEncoderV2; + +// This contract provides test functions for relational operator replacement (ROR) +contract ROR { + // Expect 3 mutants: x <= y, x != y, false + function less(uint256 x, uint256 y) public pure returns (bool) { + return x < y; + } + + // Expect 3 mutants: x < y, x == y, true + function less_equal(uint256 x, uint256 y) public pure returns (bool) { + return x <= y; + } + + // Expect 3 mutants: x >= y, x != y, false + function more(uint256 x, uint256 y) public pure returns (bool) { + return x > y; + } + + // Expect 3 mutants: x > y, x == y, true + function more_equal(uint256 x, uint256 y) public pure returns (bool) { + return x >= y; + } + + // Expect 3 mutants: x >= y, x <= y, false + function equal_ord(uint256 x, uint256 y) public pure returns (bool) { + return x == y; + } + + // Expect 2 mutants: true, false + function equal_not_ord(bool x, bool y) public pure returns (bool) { + return x == y; + } + + // Expect 3 mutants: x > y, x < y, true + function not_equal_ord(uint256 x, uint256 y) public pure returns (bool) { + return x != y; + } + + // Expect 2 mutants: true, false + function not_equal_not_ord(bool x, bool y) public pure returns (bool) { + return x != y; + } + + // Expect 3 mutants: (x + y) > z, (x + y) == z, true + function more_equal_over_aor( + uint256 x, + uint256 y, + uint256 z + ) public pure returns (bool) { + return (x + y) >= z; + } + + // Expect 3 mutants: (x + y) > z, (x + y) < z, true + function not_equal_over_aor( + uint256 x, + uint256 y, + uint256 z + /// RelationalOperatorReplacement(`(x + y) != z` |==> `true`) of: `return (x + y) != z;` + ) public pure returns (bool) { + return true; + } +} diff --git a/resources/regressions/test_log_invalid.json/mutants/75/UOR/UOR.sol b/resources/regressions/test_log_invalid.json/mutants/75/UOR/UOR.sol new file mode 100644 index 0000000..50d0957 --- /dev/null +++ b/resources/regressions/test_log_invalid.json/mutants/75/UOR/UOR.sol @@ -0,0 +1,22 @@ +// SPDX-License-Identifier: GPL-3.0-only +pragma solidity >0.7.0; +pragma experimental ABIEncoderV2; + +// Unary Operator Replacement +contract UOR { + // Expect no mutants: cannot negate an unsigned integer + function unsigned_bw_not(uint256 x) public pure returns (uint256) { + return ~x; + } + + // Expect a single mutant: -x + /// UnaryOperatorReplacement(`~` |==> `-`) of: `return ~x;` + function signed_bw_not(int256 x) public pure returns (int256) { + return -x; + } + + // Expect a single mutant: ~x + function signed_neg(int256 x) public pure returns (int256) { + return -x; + } +} diff --git a/resources/regressions/test_log_invalid.json/mutants/76/UOR/UOR.sol b/resources/regressions/test_log_invalid.json/mutants/76/UOR/UOR.sol new file mode 100644 index 0000000..84eae0c --- /dev/null +++ b/resources/regressions/test_log_invalid.json/mutants/76/UOR/UOR.sol @@ -0,0 +1,22 @@ +// SPDX-License-Identifier: GPL-3.0-only +pragma solidity >0.7.0; +pragma experimental ABIEncoderV2; + +// Unary Operator Replacement +contract UOR { + // Expect no mutants: cannot negate an unsigned integer + function unsigned_bw_not(uint256 x) public pure returns (uint256) { + return ~x; + } + + // Expect a single mutant: -x + function signed_bw_not(int256 x) public pure returns (int256) { + return ~x; + } + + // Expect a single mutant: ~x + /// UnaryOperatorReplacement(`-` |==> `~`) of: `return -x;` + function signed_neg(int256 x) public pure returns (int256) { + return ~x; + } +} diff --git a/resources/regressions/test_log_invalid.json/mutants/8/AOR/AOR.sol b/resources/regressions/test_log_invalid.json/mutants/8/AOR/AOR.sol new file mode 100644 index 0000000..bd874f1 --- /dev/null +++ b/resources/regressions/test_log_invalid.json/mutants/8/AOR/AOR.sol @@ -0,0 +1,61 @@ +// SPDX-License-Identifier: GPL-3.0-only +pragma solidity >0.7.0; +pragma experimental ABIEncoderV2; + +// This contract provides test functions for Arithmetic operator replacement +contract AOR { + // Expect 4 mutants: + // a - b + // a * b + // a / b + // a % b + function plus(int256 a, int256 b) public pure returns (int256) { + return a + b; + } + + // Expect 4 mutants: + // a + b + // a * b + // a / b + // a % b + /// ArithmeticOperatorReplacement(`-` |==> `%`) of: `return a - b;` + function minus(int256 a, int256 b) public pure returns (int256) { + return a % b; + } + + // Expect 4 mutants: + // a - b + // a * b + // a / b + // a % b + function times_with_parens( + int256 a, + int256 b + ) public pure returns (int256) { + return ((a)) * b; + } + + // Expect 5 mutants: + // a + b + // a - b + // a / b + // a ** b + // a % b + function unsigned_times_with_parens( + uint256 a, + uint256 b + ) public pure returns (uint256) { + return ((a)) * b; + } + + // Expect 5 mutants: + // a + b + // a - b + // a / b + // a * b + // a % b + + function power(uint256 a, uint256 b) public pure returns (uint256) { + return a ** b; + } +} diff --git a/resources/regressions/test_log_invalid.json/mutants/9/AOR/AOR.sol b/resources/regressions/test_log_invalid.json/mutants/9/AOR/AOR.sol new file mode 100644 index 0000000..5d9ca89 --- /dev/null +++ b/resources/regressions/test_log_invalid.json/mutants/9/AOR/AOR.sol @@ -0,0 +1,61 @@ +// SPDX-License-Identifier: GPL-3.0-only +pragma solidity >0.7.0; +pragma experimental ABIEncoderV2; + +// This contract provides test functions for Arithmetic operator replacement +contract AOR { + // Expect 4 mutants: + // a - b + // a * b + // a / b + // a % b + function plus(int256 a, int256 b) public pure returns (int256) { + return a + b; + } + + // Expect 4 mutants: + // a + b + // a * b + // a / b + // a % b + function minus(int256 a, int256 b) public pure returns (int256) { + return a - b; + } + + // Expect 4 mutants: + // a - b + // a * b + // a / b + // a % b + function times_with_parens( + int256 a, + int256 b + /// ArithmeticOperatorReplacement(`*` |==> `+`) of: `return ((a)) * b;` + ) public pure returns (int256) { + return ((a)) + b; + } + + // Expect 5 mutants: + // a + b + // a - b + // a / b + // a ** b + // a % b + function unsigned_times_with_parens( + uint256 a, + uint256 b + ) public pure returns (uint256) { + return ((a)) * b; + } + + // Expect 5 mutants: + // a + b + // a - b + // a / b + // a * b + // a % b + + function power(uint256 a, uint256 b) public pure returns (uint256) { + return a ** b; + } +} diff --git a/resources/regressions/test_multiple_contracts_1.json/gambit_results.json b/resources/regressions/test_multiple_contracts_1.json/gambit_results.json new file mode 100644 index 0000000..062246f --- /dev/null +++ b/resources/regressions/test_multiple_contracts_1.json/gambit_results.json @@ -0,0 +1,170 @@ +[ + { + "col": 9, + "description": "StatementDeletion", + "diff": "--- original\n+++ mutant\n@@ -3,8 +3,9 @@\n pragma solidity ^0.8.13;\n \n library Utils {\n+ /// StatementDeletion(`assert(c[0] == e)` |==> `assert(true)`) of: `assert(c[0] == e);`\n function getarray(address[] memory c, address e) internal pure {\n- assert(c[0] == e);\n+ assert(true);\n }\n \n function add(int8 a, int8 b) public pure returns (int8) {\n", + "id": "1", + "line": 7, + "name": "mutants/1/MultipleContracts/C.sol", + "op": "STD", + "orig": "assert(c[0] == e)", + "original": "MultipleContracts/C.sol", + "repl": "assert(true)" + }, + { + "col": 16, + "description": "RelationalOperatorReplacement", + "diff": "--- original\n+++ mutant\n@@ -3,8 +3,9 @@\n pragma solidity ^0.8.13;\n \n library Utils {\n+ /// RelationalOperatorReplacement(`c[0] == e` |==> `false`) of: `assert(c[0] == e);`\n function getarray(address[] memory c, address e) internal pure {\n- assert(c[0] == e);\n+ assert(false);\n }\n \n function add(int8 a, int8 b) public pure returns (int8) {\n", + "id": "2", + "line": 7, + "name": "mutants/2/MultipleContracts/C.sol", + "op": "ROR", + "orig": "c[0] == e", + "original": "MultipleContracts/C.sol", + "repl": "false" + }, + { + "col": 18, + "description": "LiteralValueReplacement", + "diff": "--- original\n+++ mutant\n@@ -3,8 +3,9 @@\n pragma solidity ^0.8.13;\n \n library Utils {\n+ /// LiteralValueReplacement(`0` |==> `1`) of: `assert(c[0] == e);`\n function getarray(address[] memory c, address e) internal pure {\n- assert(c[0] == e);\n+ assert(c[1] == e);\n }\n \n function add(int8 a, int8 b) public pure returns (int8) {\n", + "id": "3", + "line": 7, + "name": "mutants/3/MultipleContracts/C.sol", + "op": "LVR", + "orig": "0", + "original": "MultipleContracts/C.sol", + "repl": "1" + }, + { + "col": 21, + "description": "LiteralValueReplacement", + "diff": "--- original\n+++ mutant\n@@ -19,8 +19,9 @@\n return a;\n }\n \n+ /// LiteralValueReplacement(`10` |==> `0`) of: `uint256 a = 10;`\n function get10PowerDecimals(uint8 decimals) public pure returns (uint256) {\n- uint256 a = 10;\n+ uint256 a = 0;\n uint256 res = a ** decimals;\n return res;\n }\n", + "id": "4", + "line": 23, + "name": "mutants/4/MultipleContracts/C.sol", + "op": "LVR", + "orig": "10", + "original": "MultipleContracts/C.sol", + "repl": "0" + }, + { + "col": 21, + "description": "LiteralValueReplacement", + "diff": "--- original\n+++ mutant\n@@ -19,8 +19,9 @@\n return a;\n }\n \n+ /// LiteralValueReplacement(`10` |==> `11`) of: `uint256 a = 10;`\n function get10PowerDecimals(uint8 decimals) public pure returns (uint256) {\n- uint256 a = 10;\n+ uint256 a = 11;\n uint256 res = a ** decimals;\n return res;\n }\n", + "id": "5", + "line": 23, + "name": "mutants/5/MultipleContracts/C.sol", + "op": "LVR", + "orig": "10", + "original": "MultipleContracts/C.sol", + "repl": "11" + }, + { + "col": 25, + "description": "ArithmeticOperatorReplacement", + "diff": "--- original\n+++ mutant\n@@ -20,8 +20,9 @@\n }\n \n function get10PowerDecimals(uint8 decimals) public pure returns (uint256) {\n+ /// ArithmeticOperatorReplacement(`**` |==> `+`) of: `uint256 res = a ** decimals;`\n uint256 a = 10;\n- uint256 res = a ** decimals;\n+ uint256 res = a + decimals;\n return res;\n }\n \n", + "id": "6", + "line": 24, + "name": "mutants/6/MultipleContracts/C.sol", + "op": "AOR", + "orig": "**", + "original": "MultipleContracts/C.sol", + "repl": "+" + }, + { + "col": 25, + "description": "ArithmeticOperatorReplacement", + "diff": "--- original\n+++ mutant\n@@ -20,8 +20,9 @@\n }\n \n function get10PowerDecimals(uint8 decimals) public pure returns (uint256) {\n+ /// ArithmeticOperatorReplacement(`**` |==> `-`) of: `uint256 res = a ** decimals;`\n uint256 a = 10;\n- uint256 res = a ** decimals;\n+ uint256 res = a - decimals;\n return res;\n }\n \n", + "id": "7", + "line": 24, + "name": "mutants/7/MultipleContracts/C.sol", + "op": "AOR", + "orig": "**", + "original": "MultipleContracts/C.sol", + "repl": "-" + }, + { + "col": 25, + "description": "ArithmeticOperatorReplacement", + "diff": "--- original\n+++ mutant\n@@ -20,8 +20,9 @@\n }\n \n function get10PowerDecimals(uint8 decimals) public pure returns (uint256) {\n+ /// ArithmeticOperatorReplacement(`**` |==> `*`) of: `uint256 res = a ** decimals;`\n uint256 a = 10;\n- uint256 res = a ** decimals;\n+ uint256 res = a * decimals;\n return res;\n }\n \n", + "id": "8", + "line": 24, + "name": "mutants/8/MultipleContracts/C.sol", + "op": "AOR", + "orig": "**", + "original": "MultipleContracts/C.sol", + "repl": "*" + }, + { + "col": 25, + "description": "ArithmeticOperatorReplacement", + "diff": "--- original\n+++ mutant\n@@ -20,8 +20,9 @@\n }\n \n function get10PowerDecimals(uint8 decimals) public pure returns (uint256) {\n+ /// ArithmeticOperatorReplacement(`**` |==> `/`) of: `uint256 res = a ** decimals;`\n uint256 a = 10;\n- uint256 res = a ** decimals;\n+ uint256 res = a / decimals;\n return res;\n }\n \n", + "id": "9", + "line": 24, + "name": "mutants/9/MultipleContracts/C.sol", + "op": "AOR", + "orig": "**", + "original": "MultipleContracts/C.sol", + "repl": "/" + }, + { + "col": 25, + "description": "ArithmeticOperatorReplacement", + "diff": "--- original\n+++ mutant\n@@ -20,8 +20,9 @@\n }\n \n function get10PowerDecimals(uint8 decimals) public pure returns (uint256) {\n+ /// ArithmeticOperatorReplacement(`**` |==> `%`) of: `uint256 res = a ** decimals;`\n uint256 a = 10;\n- uint256 res = a ** decimals;\n+ uint256 res = a % decimals;\n return res;\n }\n \n", + "id": "10", + "line": 24, + "name": "mutants/10/MultipleContracts/C.sol", + "op": "AOR", + "orig": "**", + "original": "MultipleContracts/C.sol", + "repl": "%" + }, + { + "col": 9, + "description": "StatementDeletion", + "diff": "--- original\n+++ mutant\n@@ -21,8 +21,9 @@\n \n function get10PowerDecimals(uint8 decimals) public pure returns (uint256) {\n uint256 a = 10;\n+ /// StatementDeletion(`return res` |==> `assert(true)`) of: `return res;`\n uint256 res = a ** decimals;\n- return res;\n+ assert(true);\n }\n \n function getarray(address[] memory c, address e) public pure {\n", + "id": "11", + "line": 25, + "name": "mutants/11/MultipleContracts/C.sol", + "op": "STD", + "orig": "return res", + "original": "MultipleContracts/C.sol", + "repl": "assert(true)" + }, + { + "col": 9, + "description": "StatementDeletion", + "diff": "--- original\n+++ mutant\n@@ -25,8 +25,9 @@\n return res;\n }\n \n+ /// StatementDeletion(`assert(c[0] == e)` |==> `assert(true)`) of: `assert(c[0] == e);`\n function getarray(address[] memory c, address e) public pure {\n- assert(c[0] == e);\n+ assert(true);\n }\n \n function callmyself() external view {\n", + "id": "12", + "line": 29, + "name": "mutants/12/MultipleContracts/C.sol", + "op": "STD", + "orig": "assert(c[0] == e)", + "original": "MultipleContracts/C.sol", + "repl": "assert(true)" + }, + { + "col": 16, + "description": "RelationalOperatorReplacement", + "diff": "--- original\n+++ mutant\n@@ -25,8 +25,9 @@\n return res;\n }\n \n+ /// RelationalOperatorReplacement(`c[0] == e` |==> `false`) of: `assert(c[0] == e);`\n function getarray(address[] memory c, address e) public pure {\n- assert(c[0] == e);\n+ assert(false);\n }\n \n function callmyself() external view {\n", + "id": "13", + "line": 29, + "name": "mutants/13/MultipleContracts/C.sol", + "op": "ROR", + "orig": "c[0] == e", + "original": "MultipleContracts/C.sol", + "repl": "false" + }, + { + "col": 18, + "description": "LiteralValueReplacement", + "diff": "--- original\n+++ mutant\n@@ -25,8 +25,9 @@\n return res;\n }\n \n+ /// LiteralValueReplacement(`0` |==> `1`) of: `assert(c[0] == e);`\n function getarray(address[] memory c, address e) public pure {\n- assert(c[0] == e);\n+ assert(c[1] == e);\n }\n \n function callmyself() external view {\n", + "id": "14", + "line": 29, + "name": "mutants/14/MultipleContracts/C.sol", + "op": "LVR", + "orig": "0", + "original": "MultipleContracts/C.sol", + "repl": "1" + } +] \ No newline at end of file diff --git a/resources/regressions/test_multiple_contracts_1.json/mutants.log b/resources/regressions/test_multiple_contracts_1.json/mutants.log new file mode 100644 index 0000000..10b860e --- /dev/null +++ b/resources/regressions/test_multiple_contracts_1.json/mutants.log @@ -0,0 +1,14 @@ +1,STD,MultipleContracts/C.sol,7:9,assert(c[0] == e),assert(true) +2,ROR,MultipleContracts/C.sol,7:16,c[0] == e,false +3,LVR,MultipleContracts/C.sol,7:18,0,1 +4,LVR,MultipleContracts/C.sol,23:21,10,0 +5,LVR,MultipleContracts/C.sol,23:21,10,11 +6,AOR,MultipleContracts/C.sol,24:25,**,+ +7,AOR,MultipleContracts/C.sol,24:25,**,- +8,AOR,MultipleContracts/C.sol,24:25,**,* +9,AOR,MultipleContracts/C.sol,24:25,**,/ +10,AOR,MultipleContracts/C.sol,24:25,**,% +11,STD,MultipleContracts/C.sol,25:9,return res,assert(true) +12,STD,MultipleContracts/C.sol,29:9,assert(c[0] == e),assert(true) +13,ROR,MultipleContracts/C.sol,29:16,c[0] == e,false +14,LVR,MultipleContracts/C.sol,29:18,0,1 diff --git a/resources/regressions/multiple-contracts-1.json/mutants/1/MultipleContracts/C.sol b/resources/regressions/test_multiple_contracts_1.json/mutants/1/MultipleContracts/C.sol similarity index 90% rename from resources/regressions/multiple-contracts-1.json/mutants/1/MultipleContracts/C.sol rename to resources/regressions/test_multiple_contracts_1.json/mutants/1/MultipleContracts/C.sol index dd751c5..5f69007 100644 --- a/resources/regressions/multiple-contracts-1.json/mutants/1/MultipleContracts/C.sol +++ b/resources/regressions/test_multiple_contracts_1.json/mutants/1/MultipleContracts/C.sol @@ -3,8 +3,8 @@ pragma solidity ^0.8.13; library Utils { + /// StatementDeletion(`assert(c[0] == e)` |==> `assert(true)`) of: `assert(c[0] == e);` function getarray(address[] memory c, address e) internal pure { - /// DeleteExpressionMutation(`assert(c[0] == e)` |==> `assert(true)`) of: `assert(c[0] == e);` assert(true); } diff --git a/resources/regressions/multiple-contracts-1.json/mutants/5/MultipleContracts/C.sol b/resources/regressions/test_multiple_contracts_1.json/mutants/10/MultipleContracts/C.sol similarity index 87% rename from resources/regressions/multiple-contracts-1.json/mutants/5/MultipleContracts/C.sol rename to resources/regressions/test_multiple_contracts_1.json/mutants/10/MultipleContracts/C.sol index 218d97b..4979f42 100644 --- a/resources/regressions/multiple-contracts-1.json/mutants/5/MultipleContracts/C.sol +++ b/resources/regressions/test_multiple_contracts_1.json/mutants/10/MultipleContracts/C.sol @@ -20,9 +20,9 @@ contract C { } function get10PowerDecimals(uint8 decimals) public pure returns (uint256) { + /// ArithmeticOperatorReplacement(`**` |==> `%`) of: `uint256 res = a ** decimals;` uint256 a = 10; - /// BinaryOpMutation(`**` |==> `/`) of: `uint256 res = a ** decimals;` - uint256 res = a/decimals; + uint256 res = a % decimals; return res; } diff --git a/resources/regressions/test_multiple_contracts_1.json/mutants/11/MultipleContracts/C.sol b/resources/regressions/test_multiple_contracts_1.json/mutants/11/MultipleContracts/C.sol new file mode 100644 index 0000000..5933d06 --- /dev/null +++ b/resources/regressions/test_multiple_contracts_1.json/mutants/11/MultipleContracts/C.sol @@ -0,0 +1,41 @@ +// SPDX-License-Identifier: GPL-3.0-only + +pragma solidity ^0.8.13; + +library Utils { + function getarray(address[] memory c, address e) internal pure { + assert(c[0] == e); + } + + function add(int8 a, int8 b) public pure returns (int8) { + return a + b; + } +} + +contract C { + function foo() external view returns (address[] memory) { + address[] memory a = new address[](1); + a[0] = msg.sender; + return a; + } + + function get10PowerDecimals(uint8 decimals) public pure returns (uint256) { + uint256 a = 10; + /// StatementDeletion(`return res` |==> `assert(true)`) of: `return res;` + uint256 res = a ** decimals; + assert(true); + } + + function getarray(address[] memory c, address e) public pure { + assert(c[0] == e); + } + + function callmyself() external view { + address[] memory b = this.foo(); + Utils.getarray(b, address(this)); + } + + function add(int8 c, int8 d) public pure returns (int8) { + return c + d; + } +} diff --git a/resources/regressions/multiple-contracts-1.json/mutants/8/MultipleContracts/C.sol b/resources/regressions/test_multiple_contracts_1.json/mutants/12/MultipleContracts/C.sol similarity index 90% rename from resources/regressions/multiple-contracts-1.json/mutants/8/MultipleContracts/C.sol rename to resources/regressions/test_multiple_contracts_1.json/mutants/12/MultipleContracts/C.sol index 93b8986..a4c6c97 100644 --- a/resources/regressions/multiple-contracts-1.json/mutants/8/MultipleContracts/C.sol +++ b/resources/regressions/test_multiple_contracts_1.json/mutants/12/MultipleContracts/C.sol @@ -25,8 +25,8 @@ contract C { return res; } + /// StatementDeletion(`assert(c[0] == e)` |==> `assert(true)`) of: `assert(c[0] == e);` function getarray(address[] memory c, address e) public pure { - /// DeleteExpressionMutation(`assert(c[0] == e)` |==> `assert(true)`) of: `assert(c[0] == e);` assert(true); } diff --git a/resources/regressions/test_multiple_contracts_1.json/mutants/13/MultipleContracts/C.sol b/resources/regressions/test_multiple_contracts_1.json/mutants/13/MultipleContracts/C.sol new file mode 100644 index 0000000..781e87b --- /dev/null +++ b/resources/regressions/test_multiple_contracts_1.json/mutants/13/MultipleContracts/C.sol @@ -0,0 +1,41 @@ +// SPDX-License-Identifier: GPL-3.0-only + +pragma solidity ^0.8.13; + +library Utils { + function getarray(address[] memory c, address e) internal pure { + assert(c[0] == e); + } + + function add(int8 a, int8 b) public pure returns (int8) { + return a + b; + } +} + +contract C { + function foo() external view returns (address[] memory) { + address[] memory a = new address[](1); + a[0] = msg.sender; + return a; + } + + function get10PowerDecimals(uint8 decimals) public pure returns (uint256) { + uint256 a = 10; + uint256 res = a ** decimals; + return res; + } + + /// RelationalOperatorReplacement(`c[0] == e` |==> `false`) of: `assert(c[0] == e);` + function getarray(address[] memory c, address e) public pure { + assert(false); + } + + function callmyself() external view { + address[] memory b = this.foo(); + Utils.getarray(b, address(this)); + } + + function add(int8 c, int8 d) public pure returns (int8) { + return c + d; + } +} diff --git a/resources/regressions/test_multiple_contracts_1.json/mutants/14/MultipleContracts/C.sol b/resources/regressions/test_multiple_contracts_1.json/mutants/14/MultipleContracts/C.sol new file mode 100644 index 0000000..7749a0c --- /dev/null +++ b/resources/regressions/test_multiple_contracts_1.json/mutants/14/MultipleContracts/C.sol @@ -0,0 +1,41 @@ +// SPDX-License-Identifier: GPL-3.0-only + +pragma solidity ^0.8.13; + +library Utils { + function getarray(address[] memory c, address e) internal pure { + assert(c[0] == e); + } + + function add(int8 a, int8 b) public pure returns (int8) { + return a + b; + } +} + +contract C { + function foo() external view returns (address[] memory) { + address[] memory a = new address[](1); + a[0] = msg.sender; + return a; + } + + function get10PowerDecimals(uint8 decimals) public pure returns (uint256) { + uint256 a = 10; + uint256 res = a ** decimals; + return res; + } + + /// LiteralValueReplacement(`0` |==> `1`) of: `assert(c[0] == e);` + function getarray(address[] memory c, address e) public pure { + assert(c[1] == e); + } + + function callmyself() external view { + address[] memory b = this.foo(); + Utils.getarray(b, address(this)); + } + + function add(int8 c, int8 d) public pure returns (int8) { + return c + d; + } +} diff --git a/resources/regressions/test_multiple_contracts_1.json/mutants/2/MultipleContracts/C.sol b/resources/regressions/test_multiple_contracts_1.json/mutants/2/MultipleContracts/C.sol new file mode 100644 index 0000000..ecdc98c --- /dev/null +++ b/resources/regressions/test_multiple_contracts_1.json/mutants/2/MultipleContracts/C.sol @@ -0,0 +1,41 @@ +// SPDX-License-Identifier: GPL-3.0-only + +pragma solidity ^0.8.13; + +library Utils { + /// RelationalOperatorReplacement(`c[0] == e` |==> `false`) of: `assert(c[0] == e);` + function getarray(address[] memory c, address e) internal pure { + assert(false); + } + + function add(int8 a, int8 b) public pure returns (int8) { + return a + b; + } +} + +contract C { + function foo() external view returns (address[] memory) { + address[] memory a = new address[](1); + a[0] = msg.sender; + return a; + } + + function get10PowerDecimals(uint8 decimals) public pure returns (uint256) { + uint256 a = 10; + uint256 res = a ** decimals; + return res; + } + + function getarray(address[] memory c, address e) public pure { + assert(c[0] == e); + } + + function callmyself() external view { + address[] memory b = this.foo(); + Utils.getarray(b, address(this)); + } + + function add(int8 c, int8 d) public pure returns (int8) { + return c + d; + } +} diff --git a/resources/regressions/test_multiple_contracts_1.json/mutants/3/MultipleContracts/C.sol b/resources/regressions/test_multiple_contracts_1.json/mutants/3/MultipleContracts/C.sol new file mode 100644 index 0000000..e9466e0 --- /dev/null +++ b/resources/regressions/test_multiple_contracts_1.json/mutants/3/MultipleContracts/C.sol @@ -0,0 +1,41 @@ +// SPDX-License-Identifier: GPL-3.0-only + +pragma solidity ^0.8.13; + +library Utils { + /// LiteralValueReplacement(`0` |==> `1`) of: `assert(c[0] == e);` + function getarray(address[] memory c, address e) internal pure { + assert(c[1] == e); + } + + function add(int8 a, int8 b) public pure returns (int8) { + return a + b; + } +} + +contract C { + function foo() external view returns (address[] memory) { + address[] memory a = new address[](1); + a[0] = msg.sender; + return a; + } + + function get10PowerDecimals(uint8 decimals) public pure returns (uint256) { + uint256 a = 10; + uint256 res = a ** decimals; + return res; + } + + function getarray(address[] memory c, address e) public pure { + assert(c[0] == e); + } + + function callmyself() external view { + address[] memory b = this.foo(); + Utils.getarray(b, address(this)); + } + + function add(int8 c, int8 d) public pure returns (int8) { + return c + d; + } +} diff --git a/resources/regressions/test_multiple_contracts_1.json/mutants/4/MultipleContracts/C.sol b/resources/regressions/test_multiple_contracts_1.json/mutants/4/MultipleContracts/C.sol new file mode 100644 index 0000000..f2136ed --- /dev/null +++ b/resources/regressions/test_multiple_contracts_1.json/mutants/4/MultipleContracts/C.sol @@ -0,0 +1,41 @@ +// SPDX-License-Identifier: GPL-3.0-only + +pragma solidity ^0.8.13; + +library Utils { + function getarray(address[] memory c, address e) internal pure { + assert(c[0] == e); + } + + function add(int8 a, int8 b) public pure returns (int8) { + return a + b; + } +} + +contract C { + function foo() external view returns (address[] memory) { + address[] memory a = new address[](1); + a[0] = msg.sender; + return a; + } + + /// LiteralValueReplacement(`10` |==> `0`) of: `uint256 a = 10;` + function get10PowerDecimals(uint8 decimals) public pure returns (uint256) { + uint256 a = 0; + uint256 res = a ** decimals; + return res; + } + + function getarray(address[] memory c, address e) public pure { + assert(c[0] == e); + } + + function callmyself() external view { + address[] memory b = this.foo(); + Utils.getarray(b, address(this)); + } + + function add(int8 c, int8 d) public pure returns (int8) { + return c + d; + } +} diff --git a/resources/regressions/test_multiple_contracts_1.json/mutants/5/MultipleContracts/C.sol b/resources/regressions/test_multiple_contracts_1.json/mutants/5/MultipleContracts/C.sol new file mode 100644 index 0000000..f69e336 --- /dev/null +++ b/resources/regressions/test_multiple_contracts_1.json/mutants/5/MultipleContracts/C.sol @@ -0,0 +1,41 @@ +// SPDX-License-Identifier: GPL-3.0-only + +pragma solidity ^0.8.13; + +library Utils { + function getarray(address[] memory c, address e) internal pure { + assert(c[0] == e); + } + + function add(int8 a, int8 b) public pure returns (int8) { + return a + b; + } +} + +contract C { + function foo() external view returns (address[] memory) { + address[] memory a = new address[](1); + a[0] = msg.sender; + return a; + } + + /// LiteralValueReplacement(`10` |==> `11`) of: `uint256 a = 10;` + function get10PowerDecimals(uint8 decimals) public pure returns (uint256) { + uint256 a = 11; + uint256 res = a ** decimals; + return res; + } + + function getarray(address[] memory c, address e) public pure { + assert(c[0] == e); + } + + function callmyself() external view { + address[] memory b = this.foo(); + Utils.getarray(b, address(this)); + } + + function add(int8 c, int8 d) public pure returns (int8) { + return c + d; + } +} diff --git a/resources/regressions/multiple-contracts-1.json/mutants/2/MultipleContracts/C.sol b/resources/regressions/test_multiple_contracts_1.json/mutants/6/MultipleContracts/C.sol similarity index 87% rename from resources/regressions/multiple-contracts-1.json/mutants/2/MultipleContracts/C.sol rename to resources/regressions/test_multiple_contracts_1.json/mutants/6/MultipleContracts/C.sol index 59da228..13319cb 100644 --- a/resources/regressions/multiple-contracts-1.json/mutants/2/MultipleContracts/C.sol +++ b/resources/regressions/test_multiple_contracts_1.json/mutants/6/MultipleContracts/C.sol @@ -20,9 +20,9 @@ contract C { } function get10PowerDecimals(uint8 decimals) public pure returns (uint256) { + /// ArithmeticOperatorReplacement(`**` |==> `+`) of: `uint256 res = a ** decimals;` uint256 a = 10; - /// BinaryOpMutation(`**` |==> `+`) of: `uint256 res = a ** decimals;` - uint256 res = a+decimals; + uint256 res = a + decimals; return res; } diff --git a/resources/regressions/multiple-contracts-1.json/mutants/3/MultipleContracts/C.sol b/resources/regressions/test_multiple_contracts_1.json/mutants/7/MultipleContracts/C.sol similarity index 87% rename from resources/regressions/multiple-contracts-1.json/mutants/3/MultipleContracts/C.sol rename to resources/regressions/test_multiple_contracts_1.json/mutants/7/MultipleContracts/C.sol index 911e098..3279b41 100644 --- a/resources/regressions/multiple-contracts-1.json/mutants/3/MultipleContracts/C.sol +++ b/resources/regressions/test_multiple_contracts_1.json/mutants/7/MultipleContracts/C.sol @@ -20,9 +20,9 @@ contract C { } function get10PowerDecimals(uint8 decimals) public pure returns (uint256) { + /// ArithmeticOperatorReplacement(`**` |==> `-`) of: `uint256 res = a ** decimals;` uint256 a = 10; - /// BinaryOpMutation(`**` |==> `-`) of: `uint256 res = a ** decimals;` - uint256 res = a-decimals; + uint256 res = a - decimals; return res; } diff --git a/resources/regressions/multiple-contracts-1.json/mutants/4/MultipleContracts/C.sol b/resources/regressions/test_multiple_contracts_1.json/mutants/8/MultipleContracts/C.sol similarity index 87% rename from resources/regressions/multiple-contracts-1.json/mutants/4/MultipleContracts/C.sol rename to resources/regressions/test_multiple_contracts_1.json/mutants/8/MultipleContracts/C.sol index 53ca08b..95cc94e 100644 --- a/resources/regressions/multiple-contracts-1.json/mutants/4/MultipleContracts/C.sol +++ b/resources/regressions/test_multiple_contracts_1.json/mutants/8/MultipleContracts/C.sol @@ -20,9 +20,9 @@ contract C { } function get10PowerDecimals(uint8 decimals) public pure returns (uint256) { + /// ArithmeticOperatorReplacement(`**` |==> `*`) of: `uint256 res = a ** decimals;` uint256 a = 10; - /// BinaryOpMutation(`**` |==> `*`) of: `uint256 res = a ** decimals;` - uint256 res = a*decimals; + uint256 res = a * decimals; return res; } diff --git a/resources/regressions/test_multiple_contracts_1.json/mutants/9/MultipleContracts/C.sol b/resources/regressions/test_multiple_contracts_1.json/mutants/9/MultipleContracts/C.sol new file mode 100644 index 0000000..cc3476f --- /dev/null +++ b/resources/regressions/test_multiple_contracts_1.json/mutants/9/MultipleContracts/C.sol @@ -0,0 +1,41 @@ +// SPDX-License-Identifier: GPL-3.0-only + +pragma solidity ^0.8.13; + +library Utils { + function getarray(address[] memory c, address e) internal pure { + assert(c[0] == e); + } + + function add(int8 a, int8 b) public pure returns (int8) { + return a + b; + } +} + +contract C { + function foo() external view returns (address[] memory) { + address[] memory a = new address[](1); + a[0] = msg.sender; + return a; + } + + function get10PowerDecimals(uint8 decimals) public pure returns (uint256) { + /// ArithmeticOperatorReplacement(`**` |==> `/`) of: `uint256 res = a ** decimals;` + uint256 a = 10; + uint256 res = a / decimals; + return res; + } + + function getarray(address[] memory c, address e) public pure { + assert(c[0] == e); + } + + function callmyself() external view { + address[] memory b = this.foo(); + Utils.getarray(b, address(this)); + } + + function add(int8 c, int8 d) public pure returns (int8) { + return c + d; + } +} diff --git a/resources/regressions/test_multiple_contracts_2.json/gambit_results.json b/resources/regressions/test_multiple_contracts_2.json/gambit_results.json new file mode 100644 index 0000000..4934b61 --- /dev/null +++ b/resources/regressions/test_multiple_contracts_2.json/gambit_results.json @@ -0,0 +1,158 @@ +[ + { + "col": 9, + "description": "StatementDeletion", + "diff": "--- original\n+++ mutant\n@@ -7,8 +7,9 @@\n assert(c[0] == e);\n }\n \n+ /// StatementDeletion(`return a + b` |==> `assert(true)`) of: `return a + b;`\n function add(int8 a, int8 b) public pure returns (int8) {\n- return a + b;\n+ assert(true);\n }\n }\n \n", + "id": "1", + "line": 11, + "name": "mutants/1/MultipleContracts/C.sol", + "op": "STD", + "orig": "return a + b", + "original": "MultipleContracts/C.sol", + "repl": "assert(true)" + }, + { + "col": 18, + "description": "ArithmeticOperatorReplacement", + "diff": "--- original\n+++ mutant\n@@ -7,8 +7,9 @@\n assert(c[0] == e);\n }\n \n+ /// ArithmeticOperatorReplacement(`+` |==> `-`) of: `return a + b;`\n function add(int8 a, int8 b) public pure returns (int8) {\n- return a + b;\n+ return a - b;\n }\n }\n \n", + "id": "2", + "line": 11, + "name": "mutants/2/MultipleContracts/C.sol", + "op": "AOR", + "orig": "+", + "original": "MultipleContracts/C.sol", + "repl": "-" + }, + { + "col": 18, + "description": "ArithmeticOperatorReplacement", + "diff": "--- original\n+++ mutant\n@@ -7,8 +7,9 @@\n assert(c[0] == e);\n }\n \n+ /// ArithmeticOperatorReplacement(`+` |==> `*`) of: `return a + b;`\n function add(int8 a, int8 b) public pure returns (int8) {\n- return a + b;\n+ return a * b;\n }\n }\n \n", + "id": "3", + "line": 11, + "name": "mutants/3/MultipleContracts/C.sol", + "op": "AOR", + "orig": "+", + "original": "MultipleContracts/C.sol", + "repl": "*" + }, + { + "col": 18, + "description": "ArithmeticOperatorReplacement", + "diff": "--- original\n+++ mutant\n@@ -7,8 +7,9 @@\n assert(c[0] == e);\n }\n \n+ /// ArithmeticOperatorReplacement(`+` |==> `/`) of: `return a + b;`\n function add(int8 a, int8 b) public pure returns (int8) {\n- return a + b;\n+ return a / b;\n }\n }\n \n", + "id": "4", + "line": 11, + "name": "mutants/4/MultipleContracts/C.sol", + "op": "AOR", + "orig": "+", + "original": "MultipleContracts/C.sol", + "repl": "/" + }, + { + "col": 18, + "description": "ArithmeticOperatorReplacement", + "diff": "--- original\n+++ mutant\n@@ -7,8 +7,9 @@\n assert(c[0] == e);\n }\n \n+ /// ArithmeticOperatorReplacement(`+` |==> `%`) of: `return a + b;`\n function add(int8 a, int8 b) public pure returns (int8) {\n- return a + b;\n+ return a % b;\n }\n }\n \n", + "id": "5", + "line": 11, + "name": "mutants/5/MultipleContracts/C.sol", + "op": "AOR", + "orig": "+", + "original": "MultipleContracts/C.sol", + "repl": "%" + }, + { + "col": 21, + "description": "LiteralValueReplacement", + "diff": "--- original\n+++ mutant\n@@ -19,8 +19,9 @@\n return a;\n }\n \n+ /// LiteralValueReplacement(`10` |==> `0`) of: `uint256 a = 10;`\n function get10PowerDecimals(uint8 decimals) public pure returns (uint256) {\n- uint256 a = 10;\n+ uint256 a = 0;\n uint256 res = a ** decimals;\n return res;\n }\n", + "id": "6", + "line": 23, + "name": "mutants/6/MultipleContracts/C.sol", + "op": "LVR", + "orig": "10", + "original": "MultipleContracts/C.sol", + "repl": "0" + }, + { + "col": 21, + "description": "LiteralValueReplacement", + "diff": "--- original\n+++ mutant\n@@ -19,8 +19,9 @@\n return a;\n }\n \n+ /// LiteralValueReplacement(`10` |==> `11`) of: `uint256 a = 10;`\n function get10PowerDecimals(uint8 decimals) public pure returns (uint256) {\n- uint256 a = 10;\n+ uint256 a = 11;\n uint256 res = a ** decimals;\n return res;\n }\n", + "id": "7", + "line": 23, + "name": "mutants/7/MultipleContracts/C.sol", + "op": "LVR", + "orig": "10", + "original": "MultipleContracts/C.sol", + "repl": "11" + }, + { + "col": 25, + "description": "ArithmeticOperatorReplacement", + "diff": "--- original\n+++ mutant\n@@ -20,8 +20,9 @@\n }\n \n function get10PowerDecimals(uint8 decimals) public pure returns (uint256) {\n+ /// ArithmeticOperatorReplacement(`**` |==> `+`) of: `uint256 res = a ** decimals;`\n uint256 a = 10;\n- uint256 res = a ** decimals;\n+ uint256 res = a + decimals;\n return res;\n }\n \n", + "id": "8", + "line": 24, + "name": "mutants/8/MultipleContracts/C.sol", + "op": "AOR", + "orig": "**", + "original": "MultipleContracts/C.sol", + "repl": "+" + }, + { + "col": 25, + "description": "ArithmeticOperatorReplacement", + "diff": "--- original\n+++ mutant\n@@ -20,8 +20,9 @@\n }\n \n function get10PowerDecimals(uint8 decimals) public pure returns (uint256) {\n+ /// ArithmeticOperatorReplacement(`**` |==> `-`) of: `uint256 res = a ** decimals;`\n uint256 a = 10;\n- uint256 res = a ** decimals;\n+ uint256 res = a - decimals;\n return res;\n }\n \n", + "id": "9", + "line": 24, + "name": "mutants/9/MultipleContracts/C.sol", + "op": "AOR", + "orig": "**", + "original": "MultipleContracts/C.sol", + "repl": "-" + }, + { + "col": 25, + "description": "ArithmeticOperatorReplacement", + "diff": "--- original\n+++ mutant\n@@ -20,8 +20,9 @@\n }\n \n function get10PowerDecimals(uint8 decimals) public pure returns (uint256) {\n+ /// ArithmeticOperatorReplacement(`**` |==> `*`) of: `uint256 res = a ** decimals;`\n uint256 a = 10;\n- uint256 res = a ** decimals;\n+ uint256 res = a * decimals;\n return res;\n }\n \n", + "id": "10", + "line": 24, + "name": "mutants/10/MultipleContracts/C.sol", + "op": "AOR", + "orig": "**", + "original": "MultipleContracts/C.sol", + "repl": "*" + }, + { + "col": 25, + "description": "ArithmeticOperatorReplacement", + "diff": "--- original\n+++ mutant\n@@ -20,8 +20,9 @@\n }\n \n function get10PowerDecimals(uint8 decimals) public pure returns (uint256) {\n+ /// ArithmeticOperatorReplacement(`**` |==> `/`) of: `uint256 res = a ** decimals;`\n uint256 a = 10;\n- uint256 res = a ** decimals;\n+ uint256 res = a / decimals;\n return res;\n }\n \n", + "id": "11", + "line": 24, + "name": "mutants/11/MultipleContracts/C.sol", + "op": "AOR", + "orig": "**", + "original": "MultipleContracts/C.sol", + "repl": "/" + }, + { + "col": 25, + "description": "ArithmeticOperatorReplacement", + "diff": "--- original\n+++ mutant\n@@ -20,8 +20,9 @@\n }\n \n function get10PowerDecimals(uint8 decimals) public pure returns (uint256) {\n+ /// ArithmeticOperatorReplacement(`**` |==> `%`) of: `uint256 res = a ** decimals;`\n uint256 a = 10;\n- uint256 res = a ** decimals;\n+ uint256 res = a % decimals;\n return res;\n }\n \n", + "id": "12", + "line": 24, + "name": "mutants/12/MultipleContracts/C.sol", + "op": "AOR", + "orig": "**", + "original": "MultipleContracts/C.sol", + "repl": "%" + }, + { + "col": 9, + "description": "StatementDeletion", + "diff": "--- original\n+++ mutant\n@@ -21,8 +21,9 @@\n \n function get10PowerDecimals(uint8 decimals) public pure returns (uint256) {\n uint256 a = 10;\n+ /// StatementDeletion(`return res` |==> `assert(true)`) of: `return res;`\n uint256 res = a ** decimals;\n- return res;\n+ assert(true);\n }\n \n function getarray(address[] memory c, address e) public pure {\n", + "id": "13", + "line": 25, + "name": "mutants/13/MultipleContracts/C.sol", + "op": "STD", + "orig": "return res", + "original": "MultipleContracts/C.sol", + "repl": "assert(true)" + } +] \ No newline at end of file diff --git a/resources/regressions/test_multiple_contracts_2.json/mutants.log b/resources/regressions/test_multiple_contracts_2.json/mutants.log new file mode 100644 index 0000000..7288553 --- /dev/null +++ b/resources/regressions/test_multiple_contracts_2.json/mutants.log @@ -0,0 +1,13 @@ +1,STD,MultipleContracts/C.sol,11:9,return a + b,assert(true) +2,AOR,MultipleContracts/C.sol,11:18,+,- +3,AOR,MultipleContracts/C.sol,11:18,+,* +4,AOR,MultipleContracts/C.sol,11:18,+,/ +5,AOR,MultipleContracts/C.sol,11:18,+,% +6,LVR,MultipleContracts/C.sol,23:21,10,0 +7,LVR,MultipleContracts/C.sol,23:21,10,11 +8,AOR,MultipleContracts/C.sol,24:25,**,+ +9,AOR,MultipleContracts/C.sol,24:25,**,- +10,AOR,MultipleContracts/C.sol,24:25,**,* +11,AOR,MultipleContracts/C.sol,24:25,**,/ +12,AOR,MultipleContracts/C.sol,24:25,**,% +13,STD,MultipleContracts/C.sol,25:9,return res,assert(true) diff --git a/resources/regressions/test_multiple_contracts_2.json/mutants/1/MultipleContracts/C.sol b/resources/regressions/test_multiple_contracts_2.json/mutants/1/MultipleContracts/C.sol new file mode 100644 index 0000000..f7a4873 --- /dev/null +++ b/resources/regressions/test_multiple_contracts_2.json/mutants/1/MultipleContracts/C.sol @@ -0,0 +1,41 @@ +// SPDX-License-Identifier: GPL-3.0-only + +pragma solidity ^0.8.13; + +library Utils { + function getarray(address[] memory c, address e) internal pure { + assert(c[0] == e); + } + + /// StatementDeletion(`return a + b` |==> `assert(true)`) of: `return a + b;` + function add(int8 a, int8 b) public pure returns (int8) { + assert(true); + } +} + +contract C { + function foo() external view returns (address[] memory) { + address[] memory a = new address[](1); + a[0] = msg.sender; + return a; + } + + function get10PowerDecimals(uint8 decimals) public pure returns (uint256) { + uint256 a = 10; + uint256 res = a ** decimals; + return res; + } + + function getarray(address[] memory c, address e) public pure { + assert(c[0] == e); + } + + function callmyself() external view { + address[] memory b = this.foo(); + Utils.getarray(b, address(this)); + } + + function add(int8 c, int8 d) public pure returns (int8) { + return c + d; + } +} diff --git a/resources/regressions/test_multiple_contracts_2.json/mutants/10/MultipleContracts/C.sol b/resources/regressions/test_multiple_contracts_2.json/mutants/10/MultipleContracts/C.sol new file mode 100644 index 0000000..95cc94e --- /dev/null +++ b/resources/regressions/test_multiple_contracts_2.json/mutants/10/MultipleContracts/C.sol @@ -0,0 +1,41 @@ +// SPDX-License-Identifier: GPL-3.0-only + +pragma solidity ^0.8.13; + +library Utils { + function getarray(address[] memory c, address e) internal pure { + assert(c[0] == e); + } + + function add(int8 a, int8 b) public pure returns (int8) { + return a + b; + } +} + +contract C { + function foo() external view returns (address[] memory) { + address[] memory a = new address[](1); + a[0] = msg.sender; + return a; + } + + function get10PowerDecimals(uint8 decimals) public pure returns (uint256) { + /// ArithmeticOperatorReplacement(`**` |==> `*`) of: `uint256 res = a ** decimals;` + uint256 a = 10; + uint256 res = a * decimals; + return res; + } + + function getarray(address[] memory c, address e) public pure { + assert(c[0] == e); + } + + function callmyself() external view { + address[] memory b = this.foo(); + Utils.getarray(b, address(this)); + } + + function add(int8 c, int8 d) public pure returns (int8) { + return c + d; + } +} diff --git a/resources/regressions/test_multiple_contracts_2.json/mutants/11/MultipleContracts/C.sol b/resources/regressions/test_multiple_contracts_2.json/mutants/11/MultipleContracts/C.sol new file mode 100644 index 0000000..cc3476f --- /dev/null +++ b/resources/regressions/test_multiple_contracts_2.json/mutants/11/MultipleContracts/C.sol @@ -0,0 +1,41 @@ +// SPDX-License-Identifier: GPL-3.0-only + +pragma solidity ^0.8.13; + +library Utils { + function getarray(address[] memory c, address e) internal pure { + assert(c[0] == e); + } + + function add(int8 a, int8 b) public pure returns (int8) { + return a + b; + } +} + +contract C { + function foo() external view returns (address[] memory) { + address[] memory a = new address[](1); + a[0] = msg.sender; + return a; + } + + function get10PowerDecimals(uint8 decimals) public pure returns (uint256) { + /// ArithmeticOperatorReplacement(`**` |==> `/`) of: `uint256 res = a ** decimals;` + uint256 a = 10; + uint256 res = a / decimals; + return res; + } + + function getarray(address[] memory c, address e) public pure { + assert(c[0] == e); + } + + function callmyself() external view { + address[] memory b = this.foo(); + Utils.getarray(b, address(this)); + } + + function add(int8 c, int8 d) public pure returns (int8) { + return c + d; + } +} diff --git a/resources/regressions/test_multiple_contracts_2.json/mutants/12/MultipleContracts/C.sol b/resources/regressions/test_multiple_contracts_2.json/mutants/12/MultipleContracts/C.sol new file mode 100644 index 0000000..4979f42 --- /dev/null +++ b/resources/regressions/test_multiple_contracts_2.json/mutants/12/MultipleContracts/C.sol @@ -0,0 +1,41 @@ +// SPDX-License-Identifier: GPL-3.0-only + +pragma solidity ^0.8.13; + +library Utils { + function getarray(address[] memory c, address e) internal pure { + assert(c[0] == e); + } + + function add(int8 a, int8 b) public pure returns (int8) { + return a + b; + } +} + +contract C { + function foo() external view returns (address[] memory) { + address[] memory a = new address[](1); + a[0] = msg.sender; + return a; + } + + function get10PowerDecimals(uint8 decimals) public pure returns (uint256) { + /// ArithmeticOperatorReplacement(`**` |==> `%`) of: `uint256 res = a ** decimals;` + uint256 a = 10; + uint256 res = a % decimals; + return res; + } + + function getarray(address[] memory c, address e) public pure { + assert(c[0] == e); + } + + function callmyself() external view { + address[] memory b = this.foo(); + Utils.getarray(b, address(this)); + } + + function add(int8 c, int8 d) public pure returns (int8) { + return c + d; + } +} diff --git a/resources/regressions/test_multiple_contracts_2.json/mutants/13/MultipleContracts/C.sol b/resources/regressions/test_multiple_contracts_2.json/mutants/13/MultipleContracts/C.sol new file mode 100644 index 0000000..5933d06 --- /dev/null +++ b/resources/regressions/test_multiple_contracts_2.json/mutants/13/MultipleContracts/C.sol @@ -0,0 +1,41 @@ +// SPDX-License-Identifier: GPL-3.0-only + +pragma solidity ^0.8.13; + +library Utils { + function getarray(address[] memory c, address e) internal pure { + assert(c[0] == e); + } + + function add(int8 a, int8 b) public pure returns (int8) { + return a + b; + } +} + +contract C { + function foo() external view returns (address[] memory) { + address[] memory a = new address[](1); + a[0] = msg.sender; + return a; + } + + function get10PowerDecimals(uint8 decimals) public pure returns (uint256) { + uint256 a = 10; + /// StatementDeletion(`return res` |==> `assert(true)`) of: `return res;` + uint256 res = a ** decimals; + assert(true); + } + + function getarray(address[] memory c, address e) public pure { + assert(c[0] == e); + } + + function callmyself() external view { + address[] memory b = this.foo(); + Utils.getarray(b, address(this)); + } + + function add(int8 c, int8 d) public pure returns (int8) { + return c + d; + } +} diff --git a/resources/regressions/multiple-contracts-2.json/mutants/2/MultipleContracts/C.sol b/resources/regressions/test_multiple_contracts_2.json/mutants/2/MultipleContracts/C.sol similarity index 90% rename from resources/regressions/multiple-contracts-2.json/mutants/2/MultipleContracts/C.sol rename to resources/regressions/test_multiple_contracts_2.json/mutants/2/MultipleContracts/C.sol index b85149e..9e5f617 100644 --- a/resources/regressions/multiple-contracts-2.json/mutants/2/MultipleContracts/C.sol +++ b/resources/regressions/test_multiple_contracts_2.json/mutants/2/MultipleContracts/C.sol @@ -7,9 +7,9 @@ library Utils { assert(c[0] == e); } + /// ArithmeticOperatorReplacement(`+` |==> `-`) of: `return a + b;` function add(int8 a, int8 b) public pure returns (int8) { - /// BinaryOpMutation(`+` |==> `*`) of: `return a + b;` - return a*b; + return a - b; } } diff --git a/resources/regressions/multiple-contracts-2.json/mutants/3/MultipleContracts/C.sol b/resources/regressions/test_multiple_contracts_2.json/mutants/3/MultipleContracts/C.sol similarity index 90% rename from resources/regressions/multiple-contracts-2.json/mutants/3/MultipleContracts/C.sol rename to resources/regressions/test_multiple_contracts_2.json/mutants/3/MultipleContracts/C.sol index a5819d3..8612532 100644 --- a/resources/regressions/multiple-contracts-2.json/mutants/3/MultipleContracts/C.sol +++ b/resources/regressions/test_multiple_contracts_2.json/mutants/3/MultipleContracts/C.sol @@ -7,9 +7,9 @@ library Utils { assert(c[0] == e); } + /// ArithmeticOperatorReplacement(`+` |==> `*`) of: `return a + b;` function add(int8 a, int8 b) public pure returns (int8) { - /// BinaryOpMutation(`+` |==> `/`) of: `return a + b;` - return a/b; + return a * b; } } diff --git a/resources/regressions/multiple-contracts-2.json/mutants/4/MultipleContracts/C.sol b/resources/regressions/test_multiple_contracts_2.json/mutants/4/MultipleContracts/C.sol similarity index 90% rename from resources/regressions/multiple-contracts-2.json/mutants/4/MultipleContracts/C.sol rename to resources/regressions/test_multiple_contracts_2.json/mutants/4/MultipleContracts/C.sol index 530045e..e85ef12 100644 --- a/resources/regressions/multiple-contracts-2.json/mutants/4/MultipleContracts/C.sol +++ b/resources/regressions/test_multiple_contracts_2.json/mutants/4/MultipleContracts/C.sol @@ -7,9 +7,9 @@ library Utils { assert(c[0] == e); } + /// ArithmeticOperatorReplacement(`+` |==> `/`) of: `return a + b;` function add(int8 a, int8 b) public pure returns (int8) { - /// BinaryOpMutation(`+` |==> `%`) of: `return a + b;` - return a%b; + return a / b; } } diff --git a/resources/regressions/test_multiple_contracts_2.json/mutants/5/MultipleContracts/C.sol b/resources/regressions/test_multiple_contracts_2.json/mutants/5/MultipleContracts/C.sol new file mode 100644 index 0000000..b32909e --- /dev/null +++ b/resources/regressions/test_multiple_contracts_2.json/mutants/5/MultipleContracts/C.sol @@ -0,0 +1,41 @@ +// SPDX-License-Identifier: GPL-3.0-only + +pragma solidity ^0.8.13; + +library Utils { + function getarray(address[] memory c, address e) internal pure { + assert(c[0] == e); + } + + /// ArithmeticOperatorReplacement(`+` |==> `%`) of: `return a + b;` + function add(int8 a, int8 b) public pure returns (int8) { + return a % b; + } +} + +contract C { + function foo() external view returns (address[] memory) { + address[] memory a = new address[](1); + a[0] = msg.sender; + return a; + } + + function get10PowerDecimals(uint8 decimals) public pure returns (uint256) { + uint256 a = 10; + uint256 res = a ** decimals; + return res; + } + + function getarray(address[] memory c, address e) public pure { + assert(c[0] == e); + } + + function callmyself() external view { + address[] memory b = this.foo(); + Utils.getarray(b, address(this)); + } + + function add(int8 c, int8 d) public pure returns (int8) { + return c + d; + } +} diff --git a/resources/regressions/test_multiple_contracts_2.json/mutants/6/MultipleContracts/C.sol b/resources/regressions/test_multiple_contracts_2.json/mutants/6/MultipleContracts/C.sol new file mode 100644 index 0000000..f2136ed --- /dev/null +++ b/resources/regressions/test_multiple_contracts_2.json/mutants/6/MultipleContracts/C.sol @@ -0,0 +1,41 @@ +// SPDX-License-Identifier: GPL-3.0-only + +pragma solidity ^0.8.13; + +library Utils { + function getarray(address[] memory c, address e) internal pure { + assert(c[0] == e); + } + + function add(int8 a, int8 b) public pure returns (int8) { + return a + b; + } +} + +contract C { + function foo() external view returns (address[] memory) { + address[] memory a = new address[](1); + a[0] = msg.sender; + return a; + } + + /// LiteralValueReplacement(`10` |==> `0`) of: `uint256 a = 10;` + function get10PowerDecimals(uint8 decimals) public pure returns (uint256) { + uint256 a = 0; + uint256 res = a ** decimals; + return res; + } + + function getarray(address[] memory c, address e) public pure { + assert(c[0] == e); + } + + function callmyself() external view { + address[] memory b = this.foo(); + Utils.getarray(b, address(this)); + } + + function add(int8 c, int8 d) public pure returns (int8) { + return c + d; + } +} diff --git a/resources/regressions/test_multiple_contracts_2.json/mutants/7/MultipleContracts/C.sol b/resources/regressions/test_multiple_contracts_2.json/mutants/7/MultipleContracts/C.sol new file mode 100644 index 0000000..f69e336 --- /dev/null +++ b/resources/regressions/test_multiple_contracts_2.json/mutants/7/MultipleContracts/C.sol @@ -0,0 +1,41 @@ +// SPDX-License-Identifier: GPL-3.0-only + +pragma solidity ^0.8.13; + +library Utils { + function getarray(address[] memory c, address e) internal pure { + assert(c[0] == e); + } + + function add(int8 a, int8 b) public pure returns (int8) { + return a + b; + } +} + +contract C { + function foo() external view returns (address[] memory) { + address[] memory a = new address[](1); + a[0] = msg.sender; + return a; + } + + /// LiteralValueReplacement(`10` |==> `11`) of: `uint256 a = 10;` + function get10PowerDecimals(uint8 decimals) public pure returns (uint256) { + uint256 a = 11; + uint256 res = a ** decimals; + return res; + } + + function getarray(address[] memory c, address e) public pure { + assert(c[0] == e); + } + + function callmyself() external view { + address[] memory b = this.foo(); + Utils.getarray(b, address(this)); + } + + function add(int8 c, int8 d) public pure returns (int8) { + return c + d; + } +} diff --git a/resources/regressions/test_multiple_contracts_2.json/mutants/8/MultipleContracts/C.sol b/resources/regressions/test_multiple_contracts_2.json/mutants/8/MultipleContracts/C.sol new file mode 100644 index 0000000..13319cb --- /dev/null +++ b/resources/regressions/test_multiple_contracts_2.json/mutants/8/MultipleContracts/C.sol @@ -0,0 +1,41 @@ +// SPDX-License-Identifier: GPL-3.0-only + +pragma solidity ^0.8.13; + +library Utils { + function getarray(address[] memory c, address e) internal pure { + assert(c[0] == e); + } + + function add(int8 a, int8 b) public pure returns (int8) { + return a + b; + } +} + +contract C { + function foo() external view returns (address[] memory) { + address[] memory a = new address[](1); + a[0] = msg.sender; + return a; + } + + function get10PowerDecimals(uint8 decimals) public pure returns (uint256) { + /// ArithmeticOperatorReplacement(`**` |==> `+`) of: `uint256 res = a ** decimals;` + uint256 a = 10; + uint256 res = a + decimals; + return res; + } + + function getarray(address[] memory c, address e) public pure { + assert(c[0] == e); + } + + function callmyself() external view { + address[] memory b = this.foo(); + Utils.getarray(b, address(this)); + } + + function add(int8 c, int8 d) public pure returns (int8) { + return c + d; + } +} diff --git a/resources/regressions/test_multiple_contracts_2.json/mutants/9/MultipleContracts/C.sol b/resources/regressions/test_multiple_contracts_2.json/mutants/9/MultipleContracts/C.sol new file mode 100644 index 0000000..3279b41 --- /dev/null +++ b/resources/regressions/test_multiple_contracts_2.json/mutants/9/MultipleContracts/C.sol @@ -0,0 +1,41 @@ +// SPDX-License-Identifier: GPL-3.0-only + +pragma solidity ^0.8.13; + +library Utils { + function getarray(address[] memory c, address e) internal pure { + assert(c[0] == e); + } + + function add(int8 a, int8 b) public pure returns (int8) { + return a + b; + } +} + +contract C { + function foo() external view returns (address[] memory) { + address[] memory a = new address[](1); + a[0] = msg.sender; + return a; + } + + function get10PowerDecimals(uint8 decimals) public pure returns (uint256) { + /// ArithmeticOperatorReplacement(`**` |==> `-`) of: `uint256 res = a ** decimals;` + uint256 a = 10; + uint256 res = a - decimals; + return res; + } + + function getarray(address[] memory c, address e) public pure { + assert(c[0] == e); + } + + function callmyself() external view { + address[] memory b = this.foo(); + Utils.getarray(b, address(this)); + } + + function add(int8 c, int8 d) public pure returns (int8) { + return c + d; + } +} diff --git a/resources/regressions/test_multiple_contracts_3.json/gambit_results.json b/resources/regressions/test_multiple_contracts_3.json/gambit_results.json new file mode 100644 index 0000000..43afb12 --- /dev/null +++ b/resources/regressions/test_multiple_contracts_3.json/gambit_results.json @@ -0,0 +1,362 @@ +[ + { + "col": 9, + "description": "StatementDeletion", + "diff": "--- original\n+++ mutant\n@@ -3,8 +3,9 @@\n pragma solidity ^0.8.13;\n \n library Utils {\n+ /// StatementDeletion(`assert(c[0] == e)` |==> `assert(true)`) of: `assert(c[0] == e);`\n function getarray(address[] memory c, address e) internal pure {\n- assert(c[0] == e);\n+ assert(true);\n }\n \n function add(int8 a, int8 b) public pure returns (int8) {\n", + "id": "1", + "line": 7, + "name": "mutants/1/MultipleContracts/C.sol", + "op": "STD", + "orig": "assert(c[0] == e)", + "original": "MultipleContracts/C.sol", + "repl": "assert(true)" + }, + { + "col": 16, + "description": "RelationalOperatorReplacement", + "diff": "--- original\n+++ mutant\n@@ -3,8 +3,9 @@\n pragma solidity ^0.8.13;\n \n library Utils {\n+ /// RelationalOperatorReplacement(`c[0] == e` |==> `false`) of: `assert(c[0] == e);`\n function getarray(address[] memory c, address e) internal pure {\n- assert(c[0] == e);\n+ assert(false);\n }\n \n function add(int8 a, int8 b) public pure returns (int8) {\n", + "id": "2", + "line": 7, + "name": "mutants/2/MultipleContracts/C.sol", + "op": "ROR", + "orig": "c[0] == e", + "original": "MultipleContracts/C.sol", + "repl": "false" + }, + { + "col": 18, + "description": "LiteralValueReplacement", + "diff": "--- original\n+++ mutant\n@@ -3,8 +3,9 @@\n pragma solidity ^0.8.13;\n \n library Utils {\n+ /// LiteralValueReplacement(`0` |==> `1`) of: `assert(c[0] == e);`\n function getarray(address[] memory c, address e) internal pure {\n- assert(c[0] == e);\n+ assert(c[1] == e);\n }\n \n function add(int8 a, int8 b) public pure returns (int8) {\n", + "id": "3", + "line": 7, + "name": "mutants/3/MultipleContracts/C.sol", + "op": "LVR", + "orig": "0", + "original": "MultipleContracts/C.sol", + "repl": "1" + }, + { + "col": 9, + "description": "StatementDeletion", + "diff": "--- original\n+++ mutant\n@@ -7,8 +7,9 @@\n assert(c[0] == e);\n }\n \n+ /// StatementDeletion(`return a + b` |==> `assert(true)`) of: `return a + b;`\n function add(int8 a, int8 b) public pure returns (int8) {\n- return a + b;\n+ assert(true);\n }\n }\n \n", + "id": "4", + "line": 11, + "name": "mutants/4/MultipleContracts/C.sol", + "op": "STD", + "orig": "return a + b", + "original": "MultipleContracts/C.sol", + "repl": "assert(true)" + }, + { + "col": 18, + "description": "ArithmeticOperatorReplacement", + "diff": "--- original\n+++ mutant\n@@ -7,8 +7,9 @@\n assert(c[0] == e);\n }\n \n+ /// ArithmeticOperatorReplacement(`+` |==> `-`) of: `return a + b;`\n function add(int8 a, int8 b) public pure returns (int8) {\n- return a + b;\n+ return a - b;\n }\n }\n \n", + "id": "5", + "line": 11, + "name": "mutants/5/MultipleContracts/C.sol", + "op": "AOR", + "orig": "+", + "original": "MultipleContracts/C.sol", + "repl": "-" + }, + { + "col": 18, + "description": "ArithmeticOperatorReplacement", + "diff": "--- original\n+++ mutant\n@@ -7,8 +7,9 @@\n assert(c[0] == e);\n }\n \n+ /// ArithmeticOperatorReplacement(`+` |==> `*`) of: `return a + b;`\n function add(int8 a, int8 b) public pure returns (int8) {\n- return a + b;\n+ return a * b;\n }\n }\n \n", + "id": "6", + "line": 11, + "name": "mutants/6/MultipleContracts/C.sol", + "op": "AOR", + "orig": "+", + "original": "MultipleContracts/C.sol", + "repl": "*" + }, + { + "col": 18, + "description": "ArithmeticOperatorReplacement", + "diff": "--- original\n+++ mutant\n@@ -7,8 +7,9 @@\n assert(c[0] == e);\n }\n \n+ /// ArithmeticOperatorReplacement(`+` |==> `/`) of: `return a + b;`\n function add(int8 a, int8 b) public pure returns (int8) {\n- return a + b;\n+ return a / b;\n }\n }\n \n", + "id": "7", + "line": 11, + "name": "mutants/7/MultipleContracts/C.sol", + "op": "AOR", + "orig": "+", + "original": "MultipleContracts/C.sol", + "repl": "/" + }, + { + "col": 18, + "description": "ArithmeticOperatorReplacement", + "diff": "--- original\n+++ mutant\n@@ -7,8 +7,9 @@\n assert(c[0] == e);\n }\n \n+ /// ArithmeticOperatorReplacement(`+` |==> `%`) of: `return a + b;`\n function add(int8 a, int8 b) public pure returns (int8) {\n- return a + b;\n+ return a % b;\n }\n }\n \n", + "id": "8", + "line": 11, + "name": "mutants/8/MultipleContracts/C.sol", + "op": "AOR", + "orig": "+", + "original": "MultipleContracts/C.sol", + "repl": "%" + }, + { + "col": 44, + "description": "LiteralValueReplacement", + "diff": "--- original\n+++ mutant\n@@ -13,8 +13,9 @@\n }\n \n contract C {\n+ /// LiteralValueReplacement(`1` |==> `0`) of: `address[] memory a = new address[](1);`\n function foo() external view returns (address[] memory) {\n- address[] memory a = new address[](1);\n+ address[] memory a = new address[](0);\n a[0] = msg.sender;\n return a;\n }\n", + "id": "9", + "line": 17, + "name": "mutants/9/MultipleContracts/C.sol", + "op": "LVR", + "orig": "1", + "original": "MultipleContracts/C.sol", + "repl": "0" + }, + { + "col": 44, + "description": "LiteralValueReplacement", + "diff": "--- original\n+++ mutant\n@@ -13,8 +13,9 @@\n }\n \n contract C {\n+ /// LiteralValueReplacement(`1` |==> `2`) of: `address[] memory a = new address[](1);`\n function foo() external view returns (address[] memory) {\n- address[] memory a = new address[](1);\n+ address[] memory a = new address[](2);\n a[0] = msg.sender;\n return a;\n }\n", + "id": "10", + "line": 17, + "name": "mutants/10/MultipleContracts/C.sol", + "op": "LVR", + "orig": "1", + "original": "MultipleContracts/C.sol", + "repl": "2" + }, + { + "col": 9, + "description": "StatementDeletion", + "diff": "--- original\n+++ mutant\n@@ -14,8 +14,9 @@\n \n contract C {\n function foo() external view returns (address[] memory) {\n+ /// StatementDeletion(`a[0] = msg.sender` |==> `assert(true)`) of: `a[0] = msg.sender;`\n address[] memory a = new address[](1);\n- a[0] = msg.sender;\n+ assert(true);\n return a;\n }\n \n", + "id": "11", + "line": 18, + "name": "mutants/11/MultipleContracts/C.sol", + "op": "STD", + "orig": "a[0] = msg.sender", + "original": "MultipleContracts/C.sol", + "repl": "assert(true)" + }, + { + "col": 11, + "description": "LiteralValueReplacement", + "diff": "--- original\n+++ mutant\n@@ -14,8 +14,9 @@\n \n contract C {\n function foo() external view returns (address[] memory) {\n+ /// LiteralValueReplacement(`0` |==> `1`) of: `a[0] = msg.sender;`\n address[] memory a = new address[](1);\n- a[0] = msg.sender;\n+ a[1] = msg.sender;\n return a;\n }\n \n", + "id": "12", + "line": 18, + "name": "mutants/12/MultipleContracts/C.sol", + "op": "LVR", + "orig": "0", + "original": "MultipleContracts/C.sol", + "repl": "1" + }, + { + "col": 9, + "description": "StatementDeletion", + "diff": "--- original\n+++ mutant\n@@ -15,8 +15,9 @@\n contract C {\n function foo() external view returns (address[] memory) {\n address[] memory a = new address[](1);\n+ /// StatementDeletion(`return a` |==> `assert(true)`) of: `return a;`\n a[0] = msg.sender;\n- return a;\n+ assert(true);\n }\n \n function get10PowerDecimals(uint8 decimals) public pure returns (uint256) {\n", + "id": "13", + "line": 19, + "name": "mutants/13/MultipleContracts/C.sol", + "op": "STD", + "orig": "return a", + "original": "MultipleContracts/C.sol", + "repl": "assert(true)" + }, + { + "col": 21, + "description": "LiteralValueReplacement", + "diff": "--- original\n+++ mutant\n@@ -19,8 +19,9 @@\n return a;\n }\n \n+ /// LiteralValueReplacement(`10` |==> `0`) of: `uint256 a = 10;`\n function get10PowerDecimals(uint8 decimals) public pure returns (uint256) {\n- uint256 a = 10;\n+ uint256 a = 0;\n uint256 res = a ** decimals;\n return res;\n }\n", + "id": "14", + "line": 23, + "name": "mutants/14/MultipleContracts/C.sol", + "op": "LVR", + "orig": "10", + "original": "MultipleContracts/C.sol", + "repl": "0" + }, + { + "col": 21, + "description": "LiteralValueReplacement", + "diff": "--- original\n+++ mutant\n@@ -19,8 +19,9 @@\n return a;\n }\n \n+ /// LiteralValueReplacement(`10` |==> `11`) of: `uint256 a = 10;`\n function get10PowerDecimals(uint8 decimals) public pure returns (uint256) {\n- uint256 a = 10;\n+ uint256 a = 11;\n uint256 res = a ** decimals;\n return res;\n }\n", + "id": "15", + "line": 23, + "name": "mutants/15/MultipleContracts/C.sol", + "op": "LVR", + "orig": "10", + "original": "MultipleContracts/C.sol", + "repl": "11" + }, + { + "col": 25, + "description": "ArithmeticOperatorReplacement", + "diff": "--- original\n+++ mutant\n@@ -20,8 +20,9 @@\n }\n \n function get10PowerDecimals(uint8 decimals) public pure returns (uint256) {\n+ /// ArithmeticOperatorReplacement(`**` |==> `+`) of: `uint256 res = a ** decimals;`\n uint256 a = 10;\n- uint256 res = a ** decimals;\n+ uint256 res = a + decimals;\n return res;\n }\n \n", + "id": "16", + "line": 24, + "name": "mutants/16/MultipleContracts/C.sol", + "op": "AOR", + "orig": "**", + "original": "MultipleContracts/C.sol", + "repl": "+" + }, + { + "col": 25, + "description": "ArithmeticOperatorReplacement", + "diff": "--- original\n+++ mutant\n@@ -20,8 +20,9 @@\n }\n \n function get10PowerDecimals(uint8 decimals) public pure returns (uint256) {\n+ /// ArithmeticOperatorReplacement(`**` |==> `-`) of: `uint256 res = a ** decimals;`\n uint256 a = 10;\n- uint256 res = a ** decimals;\n+ uint256 res = a - decimals;\n return res;\n }\n \n", + "id": "17", + "line": 24, + "name": "mutants/17/MultipleContracts/C.sol", + "op": "AOR", + "orig": "**", + "original": "MultipleContracts/C.sol", + "repl": "-" + }, + { + "col": 25, + "description": "ArithmeticOperatorReplacement", + "diff": "--- original\n+++ mutant\n@@ -20,8 +20,9 @@\n }\n \n function get10PowerDecimals(uint8 decimals) public pure returns (uint256) {\n+ /// ArithmeticOperatorReplacement(`**` |==> `*`) of: `uint256 res = a ** decimals;`\n uint256 a = 10;\n- uint256 res = a ** decimals;\n+ uint256 res = a * decimals;\n return res;\n }\n \n", + "id": "18", + "line": 24, + "name": "mutants/18/MultipleContracts/C.sol", + "op": "AOR", + "orig": "**", + "original": "MultipleContracts/C.sol", + "repl": "*" + }, + { + "col": 25, + "description": "ArithmeticOperatorReplacement", + "diff": "--- original\n+++ mutant\n@@ -20,8 +20,9 @@\n }\n \n function get10PowerDecimals(uint8 decimals) public pure returns (uint256) {\n+ /// ArithmeticOperatorReplacement(`**` |==> `/`) of: `uint256 res = a ** decimals;`\n uint256 a = 10;\n- uint256 res = a ** decimals;\n+ uint256 res = a / decimals;\n return res;\n }\n \n", + "id": "19", + "line": 24, + "name": "mutants/19/MultipleContracts/C.sol", + "op": "AOR", + "orig": "**", + "original": "MultipleContracts/C.sol", + "repl": "/" + }, + { + "col": 25, + "description": "ArithmeticOperatorReplacement", + "diff": "--- original\n+++ mutant\n@@ -20,8 +20,9 @@\n }\n \n function get10PowerDecimals(uint8 decimals) public pure returns (uint256) {\n+ /// ArithmeticOperatorReplacement(`**` |==> `%`) of: `uint256 res = a ** decimals;`\n uint256 a = 10;\n- uint256 res = a ** decimals;\n+ uint256 res = a % decimals;\n return res;\n }\n \n", + "id": "20", + "line": 24, + "name": "mutants/20/MultipleContracts/C.sol", + "op": "AOR", + "orig": "**", + "original": "MultipleContracts/C.sol", + "repl": "%" + }, + { + "col": 9, + "description": "StatementDeletion", + "diff": "--- original\n+++ mutant\n@@ -21,8 +21,9 @@\n \n function get10PowerDecimals(uint8 decimals) public pure returns (uint256) {\n uint256 a = 10;\n+ /// StatementDeletion(`return res` |==> `assert(true)`) of: `return res;`\n uint256 res = a ** decimals;\n- return res;\n+ assert(true);\n }\n \n function getarray(address[] memory c, address e) public pure {\n", + "id": "21", + "line": 25, + "name": "mutants/21/MultipleContracts/C.sol", + "op": "STD", + "orig": "return res", + "original": "MultipleContracts/C.sol", + "repl": "assert(true)" + }, + { + "col": 9, + "description": "StatementDeletion", + "diff": "--- original\n+++ mutant\n@@ -25,8 +25,9 @@\n return res;\n }\n \n+ /// StatementDeletion(`assert(c[0] == e)` |==> `assert(true)`) of: `assert(c[0] == e);`\n function getarray(address[] memory c, address e) public pure {\n- assert(c[0] == e);\n+ assert(true);\n }\n \n function callmyself() external view {\n", + "id": "22", + "line": 29, + "name": "mutants/22/MultipleContracts/C.sol", + "op": "STD", + "orig": "assert(c[0] == e)", + "original": "MultipleContracts/C.sol", + "repl": "assert(true)" + }, + { + "col": 16, + "description": "RelationalOperatorReplacement", + "diff": "--- original\n+++ mutant\n@@ -25,8 +25,9 @@\n return res;\n }\n \n+ /// RelationalOperatorReplacement(`c[0] == e` |==> `false`) of: `assert(c[0] == e);`\n function getarray(address[] memory c, address e) public pure {\n- assert(c[0] == e);\n+ assert(false);\n }\n \n function callmyself() external view {\n", + "id": "23", + "line": 29, + "name": "mutants/23/MultipleContracts/C.sol", + "op": "ROR", + "orig": "c[0] == e", + "original": "MultipleContracts/C.sol", + "repl": "false" + }, + { + "col": 18, + "description": "LiteralValueReplacement", + "diff": "--- original\n+++ mutant\n@@ -25,8 +25,9 @@\n return res;\n }\n \n+ /// LiteralValueReplacement(`0` |==> `1`) of: `assert(c[0] == e);`\n function getarray(address[] memory c, address e) public pure {\n- assert(c[0] == e);\n+ assert(c[1] == e);\n }\n \n function callmyself() external view {\n", + "id": "24", + "line": 29, + "name": "mutants/24/MultipleContracts/C.sol", + "op": "LVR", + "orig": "0", + "original": "MultipleContracts/C.sol", + "repl": "1" + }, + { + "col": 9, + "description": "StatementDeletion", + "diff": "--- original\n+++ mutant\n@@ -30,8 +30,9 @@\n }\n \n function callmyself() external view {\n+ /// StatementDeletion(`Utils.getarray(b, address(this))` |==> `assert(true)`) of: `Utils.getarray(b, address(this));`\n address[] memory b = this.foo();\n- Utils.getarray(b, address(this));\n+ assert(true);\n }\n \n function add(int8 c, int8 d) public pure returns (int8) {\n", + "id": "25", + "line": 34, + "name": "mutants/25/MultipleContracts/C.sol", + "op": "STD", + "orig": "Utils.getarray(b, address(this))", + "original": "MultipleContracts/C.sol", + "repl": "assert(true)" + }, + { + "col": 9, + "description": "StatementDeletion", + "diff": "--- original\n+++ mutant\n@@ -34,7 +34,8 @@\n Utils.getarray(b, address(this));\n }\n \n+ /// StatementDeletion(`return c + d` |==> `assert(true)`) of: `return c + d;`\n function add(int8 c, int8 d) public pure returns (int8) {\n- return c + d;\n+ assert(true);\n }\n }\n", + "id": "26", + "line": 38, + "name": "mutants/26/MultipleContracts/C.sol", + "op": "STD", + "orig": "return c + d", + "original": "MultipleContracts/C.sol", + "repl": "assert(true)" + }, + { + "col": 18, + "description": "ArithmeticOperatorReplacement", + "diff": "--- original\n+++ mutant\n@@ -34,7 +34,8 @@\n Utils.getarray(b, address(this));\n }\n \n+ /// ArithmeticOperatorReplacement(`+` |==> `-`) of: `return c + d;`\n function add(int8 c, int8 d) public pure returns (int8) {\n- return c + d;\n+ return c - d;\n }\n }\n", + "id": "27", + "line": 38, + "name": "mutants/27/MultipleContracts/C.sol", + "op": "AOR", + "orig": "+", + "original": "MultipleContracts/C.sol", + "repl": "-" + }, + { + "col": 18, + "description": "ArithmeticOperatorReplacement", + "diff": "--- original\n+++ mutant\n@@ -34,7 +34,8 @@\n Utils.getarray(b, address(this));\n }\n \n+ /// ArithmeticOperatorReplacement(`+` |==> `*`) of: `return c + d;`\n function add(int8 c, int8 d) public pure returns (int8) {\n- return c + d;\n+ return c * d;\n }\n }\n", + "id": "28", + "line": 38, + "name": "mutants/28/MultipleContracts/C.sol", + "op": "AOR", + "orig": "+", + "original": "MultipleContracts/C.sol", + "repl": "*" + }, + { + "col": 18, + "description": "ArithmeticOperatorReplacement", + "diff": "--- original\n+++ mutant\n@@ -34,7 +34,8 @@\n Utils.getarray(b, address(this));\n }\n \n+ /// ArithmeticOperatorReplacement(`+` |==> `/`) of: `return c + d;`\n function add(int8 c, int8 d) public pure returns (int8) {\n- return c + d;\n+ return c / d;\n }\n }\n", + "id": "29", + "line": 38, + "name": "mutants/29/MultipleContracts/C.sol", + "op": "AOR", + "orig": "+", + "original": "MultipleContracts/C.sol", + "repl": "/" + }, + { + "col": 18, + "description": "ArithmeticOperatorReplacement", + "diff": "--- original\n+++ mutant\n@@ -34,7 +34,8 @@\n Utils.getarray(b, address(this));\n }\n \n+ /// ArithmeticOperatorReplacement(`+` |==> `%`) of: `return c + d;`\n function add(int8 c, int8 d) public pure returns (int8) {\n- return c + d;\n+ return c % d;\n }\n }\n", + "id": "30", + "line": 38, + "name": "mutants/30/MultipleContracts/C.sol", + "op": "AOR", + "orig": "+", + "original": "MultipleContracts/C.sol", + "repl": "%" + } +] \ No newline at end of file diff --git a/resources/regressions/test_multiple_contracts_3.json/mutants.log b/resources/regressions/test_multiple_contracts_3.json/mutants.log new file mode 100644 index 0000000..496a041 --- /dev/null +++ b/resources/regressions/test_multiple_contracts_3.json/mutants.log @@ -0,0 +1,30 @@ +1,STD,MultipleContracts/C.sol,7:9,assert(c[0] == e),assert(true) +2,ROR,MultipleContracts/C.sol,7:16,c[0] == e,false +3,LVR,MultipleContracts/C.sol,7:18,0,1 +4,STD,MultipleContracts/C.sol,11:9,return a + b,assert(true) +5,AOR,MultipleContracts/C.sol,11:18,+,- +6,AOR,MultipleContracts/C.sol,11:18,+,* +7,AOR,MultipleContracts/C.sol,11:18,+,/ +8,AOR,MultipleContracts/C.sol,11:18,+,% +9,LVR,MultipleContracts/C.sol,17:44,1,0 +10,LVR,MultipleContracts/C.sol,17:44,1,2 +11,STD,MultipleContracts/C.sol,18:9,a[0] = msg.sender,assert(true) +12,LVR,MultipleContracts/C.sol,18:11,0,1 +13,STD,MultipleContracts/C.sol,19:9,return a,assert(true) +14,LVR,MultipleContracts/C.sol,23:21,10,0 +15,LVR,MultipleContracts/C.sol,23:21,10,11 +16,AOR,MultipleContracts/C.sol,24:25,**,+ +17,AOR,MultipleContracts/C.sol,24:25,**,- +18,AOR,MultipleContracts/C.sol,24:25,**,* +19,AOR,MultipleContracts/C.sol,24:25,**,/ +20,AOR,MultipleContracts/C.sol,24:25,**,% +21,STD,MultipleContracts/C.sol,25:9,return res,assert(true) +22,STD,MultipleContracts/C.sol,29:9,assert(c[0] == e),assert(true) +23,ROR,MultipleContracts/C.sol,29:16,c[0] == e,false +24,LVR,MultipleContracts/C.sol,29:18,0,1 +25,STD,MultipleContracts/C.sol,34:9,"Utils.getarray(b, address(this))",assert(true) +26,STD,MultipleContracts/C.sol,38:9,return c + d,assert(true) +27,AOR,MultipleContracts/C.sol,38:18,+,- +28,AOR,MultipleContracts/C.sol,38:18,+,* +29,AOR,MultipleContracts/C.sol,38:18,+,/ +30,AOR,MultipleContracts/C.sol,38:18,+,% diff --git a/resources/regressions/multiple-contracts-3.json/mutants/1/MultipleContracts/C.sol b/resources/regressions/test_multiple_contracts_3.json/mutants/1/MultipleContracts/C.sol similarity index 90% rename from resources/regressions/multiple-contracts-3.json/mutants/1/MultipleContracts/C.sol rename to resources/regressions/test_multiple_contracts_3.json/mutants/1/MultipleContracts/C.sol index dd751c5..5f69007 100644 --- a/resources/regressions/multiple-contracts-3.json/mutants/1/MultipleContracts/C.sol +++ b/resources/regressions/test_multiple_contracts_3.json/mutants/1/MultipleContracts/C.sol @@ -3,8 +3,8 @@ pragma solidity ^0.8.13; library Utils { + /// StatementDeletion(`assert(c[0] == e)` |==> `assert(true)`) of: `assert(c[0] == e);` function getarray(address[] memory c, address e) internal pure { - /// DeleteExpressionMutation(`assert(c[0] == e)` |==> `assert(true)`) of: `assert(c[0] == e);` assert(true); } diff --git a/resources/regressions/test_multiple_contracts_3.json/mutants/10/MultipleContracts/C.sol b/resources/regressions/test_multiple_contracts_3.json/mutants/10/MultipleContracts/C.sol new file mode 100644 index 0000000..16f8bc8 --- /dev/null +++ b/resources/regressions/test_multiple_contracts_3.json/mutants/10/MultipleContracts/C.sol @@ -0,0 +1,41 @@ +// SPDX-License-Identifier: GPL-3.0-only + +pragma solidity ^0.8.13; + +library Utils { + function getarray(address[] memory c, address e) internal pure { + assert(c[0] == e); + } + + function add(int8 a, int8 b) public pure returns (int8) { + return a + b; + } +} + +contract C { + /// LiteralValueReplacement(`1` |==> `2`) of: `address[] memory a = new address[](1);` + function foo() external view returns (address[] memory) { + address[] memory a = new address[](2); + a[0] = msg.sender; + return a; + } + + function get10PowerDecimals(uint8 decimals) public pure returns (uint256) { + uint256 a = 10; + uint256 res = a ** decimals; + return res; + } + + function getarray(address[] memory c, address e) public pure { + assert(c[0] == e); + } + + function callmyself() external view { + address[] memory b = this.foo(); + Utils.getarray(b, address(this)); + } + + function add(int8 c, int8 d) public pure returns (int8) { + return c + d; + } +} diff --git a/resources/regressions/multiple-contracts-3.json/mutants/6/MultipleContracts/C.sol b/resources/regressions/test_multiple_contracts_3.json/mutants/11/MultipleContracts/C.sol similarity index 90% rename from resources/regressions/multiple-contracts-3.json/mutants/6/MultipleContracts/C.sol rename to resources/regressions/test_multiple_contracts_3.json/mutants/11/MultipleContracts/C.sol index 5407440..427647a 100644 --- a/resources/regressions/multiple-contracts-3.json/mutants/6/MultipleContracts/C.sol +++ b/resources/regressions/test_multiple_contracts_3.json/mutants/11/MultipleContracts/C.sol @@ -14,8 +14,8 @@ library Utils { contract C { function foo() external view returns (address[] memory) { + /// StatementDeletion(`a[0] = msg.sender` |==> `assert(true)`) of: `a[0] = msg.sender;` address[] memory a = new address[](1); - /// DeleteExpressionMutation(`a[0] = msg.sender` |==> `assert(true)`) of: `a[0] = msg.sender;` assert(true); return a; } diff --git a/resources/regressions/test_multiple_contracts_3.json/mutants/12/MultipleContracts/C.sol b/resources/regressions/test_multiple_contracts_3.json/mutants/12/MultipleContracts/C.sol new file mode 100644 index 0000000..9db93f1 --- /dev/null +++ b/resources/regressions/test_multiple_contracts_3.json/mutants/12/MultipleContracts/C.sol @@ -0,0 +1,41 @@ +// SPDX-License-Identifier: GPL-3.0-only + +pragma solidity ^0.8.13; + +library Utils { + function getarray(address[] memory c, address e) internal pure { + assert(c[0] == e); + } + + function add(int8 a, int8 b) public pure returns (int8) { + return a + b; + } +} + +contract C { + function foo() external view returns (address[] memory) { + /// LiteralValueReplacement(`0` |==> `1`) of: `a[0] = msg.sender;` + address[] memory a = new address[](1); + a[1] = msg.sender; + return a; + } + + function get10PowerDecimals(uint8 decimals) public pure returns (uint256) { + uint256 a = 10; + uint256 res = a ** decimals; + return res; + } + + function getarray(address[] memory c, address e) public pure { + assert(c[0] == e); + } + + function callmyself() external view { + address[] memory b = this.foo(); + Utils.getarray(b, address(this)); + } + + function add(int8 c, int8 d) public pure returns (int8) { + return c + d; + } +} diff --git a/resources/regressions/test_multiple_contracts_3.json/mutants/13/MultipleContracts/C.sol b/resources/regressions/test_multiple_contracts_3.json/mutants/13/MultipleContracts/C.sol new file mode 100644 index 0000000..a9342ea --- /dev/null +++ b/resources/regressions/test_multiple_contracts_3.json/mutants/13/MultipleContracts/C.sol @@ -0,0 +1,41 @@ +// SPDX-License-Identifier: GPL-3.0-only + +pragma solidity ^0.8.13; + +library Utils { + function getarray(address[] memory c, address e) internal pure { + assert(c[0] == e); + } + + function add(int8 a, int8 b) public pure returns (int8) { + return a + b; + } +} + +contract C { + function foo() external view returns (address[] memory) { + address[] memory a = new address[](1); + /// StatementDeletion(`return a` |==> `assert(true)`) of: `return a;` + a[0] = msg.sender; + assert(true); + } + + function get10PowerDecimals(uint8 decimals) public pure returns (uint256) { + uint256 a = 10; + uint256 res = a ** decimals; + return res; + } + + function getarray(address[] memory c, address e) public pure { + assert(c[0] == e); + } + + function callmyself() external view { + address[] memory b = this.foo(); + Utils.getarray(b, address(this)); + } + + function add(int8 c, int8 d) public pure returns (int8) { + return c + d; + } +} diff --git a/resources/regressions/test_multiple_contracts_3.json/mutants/14/MultipleContracts/C.sol b/resources/regressions/test_multiple_contracts_3.json/mutants/14/MultipleContracts/C.sol new file mode 100644 index 0000000..f2136ed --- /dev/null +++ b/resources/regressions/test_multiple_contracts_3.json/mutants/14/MultipleContracts/C.sol @@ -0,0 +1,41 @@ +// SPDX-License-Identifier: GPL-3.0-only + +pragma solidity ^0.8.13; + +library Utils { + function getarray(address[] memory c, address e) internal pure { + assert(c[0] == e); + } + + function add(int8 a, int8 b) public pure returns (int8) { + return a + b; + } +} + +contract C { + function foo() external view returns (address[] memory) { + address[] memory a = new address[](1); + a[0] = msg.sender; + return a; + } + + /// LiteralValueReplacement(`10` |==> `0`) of: `uint256 a = 10;` + function get10PowerDecimals(uint8 decimals) public pure returns (uint256) { + uint256 a = 0; + uint256 res = a ** decimals; + return res; + } + + function getarray(address[] memory c, address e) public pure { + assert(c[0] == e); + } + + function callmyself() external view { + address[] memory b = this.foo(); + Utils.getarray(b, address(this)); + } + + function add(int8 c, int8 d) public pure returns (int8) { + return c + d; + } +} diff --git a/resources/regressions/test_multiple_contracts_3.json/mutants/15/MultipleContracts/C.sol b/resources/regressions/test_multiple_contracts_3.json/mutants/15/MultipleContracts/C.sol new file mode 100644 index 0000000..f69e336 --- /dev/null +++ b/resources/regressions/test_multiple_contracts_3.json/mutants/15/MultipleContracts/C.sol @@ -0,0 +1,41 @@ +// SPDX-License-Identifier: GPL-3.0-only + +pragma solidity ^0.8.13; + +library Utils { + function getarray(address[] memory c, address e) internal pure { + assert(c[0] == e); + } + + function add(int8 a, int8 b) public pure returns (int8) { + return a + b; + } +} + +contract C { + function foo() external view returns (address[] memory) { + address[] memory a = new address[](1); + a[0] = msg.sender; + return a; + } + + /// LiteralValueReplacement(`10` |==> `11`) of: `uint256 a = 10;` + function get10PowerDecimals(uint8 decimals) public pure returns (uint256) { + uint256 a = 11; + uint256 res = a ** decimals; + return res; + } + + function getarray(address[] memory c, address e) public pure { + assert(c[0] == e); + } + + function callmyself() external view { + address[] memory b = this.foo(); + Utils.getarray(b, address(this)); + } + + function add(int8 c, int8 d) public pure returns (int8) { + return c + d; + } +} diff --git a/resources/regressions/test_multiple_contracts_3.json/mutants/16/MultipleContracts/C.sol b/resources/regressions/test_multiple_contracts_3.json/mutants/16/MultipleContracts/C.sol new file mode 100644 index 0000000..13319cb --- /dev/null +++ b/resources/regressions/test_multiple_contracts_3.json/mutants/16/MultipleContracts/C.sol @@ -0,0 +1,41 @@ +// SPDX-License-Identifier: GPL-3.0-only + +pragma solidity ^0.8.13; + +library Utils { + function getarray(address[] memory c, address e) internal pure { + assert(c[0] == e); + } + + function add(int8 a, int8 b) public pure returns (int8) { + return a + b; + } +} + +contract C { + function foo() external view returns (address[] memory) { + address[] memory a = new address[](1); + a[0] = msg.sender; + return a; + } + + function get10PowerDecimals(uint8 decimals) public pure returns (uint256) { + /// ArithmeticOperatorReplacement(`**` |==> `+`) of: `uint256 res = a ** decimals;` + uint256 a = 10; + uint256 res = a + decimals; + return res; + } + + function getarray(address[] memory c, address e) public pure { + assert(c[0] == e); + } + + function callmyself() external view { + address[] memory b = this.foo(); + Utils.getarray(b, address(this)); + } + + function add(int8 c, int8 d) public pure returns (int8) { + return c + d; + } +} diff --git a/resources/regressions/test_multiple_contracts_3.json/mutants/17/MultipleContracts/C.sol b/resources/regressions/test_multiple_contracts_3.json/mutants/17/MultipleContracts/C.sol new file mode 100644 index 0000000..3279b41 --- /dev/null +++ b/resources/regressions/test_multiple_contracts_3.json/mutants/17/MultipleContracts/C.sol @@ -0,0 +1,41 @@ +// SPDX-License-Identifier: GPL-3.0-only + +pragma solidity ^0.8.13; + +library Utils { + function getarray(address[] memory c, address e) internal pure { + assert(c[0] == e); + } + + function add(int8 a, int8 b) public pure returns (int8) { + return a + b; + } +} + +contract C { + function foo() external view returns (address[] memory) { + address[] memory a = new address[](1); + a[0] = msg.sender; + return a; + } + + function get10PowerDecimals(uint8 decimals) public pure returns (uint256) { + /// ArithmeticOperatorReplacement(`**` |==> `-`) of: `uint256 res = a ** decimals;` + uint256 a = 10; + uint256 res = a - decimals; + return res; + } + + function getarray(address[] memory c, address e) public pure { + assert(c[0] == e); + } + + function callmyself() external view { + address[] memory b = this.foo(); + Utils.getarray(b, address(this)); + } + + function add(int8 c, int8 d) public pure returns (int8) { + return c + d; + } +} diff --git a/resources/regressions/test_multiple_contracts_3.json/mutants/18/MultipleContracts/C.sol b/resources/regressions/test_multiple_contracts_3.json/mutants/18/MultipleContracts/C.sol new file mode 100644 index 0000000..95cc94e --- /dev/null +++ b/resources/regressions/test_multiple_contracts_3.json/mutants/18/MultipleContracts/C.sol @@ -0,0 +1,41 @@ +// SPDX-License-Identifier: GPL-3.0-only + +pragma solidity ^0.8.13; + +library Utils { + function getarray(address[] memory c, address e) internal pure { + assert(c[0] == e); + } + + function add(int8 a, int8 b) public pure returns (int8) { + return a + b; + } +} + +contract C { + function foo() external view returns (address[] memory) { + address[] memory a = new address[](1); + a[0] = msg.sender; + return a; + } + + function get10PowerDecimals(uint8 decimals) public pure returns (uint256) { + /// ArithmeticOperatorReplacement(`**` |==> `*`) of: `uint256 res = a ** decimals;` + uint256 a = 10; + uint256 res = a * decimals; + return res; + } + + function getarray(address[] memory c, address e) public pure { + assert(c[0] == e); + } + + function callmyself() external view { + address[] memory b = this.foo(); + Utils.getarray(b, address(this)); + } + + function add(int8 c, int8 d) public pure returns (int8) { + return c + d; + } +} diff --git a/resources/regressions/test_multiple_contracts_3.json/mutants/19/MultipleContracts/C.sol b/resources/regressions/test_multiple_contracts_3.json/mutants/19/MultipleContracts/C.sol new file mode 100644 index 0000000..cc3476f --- /dev/null +++ b/resources/regressions/test_multiple_contracts_3.json/mutants/19/MultipleContracts/C.sol @@ -0,0 +1,41 @@ +// SPDX-License-Identifier: GPL-3.0-only + +pragma solidity ^0.8.13; + +library Utils { + function getarray(address[] memory c, address e) internal pure { + assert(c[0] == e); + } + + function add(int8 a, int8 b) public pure returns (int8) { + return a + b; + } +} + +contract C { + function foo() external view returns (address[] memory) { + address[] memory a = new address[](1); + a[0] = msg.sender; + return a; + } + + function get10PowerDecimals(uint8 decimals) public pure returns (uint256) { + /// ArithmeticOperatorReplacement(`**` |==> `/`) of: `uint256 res = a ** decimals;` + uint256 a = 10; + uint256 res = a / decimals; + return res; + } + + function getarray(address[] memory c, address e) public pure { + assert(c[0] == e); + } + + function callmyself() external view { + address[] memory b = this.foo(); + Utils.getarray(b, address(this)); + } + + function add(int8 c, int8 d) public pure returns (int8) { + return c + d; + } +} diff --git a/resources/regressions/test_multiple_contracts_3.json/mutants/2/MultipleContracts/C.sol b/resources/regressions/test_multiple_contracts_3.json/mutants/2/MultipleContracts/C.sol new file mode 100644 index 0000000..ecdc98c --- /dev/null +++ b/resources/regressions/test_multiple_contracts_3.json/mutants/2/MultipleContracts/C.sol @@ -0,0 +1,41 @@ +// SPDX-License-Identifier: GPL-3.0-only + +pragma solidity ^0.8.13; + +library Utils { + /// RelationalOperatorReplacement(`c[0] == e` |==> `false`) of: `assert(c[0] == e);` + function getarray(address[] memory c, address e) internal pure { + assert(false); + } + + function add(int8 a, int8 b) public pure returns (int8) { + return a + b; + } +} + +contract C { + function foo() external view returns (address[] memory) { + address[] memory a = new address[](1); + a[0] = msg.sender; + return a; + } + + function get10PowerDecimals(uint8 decimals) public pure returns (uint256) { + uint256 a = 10; + uint256 res = a ** decimals; + return res; + } + + function getarray(address[] memory c, address e) public pure { + assert(c[0] == e); + } + + function callmyself() external view { + address[] memory b = this.foo(); + Utils.getarray(b, address(this)); + } + + function add(int8 c, int8 d) public pure returns (int8) { + return c + d; + } +} diff --git a/resources/regressions/test_multiple_contracts_3.json/mutants/20/MultipleContracts/C.sol b/resources/regressions/test_multiple_contracts_3.json/mutants/20/MultipleContracts/C.sol new file mode 100644 index 0000000..4979f42 --- /dev/null +++ b/resources/regressions/test_multiple_contracts_3.json/mutants/20/MultipleContracts/C.sol @@ -0,0 +1,41 @@ +// SPDX-License-Identifier: GPL-3.0-only + +pragma solidity ^0.8.13; + +library Utils { + function getarray(address[] memory c, address e) internal pure { + assert(c[0] == e); + } + + function add(int8 a, int8 b) public pure returns (int8) { + return a + b; + } +} + +contract C { + function foo() external view returns (address[] memory) { + address[] memory a = new address[](1); + a[0] = msg.sender; + return a; + } + + function get10PowerDecimals(uint8 decimals) public pure returns (uint256) { + /// ArithmeticOperatorReplacement(`**` |==> `%`) of: `uint256 res = a ** decimals;` + uint256 a = 10; + uint256 res = a % decimals; + return res; + } + + function getarray(address[] memory c, address e) public pure { + assert(c[0] == e); + } + + function callmyself() external view { + address[] memory b = this.foo(); + Utils.getarray(b, address(this)); + } + + function add(int8 c, int8 d) public pure returns (int8) { + return c + d; + } +} diff --git a/resources/regressions/test_multiple_contracts_3.json/mutants/21/MultipleContracts/C.sol b/resources/regressions/test_multiple_contracts_3.json/mutants/21/MultipleContracts/C.sol new file mode 100644 index 0000000..5933d06 --- /dev/null +++ b/resources/regressions/test_multiple_contracts_3.json/mutants/21/MultipleContracts/C.sol @@ -0,0 +1,41 @@ +// SPDX-License-Identifier: GPL-3.0-only + +pragma solidity ^0.8.13; + +library Utils { + function getarray(address[] memory c, address e) internal pure { + assert(c[0] == e); + } + + function add(int8 a, int8 b) public pure returns (int8) { + return a + b; + } +} + +contract C { + function foo() external view returns (address[] memory) { + address[] memory a = new address[](1); + a[0] = msg.sender; + return a; + } + + function get10PowerDecimals(uint8 decimals) public pure returns (uint256) { + uint256 a = 10; + /// StatementDeletion(`return res` |==> `assert(true)`) of: `return res;` + uint256 res = a ** decimals; + assert(true); + } + + function getarray(address[] memory c, address e) public pure { + assert(c[0] == e); + } + + function callmyself() external view { + address[] memory b = this.foo(); + Utils.getarray(b, address(this)); + } + + function add(int8 c, int8 d) public pure returns (int8) { + return c + d; + } +} diff --git a/resources/regressions/multiple-contracts-3.json/mutants/13/MultipleContracts/C.sol b/resources/regressions/test_multiple_contracts_3.json/mutants/22/MultipleContracts/C.sol similarity index 90% rename from resources/regressions/multiple-contracts-3.json/mutants/13/MultipleContracts/C.sol rename to resources/regressions/test_multiple_contracts_3.json/mutants/22/MultipleContracts/C.sol index 93b8986..a4c6c97 100644 --- a/resources/regressions/multiple-contracts-3.json/mutants/13/MultipleContracts/C.sol +++ b/resources/regressions/test_multiple_contracts_3.json/mutants/22/MultipleContracts/C.sol @@ -25,8 +25,8 @@ contract C { return res; } + /// StatementDeletion(`assert(c[0] == e)` |==> `assert(true)`) of: `assert(c[0] == e);` function getarray(address[] memory c, address e) public pure { - /// DeleteExpressionMutation(`assert(c[0] == e)` |==> `assert(true)`) of: `assert(c[0] == e);` assert(true); } diff --git a/resources/regressions/test_multiple_contracts_3.json/mutants/23/MultipleContracts/C.sol b/resources/regressions/test_multiple_contracts_3.json/mutants/23/MultipleContracts/C.sol new file mode 100644 index 0000000..781e87b --- /dev/null +++ b/resources/regressions/test_multiple_contracts_3.json/mutants/23/MultipleContracts/C.sol @@ -0,0 +1,41 @@ +// SPDX-License-Identifier: GPL-3.0-only + +pragma solidity ^0.8.13; + +library Utils { + function getarray(address[] memory c, address e) internal pure { + assert(c[0] == e); + } + + function add(int8 a, int8 b) public pure returns (int8) { + return a + b; + } +} + +contract C { + function foo() external view returns (address[] memory) { + address[] memory a = new address[](1); + a[0] = msg.sender; + return a; + } + + function get10PowerDecimals(uint8 decimals) public pure returns (uint256) { + uint256 a = 10; + uint256 res = a ** decimals; + return res; + } + + /// RelationalOperatorReplacement(`c[0] == e` |==> `false`) of: `assert(c[0] == e);` + function getarray(address[] memory c, address e) public pure { + assert(false); + } + + function callmyself() external view { + address[] memory b = this.foo(); + Utils.getarray(b, address(this)); + } + + function add(int8 c, int8 d) public pure returns (int8) { + return c + d; + } +} diff --git a/resources/regressions/test_multiple_contracts_3.json/mutants/24/MultipleContracts/C.sol b/resources/regressions/test_multiple_contracts_3.json/mutants/24/MultipleContracts/C.sol new file mode 100644 index 0000000..7749a0c --- /dev/null +++ b/resources/regressions/test_multiple_contracts_3.json/mutants/24/MultipleContracts/C.sol @@ -0,0 +1,41 @@ +// SPDX-License-Identifier: GPL-3.0-only + +pragma solidity ^0.8.13; + +library Utils { + function getarray(address[] memory c, address e) internal pure { + assert(c[0] == e); + } + + function add(int8 a, int8 b) public pure returns (int8) { + return a + b; + } +} + +contract C { + function foo() external view returns (address[] memory) { + address[] memory a = new address[](1); + a[0] = msg.sender; + return a; + } + + function get10PowerDecimals(uint8 decimals) public pure returns (uint256) { + uint256 a = 10; + uint256 res = a ** decimals; + return res; + } + + /// LiteralValueReplacement(`0` |==> `1`) of: `assert(c[0] == e);` + function getarray(address[] memory c, address e) public pure { + assert(c[1] == e); + } + + function callmyself() external view { + address[] memory b = this.foo(); + Utils.getarray(b, address(this)); + } + + function add(int8 c, int8 d) public pure returns (int8) { + return c + d; + } +} diff --git a/resources/regressions/multiple-contracts-3.json/mutants/14/MultipleContracts/C.sol b/resources/regressions/test_multiple_contracts_3.json/mutants/25/MultipleContracts/C.sol similarity index 87% rename from resources/regressions/multiple-contracts-3.json/mutants/14/MultipleContracts/C.sol rename to resources/regressions/test_multiple_contracts_3.json/mutants/25/MultipleContracts/C.sol index 4339e0f..a14e05d 100644 --- a/resources/regressions/multiple-contracts-3.json/mutants/14/MultipleContracts/C.sol +++ b/resources/regressions/test_multiple_contracts_3.json/mutants/25/MultipleContracts/C.sol @@ -30,8 +30,8 @@ contract C { } function callmyself() external view { + /// StatementDeletion(`Utils.getarray(b, address(this))` |==> `assert(true)`) of: `Utils.getarray(b, address(this));` address[] memory b = this.foo(); - /// DeleteExpressionMutation(`Utils.getarray(b, address(this))` |==> `assert(true)`) of: `Utils.getarray(b, address(this));` assert(true); } diff --git a/resources/regressions/test_multiple_contracts_3.json/mutants/26/MultipleContracts/C.sol b/resources/regressions/test_multiple_contracts_3.json/mutants/26/MultipleContracts/C.sol new file mode 100644 index 0000000..4887a93 --- /dev/null +++ b/resources/regressions/test_multiple_contracts_3.json/mutants/26/MultipleContracts/C.sol @@ -0,0 +1,41 @@ +// SPDX-License-Identifier: GPL-3.0-only + +pragma solidity ^0.8.13; + +library Utils { + function getarray(address[] memory c, address e) internal pure { + assert(c[0] == e); + } + + function add(int8 a, int8 b) public pure returns (int8) { + return a + b; + } +} + +contract C { + function foo() external view returns (address[] memory) { + address[] memory a = new address[](1); + a[0] = msg.sender; + return a; + } + + function get10PowerDecimals(uint8 decimals) public pure returns (uint256) { + uint256 a = 10; + uint256 res = a ** decimals; + return res; + } + + function getarray(address[] memory c, address e) public pure { + assert(c[0] == e); + } + + function callmyself() external view { + address[] memory b = this.foo(); + Utils.getarray(b, address(this)); + } + + /// StatementDeletion(`return c + d` |==> `assert(true)`) of: `return c + d;` + function add(int8 c, int8 d) public pure returns (int8) { + assert(true); + } +} diff --git a/resources/regressions/multiple-contracts-3.json/mutants/15/MultipleContracts/C.sol b/resources/regressions/test_multiple_contracts_3.json/mutants/27/MultipleContracts/C.sol similarity index 90% rename from resources/regressions/multiple-contracts-3.json/mutants/15/MultipleContracts/C.sol rename to resources/regressions/test_multiple_contracts_3.json/mutants/27/MultipleContracts/C.sol index 6568d8b..7a0c07d 100644 --- a/resources/regressions/multiple-contracts-3.json/mutants/15/MultipleContracts/C.sol +++ b/resources/regressions/test_multiple_contracts_3.json/mutants/27/MultipleContracts/C.sol @@ -34,8 +34,8 @@ contract C { Utils.getarray(b, address(this)); } + /// ArithmeticOperatorReplacement(`+` |==> `-`) of: `return c + d;` function add(int8 c, int8 d) public pure returns (int8) { - /// BinaryOpMutation(`+` |==> `-`) of: `return c + d;` - return c-d; + return c - d; } } diff --git a/resources/regressions/multiple-contracts-3.json/mutants/16/MultipleContracts/C.sol b/resources/regressions/test_multiple_contracts_3.json/mutants/28/MultipleContracts/C.sol similarity index 90% rename from resources/regressions/multiple-contracts-3.json/mutants/16/MultipleContracts/C.sol rename to resources/regressions/test_multiple_contracts_3.json/mutants/28/MultipleContracts/C.sol index b4f749d..d73584b 100644 --- a/resources/regressions/multiple-contracts-3.json/mutants/16/MultipleContracts/C.sol +++ b/resources/regressions/test_multiple_contracts_3.json/mutants/28/MultipleContracts/C.sol @@ -34,8 +34,8 @@ contract C { Utils.getarray(b, address(this)); } + /// ArithmeticOperatorReplacement(`+` |==> `*`) of: `return c + d;` function add(int8 c, int8 d) public pure returns (int8) { - /// BinaryOpMutation(`+` |==> `*`) of: `return c + d;` - return c*d; + return c * d; } } diff --git a/resources/regressions/multiple-contracts-3.json/mutants/17/MultipleContracts/C.sol b/resources/regressions/test_multiple_contracts_3.json/mutants/29/MultipleContracts/C.sol similarity index 90% rename from resources/regressions/multiple-contracts-3.json/mutants/17/MultipleContracts/C.sol rename to resources/regressions/test_multiple_contracts_3.json/mutants/29/MultipleContracts/C.sol index 206e0f6..c226dcf 100644 --- a/resources/regressions/multiple-contracts-3.json/mutants/17/MultipleContracts/C.sol +++ b/resources/regressions/test_multiple_contracts_3.json/mutants/29/MultipleContracts/C.sol @@ -34,8 +34,8 @@ contract C { Utils.getarray(b, address(this)); } + /// ArithmeticOperatorReplacement(`+` |==> `/`) of: `return c + d;` function add(int8 c, int8 d) public pure returns (int8) { - /// BinaryOpMutation(`+` |==> `/`) of: `return c + d;` - return c/d; + return c / d; } } diff --git a/resources/regressions/test_multiple_contracts_3.json/mutants/3/MultipleContracts/C.sol b/resources/regressions/test_multiple_contracts_3.json/mutants/3/MultipleContracts/C.sol new file mode 100644 index 0000000..e9466e0 --- /dev/null +++ b/resources/regressions/test_multiple_contracts_3.json/mutants/3/MultipleContracts/C.sol @@ -0,0 +1,41 @@ +// SPDX-License-Identifier: GPL-3.0-only + +pragma solidity ^0.8.13; + +library Utils { + /// LiteralValueReplacement(`0` |==> `1`) of: `assert(c[0] == e);` + function getarray(address[] memory c, address e) internal pure { + assert(c[1] == e); + } + + function add(int8 a, int8 b) public pure returns (int8) { + return a + b; + } +} + +contract C { + function foo() external view returns (address[] memory) { + address[] memory a = new address[](1); + a[0] = msg.sender; + return a; + } + + function get10PowerDecimals(uint8 decimals) public pure returns (uint256) { + uint256 a = 10; + uint256 res = a ** decimals; + return res; + } + + function getarray(address[] memory c, address e) public pure { + assert(c[0] == e); + } + + function callmyself() external view { + address[] memory b = this.foo(); + Utils.getarray(b, address(this)); + } + + function add(int8 c, int8 d) public pure returns (int8) { + return c + d; + } +} diff --git a/resources/regressions/multiple-contracts-3.json/mutants/18/MultipleContracts/C.sol b/resources/regressions/test_multiple_contracts_3.json/mutants/30/MultipleContracts/C.sol similarity index 90% rename from resources/regressions/multiple-contracts-3.json/mutants/18/MultipleContracts/C.sol rename to resources/regressions/test_multiple_contracts_3.json/mutants/30/MultipleContracts/C.sol index 2d95fad..c6022ee 100644 --- a/resources/regressions/multiple-contracts-3.json/mutants/18/MultipleContracts/C.sol +++ b/resources/regressions/test_multiple_contracts_3.json/mutants/30/MultipleContracts/C.sol @@ -34,8 +34,8 @@ contract C { Utils.getarray(b, address(this)); } + /// ArithmeticOperatorReplacement(`+` |==> `%`) of: `return c + d;` function add(int8 c, int8 d) public pure returns (int8) { - /// BinaryOpMutation(`+` |==> `%`) of: `return c + d;` - return c%d; + return c % d; } } diff --git a/resources/regressions/test_multiple_contracts_3.json/mutants/4/MultipleContracts/C.sol b/resources/regressions/test_multiple_contracts_3.json/mutants/4/MultipleContracts/C.sol new file mode 100644 index 0000000..f7a4873 --- /dev/null +++ b/resources/regressions/test_multiple_contracts_3.json/mutants/4/MultipleContracts/C.sol @@ -0,0 +1,41 @@ +// SPDX-License-Identifier: GPL-3.0-only + +pragma solidity ^0.8.13; + +library Utils { + function getarray(address[] memory c, address e) internal pure { + assert(c[0] == e); + } + + /// StatementDeletion(`return a + b` |==> `assert(true)`) of: `return a + b;` + function add(int8 a, int8 b) public pure returns (int8) { + assert(true); + } +} + +contract C { + function foo() external view returns (address[] memory) { + address[] memory a = new address[](1); + a[0] = msg.sender; + return a; + } + + function get10PowerDecimals(uint8 decimals) public pure returns (uint256) { + uint256 a = 10; + uint256 res = a ** decimals; + return res; + } + + function getarray(address[] memory c, address e) public pure { + assert(c[0] == e); + } + + function callmyself() external view { + address[] memory b = this.foo(); + Utils.getarray(b, address(this)); + } + + function add(int8 c, int8 d) public pure returns (int8) { + return c + d; + } +} diff --git a/resources/regressions/test_multiple_contracts_3.json/mutants/5/MultipleContracts/C.sol b/resources/regressions/test_multiple_contracts_3.json/mutants/5/MultipleContracts/C.sol new file mode 100644 index 0000000..9e5f617 --- /dev/null +++ b/resources/regressions/test_multiple_contracts_3.json/mutants/5/MultipleContracts/C.sol @@ -0,0 +1,41 @@ +// SPDX-License-Identifier: GPL-3.0-only + +pragma solidity ^0.8.13; + +library Utils { + function getarray(address[] memory c, address e) internal pure { + assert(c[0] == e); + } + + /// ArithmeticOperatorReplacement(`+` |==> `-`) of: `return a + b;` + function add(int8 a, int8 b) public pure returns (int8) { + return a - b; + } +} + +contract C { + function foo() external view returns (address[] memory) { + address[] memory a = new address[](1); + a[0] = msg.sender; + return a; + } + + function get10PowerDecimals(uint8 decimals) public pure returns (uint256) { + uint256 a = 10; + uint256 res = a ** decimals; + return res; + } + + function getarray(address[] memory c, address e) public pure { + assert(c[0] == e); + } + + function callmyself() external view { + address[] memory b = this.foo(); + Utils.getarray(b, address(this)); + } + + function add(int8 c, int8 d) public pure returns (int8) { + return c + d; + } +} diff --git a/resources/regressions/test_multiple_contracts_3.json/mutants/6/MultipleContracts/C.sol b/resources/regressions/test_multiple_contracts_3.json/mutants/6/MultipleContracts/C.sol new file mode 100644 index 0000000..8612532 --- /dev/null +++ b/resources/regressions/test_multiple_contracts_3.json/mutants/6/MultipleContracts/C.sol @@ -0,0 +1,41 @@ +// SPDX-License-Identifier: GPL-3.0-only + +pragma solidity ^0.8.13; + +library Utils { + function getarray(address[] memory c, address e) internal pure { + assert(c[0] == e); + } + + /// ArithmeticOperatorReplacement(`+` |==> `*`) of: `return a + b;` + function add(int8 a, int8 b) public pure returns (int8) { + return a * b; + } +} + +contract C { + function foo() external view returns (address[] memory) { + address[] memory a = new address[](1); + a[0] = msg.sender; + return a; + } + + function get10PowerDecimals(uint8 decimals) public pure returns (uint256) { + uint256 a = 10; + uint256 res = a ** decimals; + return res; + } + + function getarray(address[] memory c, address e) public pure { + assert(c[0] == e); + } + + function callmyself() external view { + address[] memory b = this.foo(); + Utils.getarray(b, address(this)); + } + + function add(int8 c, int8 d) public pure returns (int8) { + return c + d; + } +} diff --git a/resources/regressions/test_multiple_contracts_3.json/mutants/7/MultipleContracts/C.sol b/resources/regressions/test_multiple_contracts_3.json/mutants/7/MultipleContracts/C.sol new file mode 100644 index 0000000..e85ef12 --- /dev/null +++ b/resources/regressions/test_multiple_contracts_3.json/mutants/7/MultipleContracts/C.sol @@ -0,0 +1,41 @@ +// SPDX-License-Identifier: GPL-3.0-only + +pragma solidity ^0.8.13; + +library Utils { + function getarray(address[] memory c, address e) internal pure { + assert(c[0] == e); + } + + /// ArithmeticOperatorReplacement(`+` |==> `/`) of: `return a + b;` + function add(int8 a, int8 b) public pure returns (int8) { + return a / b; + } +} + +contract C { + function foo() external view returns (address[] memory) { + address[] memory a = new address[](1); + a[0] = msg.sender; + return a; + } + + function get10PowerDecimals(uint8 decimals) public pure returns (uint256) { + uint256 a = 10; + uint256 res = a ** decimals; + return res; + } + + function getarray(address[] memory c, address e) public pure { + assert(c[0] == e); + } + + function callmyself() external view { + address[] memory b = this.foo(); + Utils.getarray(b, address(this)); + } + + function add(int8 c, int8 d) public pure returns (int8) { + return c + d; + } +} diff --git a/resources/regressions/test_multiple_contracts_3.json/mutants/8/MultipleContracts/C.sol b/resources/regressions/test_multiple_contracts_3.json/mutants/8/MultipleContracts/C.sol new file mode 100644 index 0000000..b32909e --- /dev/null +++ b/resources/regressions/test_multiple_contracts_3.json/mutants/8/MultipleContracts/C.sol @@ -0,0 +1,41 @@ +// SPDX-License-Identifier: GPL-3.0-only + +pragma solidity ^0.8.13; + +library Utils { + function getarray(address[] memory c, address e) internal pure { + assert(c[0] == e); + } + + /// ArithmeticOperatorReplacement(`+` |==> `%`) of: `return a + b;` + function add(int8 a, int8 b) public pure returns (int8) { + return a % b; + } +} + +contract C { + function foo() external view returns (address[] memory) { + address[] memory a = new address[](1); + a[0] = msg.sender; + return a; + } + + function get10PowerDecimals(uint8 decimals) public pure returns (uint256) { + uint256 a = 10; + uint256 res = a ** decimals; + return res; + } + + function getarray(address[] memory c, address e) public pure { + assert(c[0] == e); + } + + function callmyself() external view { + address[] memory b = this.foo(); + Utils.getarray(b, address(this)); + } + + function add(int8 c, int8 d) public pure returns (int8) { + return c + d; + } +} diff --git a/resources/regressions/test_multiple_contracts_3.json/mutants/9/MultipleContracts/C.sol b/resources/regressions/test_multiple_contracts_3.json/mutants/9/MultipleContracts/C.sol new file mode 100644 index 0000000..f9a5de2 --- /dev/null +++ b/resources/regressions/test_multiple_contracts_3.json/mutants/9/MultipleContracts/C.sol @@ -0,0 +1,41 @@ +// SPDX-License-Identifier: GPL-3.0-only + +pragma solidity ^0.8.13; + +library Utils { + function getarray(address[] memory c, address e) internal pure { + assert(c[0] == e); + } + + function add(int8 a, int8 b) public pure returns (int8) { + return a + b; + } +} + +contract C { + /// LiteralValueReplacement(`1` |==> `0`) of: `address[] memory a = new address[](1);` + function foo() external view returns (address[] memory) { + address[] memory a = new address[](0); + a[0] = msg.sender; + return a; + } + + function get10PowerDecimals(uint8 decimals) public pure returns (uint256) { + uint256 a = 10; + uint256 res = a ** decimals; + return res; + } + + function getarray(address[] memory c, address e) public pure { + assert(c[0] == e); + } + + function callmyself() external view { + address[] memory b = this.foo(); + Utils.getarray(b, address(this)); + } + + function add(int8 c, int8 d) public pure returns (int8) { + return c + d; + } +} diff --git a/resources/regressions/test_multiple_contracts_4.json/gambit_results.json b/resources/regressions/test_multiple_contracts_4.json/gambit_results.json new file mode 100644 index 0000000..364ba55 --- /dev/null +++ b/resources/regressions/test_multiple_contracts_4.json/gambit_results.json @@ -0,0 +1,98 @@ +[ + { + "col": 18, + "description": "ArithmeticOperatorReplacement", + "diff": "--- original\n+++ mutant\n@@ -7,8 +7,9 @@\n assert(c[0] == e);\n }\n \n+ /// ArithmeticOperatorReplacement(`+` |==> `-`) of: `return a + b;`\n function add(int8 a, int8 b) public pure returns (int8) {\n- return a + b;\n+ return a - b;\n }\n }\n \n", + "id": "1", + "line": 11, + "name": "mutants/1/MultipleContracts/C.sol", + "op": "AOR", + "orig": "+", + "original": "MultipleContracts/C.sol", + "repl": "-" + }, + { + "col": 18, + "description": "ArithmeticOperatorReplacement", + "diff": "--- original\n+++ mutant\n@@ -7,8 +7,9 @@\n assert(c[0] == e);\n }\n \n+ /// ArithmeticOperatorReplacement(`+` |==> `*`) of: `return a + b;`\n function add(int8 a, int8 b) public pure returns (int8) {\n- return a + b;\n+ return a * b;\n }\n }\n \n", + "id": "2", + "line": 11, + "name": "mutants/2/MultipleContracts/C.sol", + "op": "AOR", + "orig": "+", + "original": "MultipleContracts/C.sol", + "repl": "*" + }, + { + "col": 18, + "description": "ArithmeticOperatorReplacement", + "diff": "--- original\n+++ mutant\n@@ -7,8 +7,9 @@\n assert(c[0] == e);\n }\n \n+ /// ArithmeticOperatorReplacement(`+` |==> `/`) of: `return a + b;`\n function add(int8 a, int8 b) public pure returns (int8) {\n- return a + b;\n+ return a / b;\n }\n }\n \n", + "id": "3", + "line": 11, + "name": "mutants/3/MultipleContracts/C.sol", + "op": "AOR", + "orig": "+", + "original": "MultipleContracts/C.sol", + "repl": "/" + }, + { + "col": 18, + "description": "ArithmeticOperatorReplacement", + "diff": "--- original\n+++ mutant\n@@ -7,8 +7,9 @@\n assert(c[0] == e);\n }\n \n+ /// ArithmeticOperatorReplacement(`+` |==> `%`) of: `return a + b;`\n function add(int8 a, int8 b) public pure returns (int8) {\n- return a + b;\n+ return a % b;\n }\n }\n \n", + "id": "4", + "line": 11, + "name": "mutants/4/MultipleContracts/C.sol", + "op": "AOR", + "orig": "+", + "original": "MultipleContracts/C.sol", + "repl": "%" + }, + { + "col": 18, + "description": "ArithmeticOperatorReplacement", + "diff": "--- original\n+++ mutant\n@@ -34,7 +34,8 @@\n Utils.getarray(b, address(this));\n }\n \n+ /// ArithmeticOperatorReplacement(`+` |==> `-`) of: `return c + d;`\n function add(int8 c, int8 d) public pure returns (int8) {\n- return c + d;\n+ return c - d;\n }\n }\n", + "id": "5", + "line": 38, + "name": "mutants/5/MultipleContracts/C.sol", + "op": "AOR", + "orig": "+", + "original": "MultipleContracts/C.sol", + "repl": "-" + }, + { + "col": 18, + "description": "ArithmeticOperatorReplacement", + "diff": "--- original\n+++ mutant\n@@ -34,7 +34,8 @@\n Utils.getarray(b, address(this));\n }\n \n+ /// ArithmeticOperatorReplacement(`+` |==> `*`) of: `return c + d;`\n function add(int8 c, int8 d) public pure returns (int8) {\n- return c + d;\n+ return c * d;\n }\n }\n", + "id": "6", + "line": 38, + "name": "mutants/6/MultipleContracts/C.sol", + "op": "AOR", + "orig": "+", + "original": "MultipleContracts/C.sol", + "repl": "*" + }, + { + "col": 18, + "description": "ArithmeticOperatorReplacement", + "diff": "--- original\n+++ mutant\n@@ -34,7 +34,8 @@\n Utils.getarray(b, address(this));\n }\n \n+ /// ArithmeticOperatorReplacement(`+` |==> `/`) of: `return c + d;`\n function add(int8 c, int8 d) public pure returns (int8) {\n- return c + d;\n+ return c / d;\n }\n }\n", + "id": "7", + "line": 38, + "name": "mutants/7/MultipleContracts/C.sol", + "op": "AOR", + "orig": "+", + "original": "MultipleContracts/C.sol", + "repl": "/" + }, + { + "col": 18, + "description": "ArithmeticOperatorReplacement", + "diff": "--- original\n+++ mutant\n@@ -34,7 +34,8 @@\n Utils.getarray(b, address(this));\n }\n \n+ /// ArithmeticOperatorReplacement(`+` |==> `%`) of: `return c + d;`\n function add(int8 c, int8 d) public pure returns (int8) {\n- return c + d;\n+ return c % d;\n }\n }\n", + "id": "8", + "line": 38, + "name": "mutants/8/MultipleContracts/C.sol", + "op": "AOR", + "orig": "+", + "original": "MultipleContracts/C.sol", + "repl": "%" + } +] \ No newline at end of file diff --git a/resources/regressions/test_multiple_contracts_4.json/mutants.log b/resources/regressions/test_multiple_contracts_4.json/mutants.log new file mode 100644 index 0000000..d2ac261 --- /dev/null +++ b/resources/regressions/test_multiple_contracts_4.json/mutants.log @@ -0,0 +1,8 @@ +1,AOR,MultipleContracts/C.sol,11:18,+,- +2,AOR,MultipleContracts/C.sol,11:18,+,* +3,AOR,MultipleContracts/C.sol,11:18,+,/ +4,AOR,MultipleContracts/C.sol,11:18,+,% +5,AOR,MultipleContracts/C.sol,38:18,+,- +6,AOR,MultipleContracts/C.sol,38:18,+,* +7,AOR,MultipleContracts/C.sol,38:18,+,/ +8,AOR,MultipleContracts/C.sol,38:18,+,% diff --git a/resources/regressions/test_multiple_contracts_4.json/mutants/1/MultipleContracts/C.sol b/resources/regressions/test_multiple_contracts_4.json/mutants/1/MultipleContracts/C.sol new file mode 100644 index 0000000..9e5f617 --- /dev/null +++ b/resources/regressions/test_multiple_contracts_4.json/mutants/1/MultipleContracts/C.sol @@ -0,0 +1,41 @@ +// SPDX-License-Identifier: GPL-3.0-only + +pragma solidity ^0.8.13; + +library Utils { + function getarray(address[] memory c, address e) internal pure { + assert(c[0] == e); + } + + /// ArithmeticOperatorReplacement(`+` |==> `-`) of: `return a + b;` + function add(int8 a, int8 b) public pure returns (int8) { + return a - b; + } +} + +contract C { + function foo() external view returns (address[] memory) { + address[] memory a = new address[](1); + a[0] = msg.sender; + return a; + } + + function get10PowerDecimals(uint8 decimals) public pure returns (uint256) { + uint256 a = 10; + uint256 res = a ** decimals; + return res; + } + + function getarray(address[] memory c, address e) public pure { + assert(c[0] == e); + } + + function callmyself() external view { + address[] memory b = this.foo(); + Utils.getarray(b, address(this)); + } + + function add(int8 c, int8 d) public pure returns (int8) { + return c + d; + } +} diff --git a/resources/regressions/test_multiple_contracts_4.json/mutants/2/MultipleContracts/C.sol b/resources/regressions/test_multiple_contracts_4.json/mutants/2/MultipleContracts/C.sol new file mode 100644 index 0000000..8612532 --- /dev/null +++ b/resources/regressions/test_multiple_contracts_4.json/mutants/2/MultipleContracts/C.sol @@ -0,0 +1,41 @@ +// SPDX-License-Identifier: GPL-3.0-only + +pragma solidity ^0.8.13; + +library Utils { + function getarray(address[] memory c, address e) internal pure { + assert(c[0] == e); + } + + /// ArithmeticOperatorReplacement(`+` |==> `*`) of: `return a + b;` + function add(int8 a, int8 b) public pure returns (int8) { + return a * b; + } +} + +contract C { + function foo() external view returns (address[] memory) { + address[] memory a = new address[](1); + a[0] = msg.sender; + return a; + } + + function get10PowerDecimals(uint8 decimals) public pure returns (uint256) { + uint256 a = 10; + uint256 res = a ** decimals; + return res; + } + + function getarray(address[] memory c, address e) public pure { + assert(c[0] == e); + } + + function callmyself() external view { + address[] memory b = this.foo(); + Utils.getarray(b, address(this)); + } + + function add(int8 c, int8 d) public pure returns (int8) { + return c + d; + } +} diff --git a/resources/regressions/test_multiple_contracts_4.json/mutants/3/MultipleContracts/C.sol b/resources/regressions/test_multiple_contracts_4.json/mutants/3/MultipleContracts/C.sol new file mode 100644 index 0000000..e85ef12 --- /dev/null +++ b/resources/regressions/test_multiple_contracts_4.json/mutants/3/MultipleContracts/C.sol @@ -0,0 +1,41 @@ +// SPDX-License-Identifier: GPL-3.0-only + +pragma solidity ^0.8.13; + +library Utils { + function getarray(address[] memory c, address e) internal pure { + assert(c[0] == e); + } + + /// ArithmeticOperatorReplacement(`+` |==> `/`) of: `return a + b;` + function add(int8 a, int8 b) public pure returns (int8) { + return a / b; + } +} + +contract C { + function foo() external view returns (address[] memory) { + address[] memory a = new address[](1); + a[0] = msg.sender; + return a; + } + + function get10PowerDecimals(uint8 decimals) public pure returns (uint256) { + uint256 a = 10; + uint256 res = a ** decimals; + return res; + } + + function getarray(address[] memory c, address e) public pure { + assert(c[0] == e); + } + + function callmyself() external view { + address[] memory b = this.foo(); + Utils.getarray(b, address(this)); + } + + function add(int8 c, int8 d) public pure returns (int8) { + return c + d; + } +} diff --git a/resources/regressions/test_multiple_contracts_4.json/mutants/4/MultipleContracts/C.sol b/resources/regressions/test_multiple_contracts_4.json/mutants/4/MultipleContracts/C.sol new file mode 100644 index 0000000..b32909e --- /dev/null +++ b/resources/regressions/test_multiple_contracts_4.json/mutants/4/MultipleContracts/C.sol @@ -0,0 +1,41 @@ +// SPDX-License-Identifier: GPL-3.0-only + +pragma solidity ^0.8.13; + +library Utils { + function getarray(address[] memory c, address e) internal pure { + assert(c[0] == e); + } + + /// ArithmeticOperatorReplacement(`+` |==> `%`) of: `return a + b;` + function add(int8 a, int8 b) public pure returns (int8) { + return a % b; + } +} + +contract C { + function foo() external view returns (address[] memory) { + address[] memory a = new address[](1); + a[0] = msg.sender; + return a; + } + + function get10PowerDecimals(uint8 decimals) public pure returns (uint256) { + uint256 a = 10; + uint256 res = a ** decimals; + return res; + } + + function getarray(address[] memory c, address e) public pure { + assert(c[0] == e); + } + + function callmyself() external view { + address[] memory b = this.foo(); + Utils.getarray(b, address(this)); + } + + function add(int8 c, int8 d) public pure returns (int8) { + return c + d; + } +} diff --git a/resources/regressions/test_multiple_contracts_4.json/mutants/5/MultipleContracts/C.sol b/resources/regressions/test_multiple_contracts_4.json/mutants/5/MultipleContracts/C.sol new file mode 100644 index 0000000..7a0c07d --- /dev/null +++ b/resources/regressions/test_multiple_contracts_4.json/mutants/5/MultipleContracts/C.sol @@ -0,0 +1,41 @@ +// SPDX-License-Identifier: GPL-3.0-only + +pragma solidity ^0.8.13; + +library Utils { + function getarray(address[] memory c, address e) internal pure { + assert(c[0] == e); + } + + function add(int8 a, int8 b) public pure returns (int8) { + return a + b; + } +} + +contract C { + function foo() external view returns (address[] memory) { + address[] memory a = new address[](1); + a[0] = msg.sender; + return a; + } + + function get10PowerDecimals(uint8 decimals) public pure returns (uint256) { + uint256 a = 10; + uint256 res = a ** decimals; + return res; + } + + function getarray(address[] memory c, address e) public pure { + assert(c[0] == e); + } + + function callmyself() external view { + address[] memory b = this.foo(); + Utils.getarray(b, address(this)); + } + + /// ArithmeticOperatorReplacement(`+` |==> `-`) of: `return c + d;` + function add(int8 c, int8 d) public pure returns (int8) { + return c - d; + } +} diff --git a/resources/regressions/test_multiple_contracts_4.json/mutants/6/MultipleContracts/C.sol b/resources/regressions/test_multiple_contracts_4.json/mutants/6/MultipleContracts/C.sol new file mode 100644 index 0000000..d73584b --- /dev/null +++ b/resources/regressions/test_multiple_contracts_4.json/mutants/6/MultipleContracts/C.sol @@ -0,0 +1,41 @@ +// SPDX-License-Identifier: GPL-3.0-only + +pragma solidity ^0.8.13; + +library Utils { + function getarray(address[] memory c, address e) internal pure { + assert(c[0] == e); + } + + function add(int8 a, int8 b) public pure returns (int8) { + return a + b; + } +} + +contract C { + function foo() external view returns (address[] memory) { + address[] memory a = new address[](1); + a[0] = msg.sender; + return a; + } + + function get10PowerDecimals(uint8 decimals) public pure returns (uint256) { + uint256 a = 10; + uint256 res = a ** decimals; + return res; + } + + function getarray(address[] memory c, address e) public pure { + assert(c[0] == e); + } + + function callmyself() external view { + address[] memory b = this.foo(); + Utils.getarray(b, address(this)); + } + + /// ArithmeticOperatorReplacement(`+` |==> `*`) of: `return c + d;` + function add(int8 c, int8 d) public pure returns (int8) { + return c * d; + } +} diff --git a/resources/regressions/test_multiple_contracts_4.json/mutants/7/MultipleContracts/C.sol b/resources/regressions/test_multiple_contracts_4.json/mutants/7/MultipleContracts/C.sol new file mode 100644 index 0000000..c226dcf --- /dev/null +++ b/resources/regressions/test_multiple_contracts_4.json/mutants/7/MultipleContracts/C.sol @@ -0,0 +1,41 @@ +// SPDX-License-Identifier: GPL-3.0-only + +pragma solidity ^0.8.13; + +library Utils { + function getarray(address[] memory c, address e) internal pure { + assert(c[0] == e); + } + + function add(int8 a, int8 b) public pure returns (int8) { + return a + b; + } +} + +contract C { + function foo() external view returns (address[] memory) { + address[] memory a = new address[](1); + a[0] = msg.sender; + return a; + } + + function get10PowerDecimals(uint8 decimals) public pure returns (uint256) { + uint256 a = 10; + uint256 res = a ** decimals; + return res; + } + + function getarray(address[] memory c, address e) public pure { + assert(c[0] == e); + } + + function callmyself() external view { + address[] memory b = this.foo(); + Utils.getarray(b, address(this)); + } + + /// ArithmeticOperatorReplacement(`+` |==> `/`) of: `return c + d;` + function add(int8 c, int8 d) public pure returns (int8) { + return c / d; + } +} diff --git a/resources/regressions/test_multiple_contracts_4.json/mutants/8/MultipleContracts/C.sol b/resources/regressions/test_multiple_contracts_4.json/mutants/8/MultipleContracts/C.sol new file mode 100644 index 0000000..c6022ee --- /dev/null +++ b/resources/regressions/test_multiple_contracts_4.json/mutants/8/MultipleContracts/C.sol @@ -0,0 +1,41 @@ +// SPDX-License-Identifier: GPL-3.0-only + +pragma solidity ^0.8.13; + +library Utils { + function getarray(address[] memory c, address e) internal pure { + assert(c[0] == e); + } + + function add(int8 a, int8 b) public pure returns (int8) { + return a + b; + } +} + +contract C { + function foo() external view returns (address[] memory) { + address[] memory a = new address[](1); + a[0] = msg.sender; + return a; + } + + function get10PowerDecimals(uint8 decimals) public pure returns (uint256) { + uint256 a = 10; + uint256 res = a ** decimals; + return res; + } + + function getarray(address[] memory c, address e) public pure { + assert(c[0] == e); + } + + function callmyself() external view { + address[] memory b = this.foo(); + Utils.getarray(b, address(this)); + } + + /// ArithmeticOperatorReplacement(`+` |==> `%`) of: `return c + d;` + function add(int8 c, int8 d) public pure returns (int8) { + return c % d; + } +} diff --git a/resources/regressions/test_multiple_files_1.json/gambit_results.json b/resources/regressions/test_multiple_files_1.json/gambit_results.json new file mode 100644 index 0000000..78c5d1b --- /dev/null +++ b/resources/regressions/test_multiple_files_1.json/gambit_results.json @@ -0,0 +1,362 @@ +[ + { + "col": 9, + "description": "StatementDeletion", + "diff": "--- original\n+++ mutant\n@@ -9,8 +9,9 @@\n // a * b\n // a / b\n // a % b\n+ /// StatementDeletion(`return a + b` |==> `assert(true)`) of: `return a + b;`\n function plus(int256 a, int256 b) public pure returns (int256) {\n- return a + b;\n+ assert(true);\n }\n \n // Expect 4 mutants:\n", + "id": "1", + "line": 13, + "name": "mutants/1/Ops/AOR/AOR.sol", + "op": "STD", + "orig": "return a + b", + "original": "Ops/AOR/AOR.sol", + "repl": "assert(true)" + }, + { + "col": 18, + "description": "ArithmeticOperatorReplacement", + "diff": "--- original\n+++ mutant\n@@ -9,8 +9,9 @@\n // a * b\n // a / b\n // a % b\n+ /// ArithmeticOperatorReplacement(`+` |==> `-`) of: `return a + b;`\n function plus(int256 a, int256 b) public pure returns (int256) {\n- return a + b;\n+ return a - b;\n }\n \n // Expect 4 mutants:\n", + "id": "2", + "line": 13, + "name": "mutants/2/Ops/AOR/AOR.sol", + "op": "AOR", + "orig": "+", + "original": "Ops/AOR/AOR.sol", + "repl": "-" + }, + { + "col": 18, + "description": "ArithmeticOperatorReplacement", + "diff": "--- original\n+++ mutant\n@@ -9,8 +9,9 @@\n // a * b\n // a / b\n // a % b\n+ /// ArithmeticOperatorReplacement(`+` |==> `*`) of: `return a + b;`\n function plus(int256 a, int256 b) public pure returns (int256) {\n- return a + b;\n+ return a * b;\n }\n \n // Expect 4 mutants:\n", + "id": "3", + "line": 13, + "name": "mutants/3/Ops/AOR/AOR.sol", + "op": "AOR", + "orig": "+", + "original": "Ops/AOR/AOR.sol", + "repl": "*" + }, + { + "col": 18, + "description": "ArithmeticOperatorReplacement", + "diff": "--- original\n+++ mutant\n@@ -9,8 +9,9 @@\n // a * b\n // a / b\n // a % b\n+ /// ArithmeticOperatorReplacement(`+` |==> `/`) of: `return a + b;`\n function plus(int256 a, int256 b) public pure returns (int256) {\n- return a + b;\n+ return a / b;\n }\n \n // Expect 4 mutants:\n", + "id": "4", + "line": 13, + "name": "mutants/4/Ops/AOR/AOR.sol", + "op": "AOR", + "orig": "+", + "original": "Ops/AOR/AOR.sol", + "repl": "/" + }, + { + "col": 18, + "description": "ArithmeticOperatorReplacement", + "diff": "--- original\n+++ mutant\n@@ -9,8 +9,9 @@\n // a * b\n // a / b\n // a % b\n+ /// ArithmeticOperatorReplacement(`+` |==> `%`) of: `return a + b;`\n function plus(int256 a, int256 b) public pure returns (int256) {\n- return a + b;\n+ return a % b;\n }\n \n // Expect 4 mutants:\n", + "id": "5", + "line": 13, + "name": "mutants/5/Ops/AOR/AOR.sol", + "op": "AOR", + "orig": "+", + "original": "Ops/AOR/AOR.sol", + "repl": "%" + }, + { + "col": 9, + "description": "StatementDeletion", + "diff": "--- original\n+++ mutant\n@@ -18,8 +18,9 @@\n // a * b\n // a / b\n // a % b\n+ /// StatementDeletion(`return a - b` |==> `assert(true)`) of: `return a - b;`\n function minus(int256 a, int256 b) public pure returns (int256) {\n- return a - b;\n+ assert(true);\n }\n \n // Expect 4 mutants:\n", + "id": "6", + "line": 22, + "name": "mutants/6/Ops/AOR/AOR.sol", + "op": "STD", + "orig": "return a - b", + "original": "Ops/AOR/AOR.sol", + "repl": "assert(true)" + }, + { + "col": 18, + "description": "ArithmeticOperatorReplacement", + "diff": "--- original\n+++ mutant\n@@ -18,8 +18,9 @@\n // a * b\n // a / b\n // a % b\n+ /// ArithmeticOperatorReplacement(`-` |==> `+`) of: `return a - b;`\n function minus(int256 a, int256 b) public pure returns (int256) {\n- return a - b;\n+ return a + b;\n }\n \n // Expect 4 mutants:\n", + "id": "7", + "line": 22, + "name": "mutants/7/Ops/AOR/AOR.sol", + "op": "AOR", + "orig": "-", + "original": "Ops/AOR/AOR.sol", + "repl": "+" + }, + { + "col": 18, + "description": "ArithmeticOperatorReplacement", + "diff": "--- original\n+++ mutant\n@@ -18,8 +18,9 @@\n // a * b\n // a / b\n // a % b\n+ /// ArithmeticOperatorReplacement(`-` |==> `*`) of: `return a - b;`\n function minus(int256 a, int256 b) public pure returns (int256) {\n- return a - b;\n+ return a * b;\n }\n \n // Expect 4 mutants:\n", + "id": "8", + "line": 22, + "name": "mutants/8/Ops/AOR/AOR.sol", + "op": "AOR", + "orig": "-", + "original": "Ops/AOR/AOR.sol", + "repl": "*" + }, + { + "col": 18, + "description": "ArithmeticOperatorReplacement", + "diff": "--- original\n+++ mutant\n@@ -18,8 +18,9 @@\n // a * b\n // a / b\n // a % b\n+ /// ArithmeticOperatorReplacement(`-` |==> `/`) of: `return a - b;`\n function minus(int256 a, int256 b) public pure returns (int256) {\n- return a - b;\n+ return a / b;\n }\n \n // Expect 4 mutants:\n", + "id": "9", + "line": 22, + "name": "mutants/9/Ops/AOR/AOR.sol", + "op": "AOR", + "orig": "-", + "original": "Ops/AOR/AOR.sol", + "repl": "/" + }, + { + "col": 18, + "description": "ArithmeticOperatorReplacement", + "diff": "--- original\n+++ mutant\n@@ -18,8 +18,9 @@\n // a * b\n // a / b\n // a % b\n+ /// ArithmeticOperatorReplacement(`-` |==> `%`) of: `return a - b;`\n function minus(int256 a, int256 b) public pure returns (int256) {\n- return a - b;\n+ return a % b;\n }\n \n // Expect 4 mutants:\n", + "id": "10", + "line": 22, + "name": "mutants/10/Ops/AOR/AOR.sol", + "op": "AOR", + "orig": "-", + "original": "Ops/AOR/AOR.sol", + "repl": "%" + }, + { + "col": 9, + "description": "StatementDeletion", + "diff": "--- original\n+++ mutant\n@@ -30,8 +30,9 @@\n function times_with_parens(\n int256 a,\n int256 b\n+ /// StatementDeletion(`return ((a)) * b` |==> `assert(true)`) of: `return ((a)) * b;`\n ) public pure returns (int256) {\n- return ((a)) * b;\n+ assert(true);\n }\n \n // Expect 5 mutants:\n", + "id": "11", + "line": 34, + "name": "mutants/11/Ops/AOR/AOR.sol", + "op": "STD", + "orig": "return ((a)) * b", + "original": "Ops/AOR/AOR.sol", + "repl": "assert(true)" + }, + { + "col": 22, + "description": "ArithmeticOperatorReplacement", + "diff": "--- original\n+++ mutant\n@@ -30,8 +30,9 @@\n function times_with_parens(\n int256 a,\n int256 b\n+ /// ArithmeticOperatorReplacement(`*` |==> `+`) of: `return ((a)) * b;`\n ) public pure returns (int256) {\n- return ((a)) * b;\n+ return ((a)) + b;\n }\n \n // Expect 5 mutants:\n", + "id": "12", + "line": 34, + "name": "mutants/12/Ops/AOR/AOR.sol", + "op": "AOR", + "orig": "*", + "original": "Ops/AOR/AOR.sol", + "repl": "+" + }, + { + "col": 22, + "description": "ArithmeticOperatorReplacement", + "diff": "--- original\n+++ mutant\n@@ -30,8 +30,9 @@\n function times_with_parens(\n int256 a,\n int256 b\n+ /// ArithmeticOperatorReplacement(`*` |==> `-`) of: `return ((a)) * b;`\n ) public pure returns (int256) {\n- return ((a)) * b;\n+ return ((a)) - b;\n }\n \n // Expect 5 mutants:\n", + "id": "13", + "line": 34, + "name": "mutants/13/Ops/AOR/AOR.sol", + "op": "AOR", + "orig": "*", + "original": "Ops/AOR/AOR.sol", + "repl": "-" + }, + { + "col": 22, + "description": "ArithmeticOperatorReplacement", + "diff": "--- original\n+++ mutant\n@@ -30,8 +30,9 @@\n function times_with_parens(\n int256 a,\n int256 b\n+ /// ArithmeticOperatorReplacement(`*` |==> `/`) of: `return ((a)) * b;`\n ) public pure returns (int256) {\n- return ((a)) * b;\n+ return ((a)) / b;\n }\n \n // Expect 5 mutants:\n", + "id": "14", + "line": 34, + "name": "mutants/14/Ops/AOR/AOR.sol", + "op": "AOR", + "orig": "*", + "original": "Ops/AOR/AOR.sol", + "repl": "/" + }, + { + "col": 22, + "description": "ArithmeticOperatorReplacement", + "diff": "--- original\n+++ mutant\n@@ -30,8 +30,9 @@\n function times_with_parens(\n int256 a,\n int256 b\n+ /// ArithmeticOperatorReplacement(`*` |==> `%`) of: `return ((a)) * b;`\n ) public pure returns (int256) {\n- return ((a)) * b;\n+ return ((a)) % b;\n }\n \n // Expect 5 mutants:\n", + "id": "15", + "line": 34, + "name": "mutants/15/Ops/AOR/AOR.sol", + "op": "AOR", + "orig": "*", + "original": "Ops/AOR/AOR.sol", + "repl": "%" + }, + { + "col": 9, + "description": "StatementDeletion", + "diff": "--- original\n+++ mutant\n@@ -43,8 +43,9 @@\n function unsigned_times_with_parens(\n uint256 a,\n uint256 b\n+ /// StatementDeletion(`return ((a)) * b` |==> `assert(true)`) of: `return ((a)) * b;`\n ) public pure returns (uint256) {\n- return ((a)) * b;\n+ assert(true);\n }\n \n // Expect 5 mutants:\n", + "id": "16", + "line": 47, + "name": "mutants/16/Ops/AOR/AOR.sol", + "op": "STD", + "orig": "return ((a)) * b", + "original": "Ops/AOR/AOR.sol", + "repl": "assert(true)" + }, + { + "col": 22, + "description": "ArithmeticOperatorReplacement", + "diff": "--- original\n+++ mutant\n@@ -43,8 +43,9 @@\n function unsigned_times_with_parens(\n uint256 a,\n uint256 b\n+ /// ArithmeticOperatorReplacement(`*` |==> `+`) of: `return ((a)) * b;`\n ) public pure returns (uint256) {\n- return ((a)) * b;\n+ return ((a)) + b;\n }\n \n // Expect 5 mutants:\n", + "id": "17", + "line": 47, + "name": "mutants/17/Ops/AOR/AOR.sol", + "op": "AOR", + "orig": "*", + "original": "Ops/AOR/AOR.sol", + "repl": "+" + }, + { + "col": 22, + "description": "ArithmeticOperatorReplacement", + "diff": "--- original\n+++ mutant\n@@ -43,8 +43,9 @@\n function unsigned_times_with_parens(\n uint256 a,\n uint256 b\n+ /// ArithmeticOperatorReplacement(`*` |==> `-`) of: `return ((a)) * b;`\n ) public pure returns (uint256) {\n- return ((a)) * b;\n+ return ((a)) - b;\n }\n \n // Expect 5 mutants:\n", + "id": "18", + "line": 47, + "name": "mutants/18/Ops/AOR/AOR.sol", + "op": "AOR", + "orig": "*", + "original": "Ops/AOR/AOR.sol", + "repl": "-" + }, + { + "col": 22, + "description": "ArithmeticOperatorReplacement", + "diff": "--- original\n+++ mutant\n@@ -43,8 +43,9 @@\n function unsigned_times_with_parens(\n uint256 a,\n uint256 b\n+ /// ArithmeticOperatorReplacement(`*` |==> `/`) of: `return ((a)) * b;`\n ) public pure returns (uint256) {\n- return ((a)) * b;\n+ return ((a)) / b;\n }\n \n // Expect 5 mutants:\n", + "id": "19", + "line": 47, + "name": "mutants/19/Ops/AOR/AOR.sol", + "op": "AOR", + "orig": "*", + "original": "Ops/AOR/AOR.sol", + "repl": "/" + }, + { + "col": 22, + "description": "ArithmeticOperatorReplacement", + "diff": "--- original\n+++ mutant\n@@ -43,8 +43,9 @@\n function unsigned_times_with_parens(\n uint256 a,\n uint256 b\n+ /// ArithmeticOperatorReplacement(`*` |==> `**`) of: `return ((a)) * b;`\n ) public pure returns (uint256) {\n- return ((a)) * b;\n+ return ((a)) ** b;\n }\n \n // Expect 5 mutants:\n", + "id": "20", + "line": 47, + "name": "mutants/20/Ops/AOR/AOR.sol", + "op": "AOR", + "orig": "*", + "original": "Ops/AOR/AOR.sol", + "repl": "**" + }, + { + "col": 22, + "description": "ArithmeticOperatorReplacement", + "diff": "--- original\n+++ mutant\n@@ -43,8 +43,9 @@\n function unsigned_times_with_parens(\n uint256 a,\n uint256 b\n+ /// ArithmeticOperatorReplacement(`*` |==> `%`) of: `return ((a)) * b;`\n ) public pure returns (uint256) {\n- return ((a)) * b;\n+ return ((a)) % b;\n }\n \n // Expect 5 mutants:\n", + "id": "21", + "line": 47, + "name": "mutants/21/Ops/AOR/AOR.sol", + "op": "AOR", + "orig": "*", + "original": "Ops/AOR/AOR.sol", + "repl": "%" + }, + { + "col": 9, + "description": "StatementDeletion", + "diff": "--- original\n+++ mutant\n@@ -54,7 +54,8 @@\n // a * b\n // a % b\n \n+ /// StatementDeletion(`return a ** b` |==> `assert(true)`) of: `return a ** b;`\n function power(uint256 a, uint256 b) public pure returns (uint256) {\n- return a ** b;\n+ assert(true);\n }\n }\n", + "id": "22", + "line": 58, + "name": "mutants/22/Ops/AOR/AOR.sol", + "op": "STD", + "orig": "return a ** b", + "original": "Ops/AOR/AOR.sol", + "repl": "assert(true)" + }, + { + "col": 18, + "description": "ArithmeticOperatorReplacement", + "diff": "--- original\n+++ mutant\n@@ -54,7 +54,8 @@\n // a * b\n // a % b\n \n+ /// ArithmeticOperatorReplacement(`**` |==> `+`) of: `return a ** b;`\n function power(uint256 a, uint256 b) public pure returns (uint256) {\n- return a ** b;\n+ return a + b;\n }\n }\n", + "id": "23", + "line": 58, + "name": "mutants/23/Ops/AOR/AOR.sol", + "op": "AOR", + "orig": "**", + "original": "Ops/AOR/AOR.sol", + "repl": "+" + }, + { + "col": 18, + "description": "ArithmeticOperatorReplacement", + "diff": "--- original\n+++ mutant\n@@ -54,7 +54,8 @@\n // a * b\n // a % b\n \n+ /// ArithmeticOperatorReplacement(`**` |==> `-`) of: `return a ** b;`\n function power(uint256 a, uint256 b) public pure returns (uint256) {\n- return a ** b;\n+ return a - b;\n }\n }\n", + "id": "24", + "line": 58, + "name": "mutants/24/Ops/AOR/AOR.sol", + "op": "AOR", + "orig": "**", + "original": "Ops/AOR/AOR.sol", + "repl": "-" + }, + { + "col": 18, + "description": "ArithmeticOperatorReplacement", + "diff": "--- original\n+++ mutant\n@@ -54,7 +54,8 @@\n // a * b\n // a % b\n \n+ /// ArithmeticOperatorReplacement(`**` |==> `*`) of: `return a ** b;`\n function power(uint256 a, uint256 b) public pure returns (uint256) {\n- return a ** b;\n+ return a * b;\n }\n }\n", + "id": "25", + "line": 58, + "name": "mutants/25/Ops/AOR/AOR.sol", + "op": "AOR", + "orig": "**", + "original": "Ops/AOR/AOR.sol", + "repl": "*" + }, + { + "col": 18, + "description": "ArithmeticOperatorReplacement", + "diff": "--- original\n+++ mutant\n@@ -54,7 +54,8 @@\n // a * b\n // a % b\n \n+ /// ArithmeticOperatorReplacement(`**` |==> `/`) of: `return a ** b;`\n function power(uint256 a, uint256 b) public pure returns (uint256) {\n- return a ** b;\n+ return a / b;\n }\n }\n", + "id": "26", + "line": 58, + "name": "mutants/26/Ops/AOR/AOR.sol", + "op": "AOR", + "orig": "**", + "original": "Ops/AOR/AOR.sol", + "repl": "/" + }, + { + "col": 18, + "description": "ArithmeticOperatorReplacement", + "diff": "--- original\n+++ mutant\n@@ -54,7 +54,8 @@\n // a * b\n // a % b\n \n+ /// ArithmeticOperatorReplacement(`**` |==> `%`) of: `return a ** b;`\n function power(uint256 a, uint256 b) public pure returns (uint256) {\n- return a ** b;\n+ return a % b;\n }\n }\n", + "id": "27", + "line": 58, + "name": "mutants/27/Ops/AOR/AOR.sol", + "op": "AOR", + "orig": "**", + "original": "Ops/AOR/AOR.sol", + "repl": "%" + }, + { + "col": 9, + "description": "StatementDeletion", + "diff": "--- original\n+++ mutant\n@@ -25,8 +25,9 @@\n return res;\n }\n \n+ /// StatementDeletion(`assert(c[0] == e)` |==> `assert(true)`) of: `assert(c[0] == e);`\n function getarray(address[] memory c, address e) public pure {\n- assert(c[0] == e);\n+ assert(true);\n }\n \n function callmyself() external view {\n", + "id": "28", + "line": 29, + "name": "mutants/28/MultipleContracts/C.sol", + "op": "STD", + "orig": "assert(c[0] == e)", + "original": "MultipleContracts/C.sol", + "repl": "assert(true)" + }, + { + "col": 16, + "description": "RelationalOperatorReplacement", + "diff": "--- original\n+++ mutant\n@@ -25,8 +25,9 @@\n return res;\n }\n \n+ /// RelationalOperatorReplacement(`c[0] == e` |==> `false`) of: `assert(c[0] == e);`\n function getarray(address[] memory c, address e) public pure {\n- assert(c[0] == e);\n+ assert(false);\n }\n \n function callmyself() external view {\n", + "id": "29", + "line": 29, + "name": "mutants/29/MultipleContracts/C.sol", + "op": "ROR", + "orig": "c[0] == e", + "original": "MultipleContracts/C.sol", + "repl": "false" + }, + { + "col": 18, + "description": "LiteralValueReplacement", + "diff": "--- original\n+++ mutant\n@@ -25,8 +25,9 @@\n return res;\n }\n \n+ /// LiteralValueReplacement(`0` |==> `1`) of: `assert(c[0] == e);`\n function getarray(address[] memory c, address e) public pure {\n- assert(c[0] == e);\n+ assert(c[1] == e);\n }\n \n function callmyself() external view {\n", + "id": "30", + "line": 29, + "name": "mutants/30/MultipleContracts/C.sol", + "op": "LVR", + "orig": "0", + "original": "MultipleContracts/C.sol", + "repl": "1" + } +] \ No newline at end of file diff --git a/resources/regressions/test_multiple_files_1.json/mutants.log b/resources/regressions/test_multiple_files_1.json/mutants.log new file mode 100644 index 0000000..3ee4d5c --- /dev/null +++ b/resources/regressions/test_multiple_files_1.json/mutants.log @@ -0,0 +1,30 @@ +1,STD,Ops/AOR/AOR.sol,13:9,return a + b,assert(true) +2,AOR,Ops/AOR/AOR.sol,13:18,+,- +3,AOR,Ops/AOR/AOR.sol,13:18,+,* +4,AOR,Ops/AOR/AOR.sol,13:18,+,/ +5,AOR,Ops/AOR/AOR.sol,13:18,+,% +6,STD,Ops/AOR/AOR.sol,22:9,return a - b,assert(true) +7,AOR,Ops/AOR/AOR.sol,22:18,-,+ +8,AOR,Ops/AOR/AOR.sol,22:18,-,* +9,AOR,Ops/AOR/AOR.sol,22:18,-,/ +10,AOR,Ops/AOR/AOR.sol,22:18,-,% +11,STD,Ops/AOR/AOR.sol,34:9,return ((a)) * b,assert(true) +12,AOR,Ops/AOR/AOR.sol,34:22,*,+ +13,AOR,Ops/AOR/AOR.sol,34:22,*,- +14,AOR,Ops/AOR/AOR.sol,34:22,*,/ +15,AOR,Ops/AOR/AOR.sol,34:22,*,% +16,STD,Ops/AOR/AOR.sol,47:9,return ((a)) * b,assert(true) +17,AOR,Ops/AOR/AOR.sol,47:22,*,+ +18,AOR,Ops/AOR/AOR.sol,47:22,*,- +19,AOR,Ops/AOR/AOR.sol,47:22,*,/ +20,AOR,Ops/AOR/AOR.sol,47:22,*,** +21,AOR,Ops/AOR/AOR.sol,47:22,*,% +22,STD,Ops/AOR/AOR.sol,58:9,return a ** b,assert(true) +23,AOR,Ops/AOR/AOR.sol,58:18,**,+ +24,AOR,Ops/AOR/AOR.sol,58:18,**,- +25,AOR,Ops/AOR/AOR.sol,58:18,**,* +26,AOR,Ops/AOR/AOR.sol,58:18,**,/ +27,AOR,Ops/AOR/AOR.sol,58:18,**,% +28,STD,MultipleContracts/C.sol,29:9,assert(c[0] == e),assert(true) +29,ROR,MultipleContracts/C.sol,29:16,c[0] == e,false +30,LVR,MultipleContracts/C.sol,29:18,0,1 diff --git a/resources/regressions/test_multiple_files_1.json/mutants/1/Ops/AOR/AOR.sol b/resources/regressions/test_multiple_files_1.json/mutants/1/Ops/AOR/AOR.sol new file mode 100644 index 0000000..ff121e6 --- /dev/null +++ b/resources/regressions/test_multiple_files_1.json/mutants/1/Ops/AOR/AOR.sol @@ -0,0 +1,61 @@ +// SPDX-License-Identifier: GPL-3.0-only +pragma solidity >0.7.0; +pragma experimental ABIEncoderV2; + +// This contract provides test functions for Arithmetic operator replacement +contract AOR { + // Expect 4 mutants: + // a - b + // a * b + // a / b + // a % b + /// StatementDeletion(`return a + b` |==> `assert(true)`) of: `return a + b;` + function plus(int256 a, int256 b) public pure returns (int256) { + assert(true); + } + + // Expect 4 mutants: + // a + b + // a * b + // a / b + // a % b + function minus(int256 a, int256 b) public pure returns (int256) { + return a - b; + } + + // Expect 4 mutants: + // a - b + // a * b + // a / b + // a % b + function times_with_parens( + int256 a, + int256 b + ) public pure returns (int256) { + return ((a)) * b; + } + + // Expect 5 mutants: + // a + b + // a - b + // a / b + // a ** b + // a % b + function unsigned_times_with_parens( + uint256 a, + uint256 b + ) public pure returns (uint256) { + return ((a)) * b; + } + + // Expect 5 mutants: + // a + b + // a - b + // a / b + // a * b + // a % b + + function power(uint256 a, uint256 b) public pure returns (uint256) { + return a ** b; + } +} diff --git a/resources/regressions/test_multiple_files_1.json/mutants/10/Ops/AOR/AOR.sol b/resources/regressions/test_multiple_files_1.json/mutants/10/Ops/AOR/AOR.sol new file mode 100644 index 0000000..bd874f1 --- /dev/null +++ b/resources/regressions/test_multiple_files_1.json/mutants/10/Ops/AOR/AOR.sol @@ -0,0 +1,61 @@ +// SPDX-License-Identifier: GPL-3.0-only +pragma solidity >0.7.0; +pragma experimental ABIEncoderV2; + +// This contract provides test functions for Arithmetic operator replacement +contract AOR { + // Expect 4 mutants: + // a - b + // a * b + // a / b + // a % b + function plus(int256 a, int256 b) public pure returns (int256) { + return a + b; + } + + // Expect 4 mutants: + // a + b + // a * b + // a / b + // a % b + /// ArithmeticOperatorReplacement(`-` |==> `%`) of: `return a - b;` + function minus(int256 a, int256 b) public pure returns (int256) { + return a % b; + } + + // Expect 4 mutants: + // a - b + // a * b + // a / b + // a % b + function times_with_parens( + int256 a, + int256 b + ) public pure returns (int256) { + return ((a)) * b; + } + + // Expect 5 mutants: + // a + b + // a - b + // a / b + // a ** b + // a % b + function unsigned_times_with_parens( + uint256 a, + uint256 b + ) public pure returns (uint256) { + return ((a)) * b; + } + + // Expect 5 mutants: + // a + b + // a - b + // a / b + // a * b + // a % b + + function power(uint256 a, uint256 b) public pure returns (uint256) { + return a ** b; + } +} diff --git a/resources/regressions/test_multiple_files_1.json/mutants/11/Ops/AOR/AOR.sol b/resources/regressions/test_multiple_files_1.json/mutants/11/Ops/AOR/AOR.sol new file mode 100644 index 0000000..d04b274 --- /dev/null +++ b/resources/regressions/test_multiple_files_1.json/mutants/11/Ops/AOR/AOR.sol @@ -0,0 +1,61 @@ +// SPDX-License-Identifier: GPL-3.0-only +pragma solidity >0.7.0; +pragma experimental ABIEncoderV2; + +// This contract provides test functions for Arithmetic operator replacement +contract AOR { + // Expect 4 mutants: + // a - b + // a * b + // a / b + // a % b + function plus(int256 a, int256 b) public pure returns (int256) { + return a + b; + } + + // Expect 4 mutants: + // a + b + // a * b + // a / b + // a % b + function minus(int256 a, int256 b) public pure returns (int256) { + return a - b; + } + + // Expect 4 mutants: + // a - b + // a * b + // a / b + // a % b + function times_with_parens( + int256 a, + int256 b + /// StatementDeletion(`return ((a)) * b` |==> `assert(true)`) of: `return ((a)) * b;` + ) public pure returns (int256) { + assert(true); + } + + // Expect 5 mutants: + // a + b + // a - b + // a / b + // a ** b + // a % b + function unsigned_times_with_parens( + uint256 a, + uint256 b + ) public pure returns (uint256) { + return ((a)) * b; + } + + // Expect 5 mutants: + // a + b + // a - b + // a / b + // a * b + // a % b + + function power(uint256 a, uint256 b) public pure returns (uint256) { + return a ** b; + } +} diff --git a/resources/regressions/test_multiple_files_1.json/mutants/12/Ops/AOR/AOR.sol b/resources/regressions/test_multiple_files_1.json/mutants/12/Ops/AOR/AOR.sol new file mode 100644 index 0000000..5d9ca89 --- /dev/null +++ b/resources/regressions/test_multiple_files_1.json/mutants/12/Ops/AOR/AOR.sol @@ -0,0 +1,61 @@ +// SPDX-License-Identifier: GPL-3.0-only +pragma solidity >0.7.0; +pragma experimental ABIEncoderV2; + +// This contract provides test functions for Arithmetic operator replacement +contract AOR { + // Expect 4 mutants: + // a - b + // a * b + // a / b + // a % b + function plus(int256 a, int256 b) public pure returns (int256) { + return a + b; + } + + // Expect 4 mutants: + // a + b + // a * b + // a / b + // a % b + function minus(int256 a, int256 b) public pure returns (int256) { + return a - b; + } + + // Expect 4 mutants: + // a - b + // a * b + // a / b + // a % b + function times_with_parens( + int256 a, + int256 b + /// ArithmeticOperatorReplacement(`*` |==> `+`) of: `return ((a)) * b;` + ) public pure returns (int256) { + return ((a)) + b; + } + + // Expect 5 mutants: + // a + b + // a - b + // a / b + // a ** b + // a % b + function unsigned_times_with_parens( + uint256 a, + uint256 b + ) public pure returns (uint256) { + return ((a)) * b; + } + + // Expect 5 mutants: + // a + b + // a - b + // a / b + // a * b + // a % b + + function power(uint256 a, uint256 b) public pure returns (uint256) { + return a ** b; + } +} diff --git a/resources/regressions/test_multiple_files_1.json/mutants/13/Ops/AOR/AOR.sol b/resources/regressions/test_multiple_files_1.json/mutants/13/Ops/AOR/AOR.sol new file mode 100644 index 0000000..c31b43f --- /dev/null +++ b/resources/regressions/test_multiple_files_1.json/mutants/13/Ops/AOR/AOR.sol @@ -0,0 +1,61 @@ +// SPDX-License-Identifier: GPL-3.0-only +pragma solidity >0.7.0; +pragma experimental ABIEncoderV2; + +// This contract provides test functions for Arithmetic operator replacement +contract AOR { + // Expect 4 mutants: + // a - b + // a * b + // a / b + // a % b + function plus(int256 a, int256 b) public pure returns (int256) { + return a + b; + } + + // Expect 4 mutants: + // a + b + // a * b + // a / b + // a % b + function minus(int256 a, int256 b) public pure returns (int256) { + return a - b; + } + + // Expect 4 mutants: + // a - b + // a * b + // a / b + // a % b + function times_with_parens( + int256 a, + int256 b + /// ArithmeticOperatorReplacement(`*` |==> `-`) of: `return ((a)) * b;` + ) public pure returns (int256) { + return ((a)) - b; + } + + // Expect 5 mutants: + // a + b + // a - b + // a / b + // a ** b + // a % b + function unsigned_times_with_parens( + uint256 a, + uint256 b + ) public pure returns (uint256) { + return ((a)) * b; + } + + // Expect 5 mutants: + // a + b + // a - b + // a / b + // a * b + // a % b + + function power(uint256 a, uint256 b) public pure returns (uint256) { + return a ** b; + } +} diff --git a/resources/regressions/test_multiple_files_1.json/mutants/14/Ops/AOR/AOR.sol b/resources/regressions/test_multiple_files_1.json/mutants/14/Ops/AOR/AOR.sol new file mode 100644 index 0000000..823139e --- /dev/null +++ b/resources/regressions/test_multiple_files_1.json/mutants/14/Ops/AOR/AOR.sol @@ -0,0 +1,61 @@ +// SPDX-License-Identifier: GPL-3.0-only +pragma solidity >0.7.0; +pragma experimental ABIEncoderV2; + +// This contract provides test functions for Arithmetic operator replacement +contract AOR { + // Expect 4 mutants: + // a - b + // a * b + // a / b + // a % b + function plus(int256 a, int256 b) public pure returns (int256) { + return a + b; + } + + // Expect 4 mutants: + // a + b + // a * b + // a / b + // a % b + function minus(int256 a, int256 b) public pure returns (int256) { + return a - b; + } + + // Expect 4 mutants: + // a - b + // a * b + // a / b + // a % b + function times_with_parens( + int256 a, + int256 b + /// ArithmeticOperatorReplacement(`*` |==> `/`) of: `return ((a)) * b;` + ) public pure returns (int256) { + return ((a)) / b; + } + + // Expect 5 mutants: + // a + b + // a - b + // a / b + // a ** b + // a % b + function unsigned_times_with_parens( + uint256 a, + uint256 b + ) public pure returns (uint256) { + return ((a)) * b; + } + + // Expect 5 mutants: + // a + b + // a - b + // a / b + // a * b + // a % b + + function power(uint256 a, uint256 b) public pure returns (uint256) { + return a ** b; + } +} diff --git a/resources/regressions/test_multiple_files_1.json/mutants/15/Ops/AOR/AOR.sol b/resources/regressions/test_multiple_files_1.json/mutants/15/Ops/AOR/AOR.sol new file mode 100644 index 0000000..aa4ecd0 --- /dev/null +++ b/resources/regressions/test_multiple_files_1.json/mutants/15/Ops/AOR/AOR.sol @@ -0,0 +1,61 @@ +// SPDX-License-Identifier: GPL-3.0-only +pragma solidity >0.7.0; +pragma experimental ABIEncoderV2; + +// This contract provides test functions for Arithmetic operator replacement +contract AOR { + // Expect 4 mutants: + // a - b + // a * b + // a / b + // a % b + function plus(int256 a, int256 b) public pure returns (int256) { + return a + b; + } + + // Expect 4 mutants: + // a + b + // a * b + // a / b + // a % b + function minus(int256 a, int256 b) public pure returns (int256) { + return a - b; + } + + // Expect 4 mutants: + // a - b + // a * b + // a / b + // a % b + function times_with_parens( + int256 a, + int256 b + /// ArithmeticOperatorReplacement(`*` |==> `%`) of: `return ((a)) * b;` + ) public pure returns (int256) { + return ((a)) % b; + } + + // Expect 5 mutants: + // a + b + // a - b + // a / b + // a ** b + // a % b + function unsigned_times_with_parens( + uint256 a, + uint256 b + ) public pure returns (uint256) { + return ((a)) * b; + } + + // Expect 5 mutants: + // a + b + // a - b + // a / b + // a * b + // a % b + + function power(uint256 a, uint256 b) public pure returns (uint256) { + return a ** b; + } +} diff --git a/resources/regressions/test_multiple_files_1.json/mutants/16/Ops/AOR/AOR.sol b/resources/regressions/test_multiple_files_1.json/mutants/16/Ops/AOR/AOR.sol new file mode 100644 index 0000000..13eee61 --- /dev/null +++ b/resources/regressions/test_multiple_files_1.json/mutants/16/Ops/AOR/AOR.sol @@ -0,0 +1,61 @@ +// SPDX-License-Identifier: GPL-3.0-only +pragma solidity >0.7.0; +pragma experimental ABIEncoderV2; + +// This contract provides test functions for Arithmetic operator replacement +contract AOR { + // Expect 4 mutants: + // a - b + // a * b + // a / b + // a % b + function plus(int256 a, int256 b) public pure returns (int256) { + return a + b; + } + + // Expect 4 mutants: + // a + b + // a * b + // a / b + // a % b + function minus(int256 a, int256 b) public pure returns (int256) { + return a - b; + } + + // Expect 4 mutants: + // a - b + // a * b + // a / b + // a % b + function times_with_parens( + int256 a, + int256 b + ) public pure returns (int256) { + return ((a)) * b; + } + + // Expect 5 mutants: + // a + b + // a - b + // a / b + // a ** b + // a % b + function unsigned_times_with_parens( + uint256 a, + uint256 b + /// StatementDeletion(`return ((a)) * b` |==> `assert(true)`) of: `return ((a)) * b;` + ) public pure returns (uint256) { + assert(true); + } + + // Expect 5 mutants: + // a + b + // a - b + // a / b + // a * b + // a % b + + function power(uint256 a, uint256 b) public pure returns (uint256) { + return a ** b; + } +} diff --git a/resources/regressions/test_multiple_files_1.json/mutants/17/Ops/AOR/AOR.sol b/resources/regressions/test_multiple_files_1.json/mutants/17/Ops/AOR/AOR.sol new file mode 100644 index 0000000..8666cef --- /dev/null +++ b/resources/regressions/test_multiple_files_1.json/mutants/17/Ops/AOR/AOR.sol @@ -0,0 +1,61 @@ +// SPDX-License-Identifier: GPL-3.0-only +pragma solidity >0.7.0; +pragma experimental ABIEncoderV2; + +// This contract provides test functions for Arithmetic operator replacement +contract AOR { + // Expect 4 mutants: + // a - b + // a * b + // a / b + // a % b + function plus(int256 a, int256 b) public pure returns (int256) { + return a + b; + } + + // Expect 4 mutants: + // a + b + // a * b + // a / b + // a % b + function minus(int256 a, int256 b) public pure returns (int256) { + return a - b; + } + + // Expect 4 mutants: + // a - b + // a * b + // a / b + // a % b + function times_with_parens( + int256 a, + int256 b + ) public pure returns (int256) { + return ((a)) * b; + } + + // Expect 5 mutants: + // a + b + // a - b + // a / b + // a ** b + // a % b + function unsigned_times_with_parens( + uint256 a, + uint256 b + /// ArithmeticOperatorReplacement(`*` |==> `+`) of: `return ((a)) * b;` + ) public pure returns (uint256) { + return ((a)) + b; + } + + // Expect 5 mutants: + // a + b + // a - b + // a / b + // a * b + // a % b + + function power(uint256 a, uint256 b) public pure returns (uint256) { + return a ** b; + } +} diff --git a/resources/regressions/test_multiple_files_1.json/mutants/18/Ops/AOR/AOR.sol b/resources/regressions/test_multiple_files_1.json/mutants/18/Ops/AOR/AOR.sol new file mode 100644 index 0000000..4d3c74d --- /dev/null +++ b/resources/regressions/test_multiple_files_1.json/mutants/18/Ops/AOR/AOR.sol @@ -0,0 +1,61 @@ +// SPDX-License-Identifier: GPL-3.0-only +pragma solidity >0.7.0; +pragma experimental ABIEncoderV2; + +// This contract provides test functions for Arithmetic operator replacement +contract AOR { + // Expect 4 mutants: + // a - b + // a * b + // a / b + // a % b + function plus(int256 a, int256 b) public pure returns (int256) { + return a + b; + } + + // Expect 4 mutants: + // a + b + // a * b + // a / b + // a % b + function minus(int256 a, int256 b) public pure returns (int256) { + return a - b; + } + + // Expect 4 mutants: + // a - b + // a * b + // a / b + // a % b + function times_with_parens( + int256 a, + int256 b + ) public pure returns (int256) { + return ((a)) * b; + } + + // Expect 5 mutants: + // a + b + // a - b + // a / b + // a ** b + // a % b + function unsigned_times_with_parens( + uint256 a, + uint256 b + /// ArithmeticOperatorReplacement(`*` |==> `-`) of: `return ((a)) * b;` + ) public pure returns (uint256) { + return ((a)) - b; + } + + // Expect 5 mutants: + // a + b + // a - b + // a / b + // a * b + // a % b + + function power(uint256 a, uint256 b) public pure returns (uint256) { + return a ** b; + } +} diff --git a/resources/regressions/test_multiple_files_1.json/mutants/19/Ops/AOR/AOR.sol b/resources/regressions/test_multiple_files_1.json/mutants/19/Ops/AOR/AOR.sol new file mode 100644 index 0000000..f9a4969 --- /dev/null +++ b/resources/regressions/test_multiple_files_1.json/mutants/19/Ops/AOR/AOR.sol @@ -0,0 +1,61 @@ +// SPDX-License-Identifier: GPL-3.0-only +pragma solidity >0.7.0; +pragma experimental ABIEncoderV2; + +// This contract provides test functions for Arithmetic operator replacement +contract AOR { + // Expect 4 mutants: + // a - b + // a * b + // a / b + // a % b + function plus(int256 a, int256 b) public pure returns (int256) { + return a + b; + } + + // Expect 4 mutants: + // a + b + // a * b + // a / b + // a % b + function minus(int256 a, int256 b) public pure returns (int256) { + return a - b; + } + + // Expect 4 mutants: + // a - b + // a * b + // a / b + // a % b + function times_with_parens( + int256 a, + int256 b + ) public pure returns (int256) { + return ((a)) * b; + } + + // Expect 5 mutants: + // a + b + // a - b + // a / b + // a ** b + // a % b + function unsigned_times_with_parens( + uint256 a, + uint256 b + /// ArithmeticOperatorReplacement(`*` |==> `/`) of: `return ((a)) * b;` + ) public pure returns (uint256) { + return ((a)) / b; + } + + // Expect 5 mutants: + // a + b + // a - b + // a / b + // a * b + // a % b + + function power(uint256 a, uint256 b) public pure returns (uint256) { + return a ** b; + } +} diff --git a/resources/regressions/test_multiple_files_1.json/mutants/2/Ops/AOR/AOR.sol b/resources/regressions/test_multiple_files_1.json/mutants/2/Ops/AOR/AOR.sol new file mode 100644 index 0000000..9b516ff --- /dev/null +++ b/resources/regressions/test_multiple_files_1.json/mutants/2/Ops/AOR/AOR.sol @@ -0,0 +1,61 @@ +// SPDX-License-Identifier: GPL-3.0-only +pragma solidity >0.7.0; +pragma experimental ABIEncoderV2; + +// This contract provides test functions for Arithmetic operator replacement +contract AOR { + // Expect 4 mutants: + // a - b + // a * b + // a / b + // a % b + /// ArithmeticOperatorReplacement(`+` |==> `-`) of: `return a + b;` + function plus(int256 a, int256 b) public pure returns (int256) { + return a - b; + } + + // Expect 4 mutants: + // a + b + // a * b + // a / b + // a % b + function minus(int256 a, int256 b) public pure returns (int256) { + return a - b; + } + + // Expect 4 mutants: + // a - b + // a * b + // a / b + // a % b + function times_with_parens( + int256 a, + int256 b + ) public pure returns (int256) { + return ((a)) * b; + } + + // Expect 5 mutants: + // a + b + // a - b + // a / b + // a ** b + // a % b + function unsigned_times_with_parens( + uint256 a, + uint256 b + ) public pure returns (uint256) { + return ((a)) * b; + } + + // Expect 5 mutants: + // a + b + // a - b + // a / b + // a * b + // a % b + + function power(uint256 a, uint256 b) public pure returns (uint256) { + return a ** b; + } +} diff --git a/resources/regressions/test_multiple_files_1.json/mutants/20/Ops/AOR/AOR.sol b/resources/regressions/test_multiple_files_1.json/mutants/20/Ops/AOR/AOR.sol new file mode 100644 index 0000000..3706f5c --- /dev/null +++ b/resources/regressions/test_multiple_files_1.json/mutants/20/Ops/AOR/AOR.sol @@ -0,0 +1,61 @@ +// SPDX-License-Identifier: GPL-3.0-only +pragma solidity >0.7.0; +pragma experimental ABIEncoderV2; + +// This contract provides test functions for Arithmetic operator replacement +contract AOR { + // Expect 4 mutants: + // a - b + // a * b + // a / b + // a % b + function plus(int256 a, int256 b) public pure returns (int256) { + return a + b; + } + + // Expect 4 mutants: + // a + b + // a * b + // a / b + // a % b + function minus(int256 a, int256 b) public pure returns (int256) { + return a - b; + } + + // Expect 4 mutants: + // a - b + // a * b + // a / b + // a % b + function times_with_parens( + int256 a, + int256 b + ) public pure returns (int256) { + return ((a)) * b; + } + + // Expect 5 mutants: + // a + b + // a - b + // a / b + // a ** b + // a % b + function unsigned_times_with_parens( + uint256 a, + uint256 b + /// ArithmeticOperatorReplacement(`*` |==> `**`) of: `return ((a)) * b;` + ) public pure returns (uint256) { + return ((a)) ** b; + } + + // Expect 5 mutants: + // a + b + // a - b + // a / b + // a * b + // a % b + + function power(uint256 a, uint256 b) public pure returns (uint256) { + return a ** b; + } +} diff --git a/resources/regressions/test_multiple_files_1.json/mutants/21/Ops/AOR/AOR.sol b/resources/regressions/test_multiple_files_1.json/mutants/21/Ops/AOR/AOR.sol new file mode 100644 index 0000000..67aa6b3 --- /dev/null +++ b/resources/regressions/test_multiple_files_1.json/mutants/21/Ops/AOR/AOR.sol @@ -0,0 +1,61 @@ +// SPDX-License-Identifier: GPL-3.0-only +pragma solidity >0.7.0; +pragma experimental ABIEncoderV2; + +// This contract provides test functions for Arithmetic operator replacement +contract AOR { + // Expect 4 mutants: + // a - b + // a * b + // a / b + // a % b + function plus(int256 a, int256 b) public pure returns (int256) { + return a + b; + } + + // Expect 4 mutants: + // a + b + // a * b + // a / b + // a % b + function minus(int256 a, int256 b) public pure returns (int256) { + return a - b; + } + + // Expect 4 mutants: + // a - b + // a * b + // a / b + // a % b + function times_with_parens( + int256 a, + int256 b + ) public pure returns (int256) { + return ((a)) * b; + } + + // Expect 5 mutants: + // a + b + // a - b + // a / b + // a ** b + // a % b + function unsigned_times_with_parens( + uint256 a, + uint256 b + /// ArithmeticOperatorReplacement(`*` |==> `%`) of: `return ((a)) * b;` + ) public pure returns (uint256) { + return ((a)) % b; + } + + // Expect 5 mutants: + // a + b + // a - b + // a / b + // a * b + // a % b + + function power(uint256 a, uint256 b) public pure returns (uint256) { + return a ** b; + } +} diff --git a/resources/regressions/test_multiple_files_1.json/mutants/22/Ops/AOR/AOR.sol b/resources/regressions/test_multiple_files_1.json/mutants/22/Ops/AOR/AOR.sol new file mode 100644 index 0000000..c49b0fc --- /dev/null +++ b/resources/regressions/test_multiple_files_1.json/mutants/22/Ops/AOR/AOR.sol @@ -0,0 +1,61 @@ +// SPDX-License-Identifier: GPL-3.0-only +pragma solidity >0.7.0; +pragma experimental ABIEncoderV2; + +// This contract provides test functions for Arithmetic operator replacement +contract AOR { + // Expect 4 mutants: + // a - b + // a * b + // a / b + // a % b + function plus(int256 a, int256 b) public pure returns (int256) { + return a + b; + } + + // Expect 4 mutants: + // a + b + // a * b + // a / b + // a % b + function minus(int256 a, int256 b) public pure returns (int256) { + return a - b; + } + + // Expect 4 mutants: + // a - b + // a * b + // a / b + // a % b + function times_with_parens( + int256 a, + int256 b + ) public pure returns (int256) { + return ((a)) * b; + } + + // Expect 5 mutants: + // a + b + // a - b + // a / b + // a ** b + // a % b + function unsigned_times_with_parens( + uint256 a, + uint256 b + ) public pure returns (uint256) { + return ((a)) * b; + } + + // Expect 5 mutants: + // a + b + // a - b + // a / b + // a * b + // a % b + + /// StatementDeletion(`return a ** b` |==> `assert(true)`) of: `return a ** b;` + function power(uint256 a, uint256 b) public pure returns (uint256) { + assert(true); + } +} diff --git a/resources/regressions/test_multiple_files_1.json/mutants/23/Ops/AOR/AOR.sol b/resources/regressions/test_multiple_files_1.json/mutants/23/Ops/AOR/AOR.sol new file mode 100644 index 0000000..b577022 --- /dev/null +++ b/resources/regressions/test_multiple_files_1.json/mutants/23/Ops/AOR/AOR.sol @@ -0,0 +1,61 @@ +// SPDX-License-Identifier: GPL-3.0-only +pragma solidity >0.7.0; +pragma experimental ABIEncoderV2; + +// This contract provides test functions for Arithmetic operator replacement +contract AOR { + // Expect 4 mutants: + // a - b + // a * b + // a / b + // a % b + function plus(int256 a, int256 b) public pure returns (int256) { + return a + b; + } + + // Expect 4 mutants: + // a + b + // a * b + // a / b + // a % b + function minus(int256 a, int256 b) public pure returns (int256) { + return a - b; + } + + // Expect 4 mutants: + // a - b + // a * b + // a / b + // a % b + function times_with_parens( + int256 a, + int256 b + ) public pure returns (int256) { + return ((a)) * b; + } + + // Expect 5 mutants: + // a + b + // a - b + // a / b + // a ** b + // a % b + function unsigned_times_with_parens( + uint256 a, + uint256 b + ) public pure returns (uint256) { + return ((a)) * b; + } + + // Expect 5 mutants: + // a + b + // a - b + // a / b + // a * b + // a % b + + /// ArithmeticOperatorReplacement(`**` |==> `+`) of: `return a ** b;` + function power(uint256 a, uint256 b) public pure returns (uint256) { + return a + b; + } +} diff --git a/resources/regressions/test_multiple_files_1.json/mutants/24/Ops/AOR/AOR.sol b/resources/regressions/test_multiple_files_1.json/mutants/24/Ops/AOR/AOR.sol new file mode 100644 index 0000000..fbde14d --- /dev/null +++ b/resources/regressions/test_multiple_files_1.json/mutants/24/Ops/AOR/AOR.sol @@ -0,0 +1,61 @@ +// SPDX-License-Identifier: GPL-3.0-only +pragma solidity >0.7.0; +pragma experimental ABIEncoderV2; + +// This contract provides test functions for Arithmetic operator replacement +contract AOR { + // Expect 4 mutants: + // a - b + // a * b + // a / b + // a % b + function plus(int256 a, int256 b) public pure returns (int256) { + return a + b; + } + + // Expect 4 mutants: + // a + b + // a * b + // a / b + // a % b + function minus(int256 a, int256 b) public pure returns (int256) { + return a - b; + } + + // Expect 4 mutants: + // a - b + // a * b + // a / b + // a % b + function times_with_parens( + int256 a, + int256 b + ) public pure returns (int256) { + return ((a)) * b; + } + + // Expect 5 mutants: + // a + b + // a - b + // a / b + // a ** b + // a % b + function unsigned_times_with_parens( + uint256 a, + uint256 b + ) public pure returns (uint256) { + return ((a)) * b; + } + + // Expect 5 mutants: + // a + b + // a - b + // a / b + // a * b + // a % b + + /// ArithmeticOperatorReplacement(`**` |==> `-`) of: `return a ** b;` + function power(uint256 a, uint256 b) public pure returns (uint256) { + return a - b; + } +} diff --git a/resources/regressions/test_multiple_files_1.json/mutants/25/Ops/AOR/AOR.sol b/resources/regressions/test_multiple_files_1.json/mutants/25/Ops/AOR/AOR.sol new file mode 100644 index 0000000..92cbf4d --- /dev/null +++ b/resources/regressions/test_multiple_files_1.json/mutants/25/Ops/AOR/AOR.sol @@ -0,0 +1,61 @@ +// SPDX-License-Identifier: GPL-3.0-only +pragma solidity >0.7.0; +pragma experimental ABIEncoderV2; + +// This contract provides test functions for Arithmetic operator replacement +contract AOR { + // Expect 4 mutants: + // a - b + // a * b + // a / b + // a % b + function plus(int256 a, int256 b) public pure returns (int256) { + return a + b; + } + + // Expect 4 mutants: + // a + b + // a * b + // a / b + // a % b + function minus(int256 a, int256 b) public pure returns (int256) { + return a - b; + } + + // Expect 4 mutants: + // a - b + // a * b + // a / b + // a % b + function times_with_parens( + int256 a, + int256 b + ) public pure returns (int256) { + return ((a)) * b; + } + + // Expect 5 mutants: + // a + b + // a - b + // a / b + // a ** b + // a % b + function unsigned_times_with_parens( + uint256 a, + uint256 b + ) public pure returns (uint256) { + return ((a)) * b; + } + + // Expect 5 mutants: + // a + b + // a - b + // a / b + // a * b + // a % b + + /// ArithmeticOperatorReplacement(`**` |==> `*`) of: `return a ** b;` + function power(uint256 a, uint256 b) public pure returns (uint256) { + return a * b; + } +} diff --git a/resources/regressions/test_multiple_files_1.json/mutants/26/Ops/AOR/AOR.sol b/resources/regressions/test_multiple_files_1.json/mutants/26/Ops/AOR/AOR.sol new file mode 100644 index 0000000..e3c6067 --- /dev/null +++ b/resources/regressions/test_multiple_files_1.json/mutants/26/Ops/AOR/AOR.sol @@ -0,0 +1,61 @@ +// SPDX-License-Identifier: GPL-3.0-only +pragma solidity >0.7.0; +pragma experimental ABIEncoderV2; + +// This contract provides test functions for Arithmetic operator replacement +contract AOR { + // Expect 4 mutants: + // a - b + // a * b + // a / b + // a % b + function plus(int256 a, int256 b) public pure returns (int256) { + return a + b; + } + + // Expect 4 mutants: + // a + b + // a * b + // a / b + // a % b + function minus(int256 a, int256 b) public pure returns (int256) { + return a - b; + } + + // Expect 4 mutants: + // a - b + // a * b + // a / b + // a % b + function times_with_parens( + int256 a, + int256 b + ) public pure returns (int256) { + return ((a)) * b; + } + + // Expect 5 mutants: + // a + b + // a - b + // a / b + // a ** b + // a % b + function unsigned_times_with_parens( + uint256 a, + uint256 b + ) public pure returns (uint256) { + return ((a)) * b; + } + + // Expect 5 mutants: + // a + b + // a - b + // a / b + // a * b + // a % b + + /// ArithmeticOperatorReplacement(`**` |==> `/`) of: `return a ** b;` + function power(uint256 a, uint256 b) public pure returns (uint256) { + return a / b; + } +} diff --git a/resources/regressions/test_multiple_files_1.json/mutants/27/Ops/AOR/AOR.sol b/resources/regressions/test_multiple_files_1.json/mutants/27/Ops/AOR/AOR.sol new file mode 100644 index 0000000..c63f66b --- /dev/null +++ b/resources/regressions/test_multiple_files_1.json/mutants/27/Ops/AOR/AOR.sol @@ -0,0 +1,61 @@ +// SPDX-License-Identifier: GPL-3.0-only +pragma solidity >0.7.0; +pragma experimental ABIEncoderV2; + +// This contract provides test functions for Arithmetic operator replacement +contract AOR { + // Expect 4 mutants: + // a - b + // a * b + // a / b + // a % b + function plus(int256 a, int256 b) public pure returns (int256) { + return a + b; + } + + // Expect 4 mutants: + // a + b + // a * b + // a / b + // a % b + function minus(int256 a, int256 b) public pure returns (int256) { + return a - b; + } + + // Expect 4 mutants: + // a - b + // a * b + // a / b + // a % b + function times_with_parens( + int256 a, + int256 b + ) public pure returns (int256) { + return ((a)) * b; + } + + // Expect 5 mutants: + // a + b + // a - b + // a / b + // a ** b + // a % b + function unsigned_times_with_parens( + uint256 a, + uint256 b + ) public pure returns (uint256) { + return ((a)) * b; + } + + // Expect 5 mutants: + // a + b + // a - b + // a / b + // a * b + // a % b + + /// ArithmeticOperatorReplacement(`**` |==> `%`) of: `return a ** b;` + function power(uint256 a, uint256 b) public pure returns (uint256) { + return a % b; + } +} diff --git a/resources/regressions/test_multiple_files_1.json/mutants/28/MultipleContracts/C.sol b/resources/regressions/test_multiple_files_1.json/mutants/28/MultipleContracts/C.sol new file mode 100644 index 0000000..a4c6c97 --- /dev/null +++ b/resources/regressions/test_multiple_files_1.json/mutants/28/MultipleContracts/C.sol @@ -0,0 +1,41 @@ +// SPDX-License-Identifier: GPL-3.0-only + +pragma solidity ^0.8.13; + +library Utils { + function getarray(address[] memory c, address e) internal pure { + assert(c[0] == e); + } + + function add(int8 a, int8 b) public pure returns (int8) { + return a + b; + } +} + +contract C { + function foo() external view returns (address[] memory) { + address[] memory a = new address[](1); + a[0] = msg.sender; + return a; + } + + function get10PowerDecimals(uint8 decimals) public pure returns (uint256) { + uint256 a = 10; + uint256 res = a ** decimals; + return res; + } + + /// StatementDeletion(`assert(c[0] == e)` |==> `assert(true)`) of: `assert(c[0] == e);` + function getarray(address[] memory c, address e) public pure { + assert(true); + } + + function callmyself() external view { + address[] memory b = this.foo(); + Utils.getarray(b, address(this)); + } + + function add(int8 c, int8 d) public pure returns (int8) { + return c + d; + } +} diff --git a/resources/regressions/test_multiple_files_1.json/mutants/29/MultipleContracts/C.sol b/resources/regressions/test_multiple_files_1.json/mutants/29/MultipleContracts/C.sol new file mode 100644 index 0000000..781e87b --- /dev/null +++ b/resources/regressions/test_multiple_files_1.json/mutants/29/MultipleContracts/C.sol @@ -0,0 +1,41 @@ +// SPDX-License-Identifier: GPL-3.0-only + +pragma solidity ^0.8.13; + +library Utils { + function getarray(address[] memory c, address e) internal pure { + assert(c[0] == e); + } + + function add(int8 a, int8 b) public pure returns (int8) { + return a + b; + } +} + +contract C { + function foo() external view returns (address[] memory) { + address[] memory a = new address[](1); + a[0] = msg.sender; + return a; + } + + function get10PowerDecimals(uint8 decimals) public pure returns (uint256) { + uint256 a = 10; + uint256 res = a ** decimals; + return res; + } + + /// RelationalOperatorReplacement(`c[0] == e` |==> `false`) of: `assert(c[0] == e);` + function getarray(address[] memory c, address e) public pure { + assert(false); + } + + function callmyself() external view { + address[] memory b = this.foo(); + Utils.getarray(b, address(this)); + } + + function add(int8 c, int8 d) public pure returns (int8) { + return c + d; + } +} diff --git a/resources/regressions/test_multiple_files_1.json/mutants/3/Ops/AOR/AOR.sol b/resources/regressions/test_multiple_files_1.json/mutants/3/Ops/AOR/AOR.sol new file mode 100644 index 0000000..2e38a56 --- /dev/null +++ b/resources/regressions/test_multiple_files_1.json/mutants/3/Ops/AOR/AOR.sol @@ -0,0 +1,61 @@ +// SPDX-License-Identifier: GPL-3.0-only +pragma solidity >0.7.0; +pragma experimental ABIEncoderV2; + +// This contract provides test functions for Arithmetic operator replacement +contract AOR { + // Expect 4 mutants: + // a - b + // a * b + // a / b + // a % b + /// ArithmeticOperatorReplacement(`+` |==> `*`) of: `return a + b;` + function plus(int256 a, int256 b) public pure returns (int256) { + return a * b; + } + + // Expect 4 mutants: + // a + b + // a * b + // a / b + // a % b + function minus(int256 a, int256 b) public pure returns (int256) { + return a - b; + } + + // Expect 4 mutants: + // a - b + // a * b + // a / b + // a % b + function times_with_parens( + int256 a, + int256 b + ) public pure returns (int256) { + return ((a)) * b; + } + + // Expect 5 mutants: + // a + b + // a - b + // a / b + // a ** b + // a % b + function unsigned_times_with_parens( + uint256 a, + uint256 b + ) public pure returns (uint256) { + return ((a)) * b; + } + + // Expect 5 mutants: + // a + b + // a - b + // a / b + // a * b + // a % b + + function power(uint256 a, uint256 b) public pure returns (uint256) { + return a ** b; + } +} diff --git a/resources/regressions/test_multiple_files_1.json/mutants/30/MultipleContracts/C.sol b/resources/regressions/test_multiple_files_1.json/mutants/30/MultipleContracts/C.sol new file mode 100644 index 0000000..7749a0c --- /dev/null +++ b/resources/regressions/test_multiple_files_1.json/mutants/30/MultipleContracts/C.sol @@ -0,0 +1,41 @@ +// SPDX-License-Identifier: GPL-3.0-only + +pragma solidity ^0.8.13; + +library Utils { + function getarray(address[] memory c, address e) internal pure { + assert(c[0] == e); + } + + function add(int8 a, int8 b) public pure returns (int8) { + return a + b; + } +} + +contract C { + function foo() external view returns (address[] memory) { + address[] memory a = new address[](1); + a[0] = msg.sender; + return a; + } + + function get10PowerDecimals(uint8 decimals) public pure returns (uint256) { + uint256 a = 10; + uint256 res = a ** decimals; + return res; + } + + /// LiteralValueReplacement(`0` |==> `1`) of: `assert(c[0] == e);` + function getarray(address[] memory c, address e) public pure { + assert(c[1] == e); + } + + function callmyself() external view { + address[] memory b = this.foo(); + Utils.getarray(b, address(this)); + } + + function add(int8 c, int8 d) public pure returns (int8) { + return c + d; + } +} diff --git a/resources/regressions/test_multiple_files_1.json/mutants/4/Ops/AOR/AOR.sol b/resources/regressions/test_multiple_files_1.json/mutants/4/Ops/AOR/AOR.sol new file mode 100644 index 0000000..60a969d --- /dev/null +++ b/resources/regressions/test_multiple_files_1.json/mutants/4/Ops/AOR/AOR.sol @@ -0,0 +1,61 @@ +// SPDX-License-Identifier: GPL-3.0-only +pragma solidity >0.7.0; +pragma experimental ABIEncoderV2; + +// This contract provides test functions for Arithmetic operator replacement +contract AOR { + // Expect 4 mutants: + // a - b + // a * b + // a / b + // a % b + /// ArithmeticOperatorReplacement(`+` |==> `/`) of: `return a + b;` + function plus(int256 a, int256 b) public pure returns (int256) { + return a / b; + } + + // Expect 4 mutants: + // a + b + // a * b + // a / b + // a % b + function minus(int256 a, int256 b) public pure returns (int256) { + return a - b; + } + + // Expect 4 mutants: + // a - b + // a * b + // a / b + // a % b + function times_with_parens( + int256 a, + int256 b + ) public pure returns (int256) { + return ((a)) * b; + } + + // Expect 5 mutants: + // a + b + // a - b + // a / b + // a ** b + // a % b + function unsigned_times_with_parens( + uint256 a, + uint256 b + ) public pure returns (uint256) { + return ((a)) * b; + } + + // Expect 5 mutants: + // a + b + // a - b + // a / b + // a * b + // a % b + + function power(uint256 a, uint256 b) public pure returns (uint256) { + return a ** b; + } +} diff --git a/resources/regressions/test_multiple_files_1.json/mutants/5/Ops/AOR/AOR.sol b/resources/regressions/test_multiple_files_1.json/mutants/5/Ops/AOR/AOR.sol new file mode 100644 index 0000000..61a8854 --- /dev/null +++ b/resources/regressions/test_multiple_files_1.json/mutants/5/Ops/AOR/AOR.sol @@ -0,0 +1,61 @@ +// SPDX-License-Identifier: GPL-3.0-only +pragma solidity >0.7.0; +pragma experimental ABIEncoderV2; + +// This contract provides test functions for Arithmetic operator replacement +contract AOR { + // Expect 4 mutants: + // a - b + // a * b + // a / b + // a % b + /// ArithmeticOperatorReplacement(`+` |==> `%`) of: `return a + b;` + function plus(int256 a, int256 b) public pure returns (int256) { + return a % b; + } + + // Expect 4 mutants: + // a + b + // a * b + // a / b + // a % b + function minus(int256 a, int256 b) public pure returns (int256) { + return a - b; + } + + // Expect 4 mutants: + // a - b + // a * b + // a / b + // a % b + function times_with_parens( + int256 a, + int256 b + ) public pure returns (int256) { + return ((a)) * b; + } + + // Expect 5 mutants: + // a + b + // a - b + // a / b + // a ** b + // a % b + function unsigned_times_with_parens( + uint256 a, + uint256 b + ) public pure returns (uint256) { + return ((a)) * b; + } + + // Expect 5 mutants: + // a + b + // a - b + // a / b + // a * b + // a % b + + function power(uint256 a, uint256 b) public pure returns (uint256) { + return a ** b; + } +} diff --git a/resources/regressions/test_multiple_files_1.json/mutants/6/Ops/AOR/AOR.sol b/resources/regressions/test_multiple_files_1.json/mutants/6/Ops/AOR/AOR.sol new file mode 100644 index 0000000..c2a74b7 --- /dev/null +++ b/resources/regressions/test_multiple_files_1.json/mutants/6/Ops/AOR/AOR.sol @@ -0,0 +1,61 @@ +// SPDX-License-Identifier: GPL-3.0-only +pragma solidity >0.7.0; +pragma experimental ABIEncoderV2; + +// This contract provides test functions for Arithmetic operator replacement +contract AOR { + // Expect 4 mutants: + // a - b + // a * b + // a / b + // a % b + function plus(int256 a, int256 b) public pure returns (int256) { + return a + b; + } + + // Expect 4 mutants: + // a + b + // a * b + // a / b + // a % b + /// StatementDeletion(`return a - b` |==> `assert(true)`) of: `return a - b;` + function minus(int256 a, int256 b) public pure returns (int256) { + assert(true); + } + + // Expect 4 mutants: + // a - b + // a * b + // a / b + // a % b + function times_with_parens( + int256 a, + int256 b + ) public pure returns (int256) { + return ((a)) * b; + } + + // Expect 5 mutants: + // a + b + // a - b + // a / b + // a ** b + // a % b + function unsigned_times_with_parens( + uint256 a, + uint256 b + ) public pure returns (uint256) { + return ((a)) * b; + } + + // Expect 5 mutants: + // a + b + // a - b + // a / b + // a * b + // a % b + + function power(uint256 a, uint256 b) public pure returns (uint256) { + return a ** b; + } +} diff --git a/resources/regressions/test_multiple_files_1.json/mutants/7/Ops/AOR/AOR.sol b/resources/regressions/test_multiple_files_1.json/mutants/7/Ops/AOR/AOR.sol new file mode 100644 index 0000000..60846bd --- /dev/null +++ b/resources/regressions/test_multiple_files_1.json/mutants/7/Ops/AOR/AOR.sol @@ -0,0 +1,61 @@ +// SPDX-License-Identifier: GPL-3.0-only +pragma solidity >0.7.0; +pragma experimental ABIEncoderV2; + +// This contract provides test functions for Arithmetic operator replacement +contract AOR { + // Expect 4 mutants: + // a - b + // a * b + // a / b + // a % b + function plus(int256 a, int256 b) public pure returns (int256) { + return a + b; + } + + // Expect 4 mutants: + // a + b + // a * b + // a / b + // a % b + /// ArithmeticOperatorReplacement(`-` |==> `+`) of: `return a - b;` + function minus(int256 a, int256 b) public pure returns (int256) { + return a + b; + } + + // Expect 4 mutants: + // a - b + // a * b + // a / b + // a % b + function times_with_parens( + int256 a, + int256 b + ) public pure returns (int256) { + return ((a)) * b; + } + + // Expect 5 mutants: + // a + b + // a - b + // a / b + // a ** b + // a % b + function unsigned_times_with_parens( + uint256 a, + uint256 b + ) public pure returns (uint256) { + return ((a)) * b; + } + + // Expect 5 mutants: + // a + b + // a - b + // a / b + // a * b + // a % b + + function power(uint256 a, uint256 b) public pure returns (uint256) { + return a ** b; + } +} diff --git a/resources/regressions/test_multiple_files_1.json/mutants/8/Ops/AOR/AOR.sol b/resources/regressions/test_multiple_files_1.json/mutants/8/Ops/AOR/AOR.sol new file mode 100644 index 0000000..2ca17b1 --- /dev/null +++ b/resources/regressions/test_multiple_files_1.json/mutants/8/Ops/AOR/AOR.sol @@ -0,0 +1,61 @@ +// SPDX-License-Identifier: GPL-3.0-only +pragma solidity >0.7.0; +pragma experimental ABIEncoderV2; + +// This contract provides test functions for Arithmetic operator replacement +contract AOR { + // Expect 4 mutants: + // a - b + // a * b + // a / b + // a % b + function plus(int256 a, int256 b) public pure returns (int256) { + return a + b; + } + + // Expect 4 mutants: + // a + b + // a * b + // a / b + // a % b + /// ArithmeticOperatorReplacement(`-` |==> `*`) of: `return a - b;` + function minus(int256 a, int256 b) public pure returns (int256) { + return a * b; + } + + // Expect 4 mutants: + // a - b + // a * b + // a / b + // a % b + function times_with_parens( + int256 a, + int256 b + ) public pure returns (int256) { + return ((a)) * b; + } + + // Expect 5 mutants: + // a + b + // a - b + // a / b + // a ** b + // a % b + function unsigned_times_with_parens( + uint256 a, + uint256 b + ) public pure returns (uint256) { + return ((a)) * b; + } + + // Expect 5 mutants: + // a + b + // a - b + // a / b + // a * b + // a % b + + function power(uint256 a, uint256 b) public pure returns (uint256) { + return a ** b; + } +} diff --git a/resources/regressions/test_multiple_files_1.json/mutants/9/Ops/AOR/AOR.sol b/resources/regressions/test_multiple_files_1.json/mutants/9/Ops/AOR/AOR.sol new file mode 100644 index 0000000..c07a6ae --- /dev/null +++ b/resources/regressions/test_multiple_files_1.json/mutants/9/Ops/AOR/AOR.sol @@ -0,0 +1,61 @@ +// SPDX-License-Identifier: GPL-3.0-only +pragma solidity >0.7.0; +pragma experimental ABIEncoderV2; + +// This contract provides test functions for Arithmetic operator replacement +contract AOR { + // Expect 4 mutants: + // a - b + // a * b + // a / b + // a % b + function plus(int256 a, int256 b) public pure returns (int256) { + return a + b; + } + + // Expect 4 mutants: + // a + b + // a * b + // a / b + // a % b + /// ArithmeticOperatorReplacement(`-` |==> `/`) of: `return a - b;` + function minus(int256 a, int256 b) public pure returns (int256) { + return a / b; + } + + // Expect 4 mutants: + // a - b + // a * b + // a / b + // a % b + function times_with_parens( + int256 a, + int256 b + ) public pure returns (int256) { + return ((a)) * b; + } + + // Expect 5 mutants: + // a + b + // a - b + // a / b + // a ** b + // a % b + function unsigned_times_with_parens( + uint256 a, + uint256 b + ) public pure returns (uint256) { + return ((a)) * b; + } + + // Expect 5 mutants: + // a + b + // a - b + // a / b + // a * b + // a % b + + function power(uint256 a, uint256 b) public pure returns (uint256) { + return a ** b; + } +} diff --git a/resources/regressions/test_no_export.json/gambit_results.json b/resources/regressions/test_no_export.json/gambit_results.json new file mode 100644 index 0000000..3907074 --- /dev/null +++ b/resources/regressions/test_no_export.json/gambit_results.json @@ -0,0 +1,338 @@ +[ + { + "col": 9, + "description": "StatementDeletion", + "diff": "--- original\n+++ mutant\n@@ -9,8 +9,9 @@\n // a * b\n // a / b\n // a % b\n+ /// StatementDeletion(`return a + b` |==> `assert(true)`) of: `return a + b;`\n function plus(int256 a, int256 b) public pure returns (int256) {\n- return a + b;\n+ assert(true);\n }\n \n // Expect 4 mutants:\n", + "id": "1", + "line": 13, + "name": "mutants/1/AOR/AOR.sol", + "op": "STD", + "orig": "return a + b", + "original": "AOR/AOR.sol", + "repl": "assert(true)" + }, + { + "col": 18, + "description": "ArithmeticOperatorReplacement", + "diff": "--- original\n+++ mutant\n@@ -9,8 +9,9 @@\n // a * b\n // a / b\n // a % b\n+ /// ArithmeticOperatorReplacement(`+` |==> `-`) of: `return a + b;`\n function plus(int256 a, int256 b) public pure returns (int256) {\n- return a + b;\n+ return a - b;\n }\n \n // Expect 4 mutants:\n", + "id": "2", + "line": 13, + "name": "mutants/2/AOR/AOR.sol", + "op": "AOR", + "orig": "+", + "original": "AOR/AOR.sol", + "repl": "-" + }, + { + "col": 18, + "description": "ArithmeticOperatorReplacement", + "diff": "--- original\n+++ mutant\n@@ -9,8 +9,9 @@\n // a * b\n // a / b\n // a % b\n+ /// ArithmeticOperatorReplacement(`+` |==> `*`) of: `return a + b;`\n function plus(int256 a, int256 b) public pure returns (int256) {\n- return a + b;\n+ return a * b;\n }\n \n // Expect 4 mutants:\n", + "id": "3", + "line": 13, + "name": "mutants/3/AOR/AOR.sol", + "op": "AOR", + "orig": "+", + "original": "AOR/AOR.sol", + "repl": "*" + }, + { + "col": 18, + "description": "ArithmeticOperatorReplacement", + "diff": "--- original\n+++ mutant\n@@ -9,8 +9,9 @@\n // a * b\n // a / b\n // a % b\n+ /// ArithmeticOperatorReplacement(`+` |==> `/`) of: `return a + b;`\n function plus(int256 a, int256 b) public pure returns (int256) {\n- return a + b;\n+ return a / b;\n }\n \n // Expect 4 mutants:\n", + "id": "4", + "line": 13, + "name": "mutants/4/AOR/AOR.sol", + "op": "AOR", + "orig": "+", + "original": "AOR/AOR.sol", + "repl": "/" + }, + { + "col": 18, + "description": "ArithmeticOperatorReplacement", + "diff": "--- original\n+++ mutant\n@@ -9,8 +9,9 @@\n // a * b\n // a / b\n // a % b\n+ /// ArithmeticOperatorReplacement(`+` |==> `%`) of: `return a + b;`\n function plus(int256 a, int256 b) public pure returns (int256) {\n- return a + b;\n+ return a % b;\n }\n \n // Expect 4 mutants:\n", + "id": "5", + "line": 13, + "name": "mutants/5/AOR/AOR.sol", + "op": "AOR", + "orig": "+", + "original": "AOR/AOR.sol", + "repl": "%" + }, + { + "col": 9, + "description": "StatementDeletion", + "diff": "--- original\n+++ mutant\n@@ -18,8 +18,9 @@\n // a * b\n // a / b\n // a % b\n+ /// StatementDeletion(`return a - b` |==> `assert(true)`) of: `return a - b;`\n function minus(int256 a, int256 b) public pure returns (int256) {\n- return a - b;\n+ assert(true);\n }\n \n // Expect 4 mutants:\n", + "id": "6", + "line": 22, + "name": "mutants/6/AOR/AOR.sol", + "op": "STD", + "orig": "return a - b", + "original": "AOR/AOR.sol", + "repl": "assert(true)" + }, + { + "col": 18, + "description": "ArithmeticOperatorReplacement", + "diff": "--- original\n+++ mutant\n@@ -18,8 +18,9 @@\n // a * b\n // a / b\n // a % b\n+ /// ArithmeticOperatorReplacement(`-` |==> `+`) of: `return a - b;`\n function minus(int256 a, int256 b) public pure returns (int256) {\n- return a - b;\n+ return a + b;\n }\n \n // Expect 4 mutants:\n", + "id": "7", + "line": 22, + "name": "mutants/7/AOR/AOR.sol", + "op": "AOR", + "orig": "-", + "original": "AOR/AOR.sol", + "repl": "+" + }, + { + "col": 18, + "description": "ArithmeticOperatorReplacement", + "diff": "--- original\n+++ mutant\n@@ -18,8 +18,9 @@\n // a * b\n // a / b\n // a % b\n+ /// ArithmeticOperatorReplacement(`-` |==> `*`) of: `return a - b;`\n function minus(int256 a, int256 b) public pure returns (int256) {\n- return a - b;\n+ return a * b;\n }\n \n // Expect 4 mutants:\n", + "id": "8", + "line": 22, + "name": "mutants/8/AOR/AOR.sol", + "op": "AOR", + "orig": "-", + "original": "AOR/AOR.sol", + "repl": "*" + }, + { + "col": 18, + "description": "ArithmeticOperatorReplacement", + "diff": "--- original\n+++ mutant\n@@ -18,8 +18,9 @@\n // a * b\n // a / b\n // a % b\n+ /// ArithmeticOperatorReplacement(`-` |==> `/`) of: `return a - b;`\n function minus(int256 a, int256 b) public pure returns (int256) {\n- return a - b;\n+ return a / b;\n }\n \n // Expect 4 mutants:\n", + "id": "9", + "line": 22, + "name": "mutants/9/AOR/AOR.sol", + "op": "AOR", + "orig": "-", + "original": "AOR/AOR.sol", + "repl": "/" + }, + { + "col": 18, + "description": "ArithmeticOperatorReplacement", + "diff": "--- original\n+++ mutant\n@@ -18,8 +18,9 @@\n // a * b\n // a / b\n // a % b\n+ /// ArithmeticOperatorReplacement(`-` |==> `%`) of: `return a - b;`\n function minus(int256 a, int256 b) public pure returns (int256) {\n- return a - b;\n+ return a % b;\n }\n \n // Expect 4 mutants:\n", + "id": "10", + "line": 22, + "name": "mutants/10/AOR/AOR.sol", + "op": "AOR", + "orig": "-", + "original": "AOR/AOR.sol", + "repl": "%" + }, + { + "col": 9, + "description": "StatementDeletion", + "diff": "--- original\n+++ mutant\n@@ -30,8 +30,9 @@\n function times_with_parens(\n int256 a,\n int256 b\n+ /// StatementDeletion(`return ((a)) * b` |==> `assert(true)`) of: `return ((a)) * b;`\n ) public pure returns (int256) {\n- return ((a)) * b;\n+ assert(true);\n }\n \n // Expect 5 mutants:\n", + "id": "11", + "line": 34, + "name": "mutants/11/AOR/AOR.sol", + "op": "STD", + "orig": "return ((a)) * b", + "original": "AOR/AOR.sol", + "repl": "assert(true)" + }, + { + "col": 22, + "description": "ArithmeticOperatorReplacement", + "diff": "--- original\n+++ mutant\n@@ -30,8 +30,9 @@\n function times_with_parens(\n int256 a,\n int256 b\n+ /// ArithmeticOperatorReplacement(`*` |==> `+`) of: `return ((a)) * b;`\n ) public pure returns (int256) {\n- return ((a)) * b;\n+ return ((a)) + b;\n }\n \n // Expect 5 mutants:\n", + "id": "12", + "line": 34, + "name": "mutants/12/AOR/AOR.sol", + "op": "AOR", + "orig": "*", + "original": "AOR/AOR.sol", + "repl": "+" + }, + { + "col": 22, + "description": "ArithmeticOperatorReplacement", + "diff": "--- original\n+++ mutant\n@@ -30,8 +30,9 @@\n function times_with_parens(\n int256 a,\n int256 b\n+ /// ArithmeticOperatorReplacement(`*` |==> `-`) of: `return ((a)) * b;`\n ) public pure returns (int256) {\n- return ((a)) * b;\n+ return ((a)) - b;\n }\n \n // Expect 5 mutants:\n", + "id": "13", + "line": 34, + "name": "mutants/13/AOR/AOR.sol", + "op": "AOR", + "orig": "*", + "original": "AOR/AOR.sol", + "repl": "-" + }, + { + "col": 22, + "description": "ArithmeticOperatorReplacement", + "diff": "--- original\n+++ mutant\n@@ -30,8 +30,9 @@\n function times_with_parens(\n int256 a,\n int256 b\n+ /// ArithmeticOperatorReplacement(`*` |==> `/`) of: `return ((a)) * b;`\n ) public pure returns (int256) {\n- return ((a)) * b;\n+ return ((a)) / b;\n }\n \n // Expect 5 mutants:\n", + "id": "14", + "line": 34, + "name": "mutants/14/AOR/AOR.sol", + "op": "AOR", + "orig": "*", + "original": "AOR/AOR.sol", + "repl": "/" + }, + { + "col": 22, + "description": "ArithmeticOperatorReplacement", + "diff": "--- original\n+++ mutant\n@@ -30,8 +30,9 @@\n function times_with_parens(\n int256 a,\n int256 b\n+ /// ArithmeticOperatorReplacement(`*` |==> `%`) of: `return ((a)) * b;`\n ) public pure returns (int256) {\n- return ((a)) * b;\n+ return ((a)) % b;\n }\n \n // Expect 5 mutants:\n", + "id": "15", + "line": 34, + "name": "mutants/15/AOR/AOR.sol", + "op": "AOR", + "orig": "*", + "original": "AOR/AOR.sol", + "repl": "%" + }, + { + "col": 9, + "description": "StatementDeletion", + "diff": "--- original\n+++ mutant\n@@ -43,8 +43,9 @@\n function unsigned_times_with_parens(\n uint256 a,\n uint256 b\n+ /// StatementDeletion(`return ((a)) * b` |==> `assert(true)`) of: `return ((a)) * b;`\n ) public pure returns (uint256) {\n- return ((a)) * b;\n+ assert(true);\n }\n \n // Expect 5 mutants:\n", + "id": "16", + "line": 47, + "name": "mutants/16/AOR/AOR.sol", + "op": "STD", + "orig": "return ((a)) * b", + "original": "AOR/AOR.sol", + "repl": "assert(true)" + }, + { + "col": 22, + "description": "ArithmeticOperatorReplacement", + "diff": "--- original\n+++ mutant\n@@ -43,8 +43,9 @@\n function unsigned_times_with_parens(\n uint256 a,\n uint256 b\n+ /// ArithmeticOperatorReplacement(`*` |==> `+`) of: `return ((a)) * b;`\n ) public pure returns (uint256) {\n- return ((a)) * b;\n+ return ((a)) + b;\n }\n \n // Expect 5 mutants:\n", + "id": "17", + "line": 47, + "name": "mutants/17/AOR/AOR.sol", + "op": "AOR", + "orig": "*", + "original": "AOR/AOR.sol", + "repl": "+" + }, + { + "col": 22, + "description": "ArithmeticOperatorReplacement", + "diff": "--- original\n+++ mutant\n@@ -43,8 +43,9 @@\n function unsigned_times_with_parens(\n uint256 a,\n uint256 b\n+ /// ArithmeticOperatorReplacement(`*` |==> `-`) of: `return ((a)) * b;`\n ) public pure returns (uint256) {\n- return ((a)) * b;\n+ return ((a)) - b;\n }\n \n // Expect 5 mutants:\n", + "id": "18", + "line": 47, + "name": "mutants/18/AOR/AOR.sol", + "op": "AOR", + "orig": "*", + "original": "AOR/AOR.sol", + "repl": "-" + }, + { + "col": 22, + "description": "ArithmeticOperatorReplacement", + "diff": "--- original\n+++ mutant\n@@ -43,8 +43,9 @@\n function unsigned_times_with_parens(\n uint256 a,\n uint256 b\n+ /// ArithmeticOperatorReplacement(`*` |==> `/`) of: `return ((a)) * b;`\n ) public pure returns (uint256) {\n- return ((a)) * b;\n+ return ((a)) / b;\n }\n \n // Expect 5 mutants:\n", + "id": "19", + "line": 47, + "name": "mutants/19/AOR/AOR.sol", + "op": "AOR", + "orig": "*", + "original": "AOR/AOR.sol", + "repl": "/" + }, + { + "col": 22, + "description": "ArithmeticOperatorReplacement", + "diff": "--- original\n+++ mutant\n@@ -43,8 +43,9 @@\n function unsigned_times_with_parens(\n uint256 a,\n uint256 b\n+ /// ArithmeticOperatorReplacement(`*` |==> `**`) of: `return ((a)) * b;`\n ) public pure returns (uint256) {\n- return ((a)) * b;\n+ return ((a)) ** b;\n }\n \n // Expect 5 mutants:\n", + "id": "20", + "line": 47, + "name": "mutants/20/AOR/AOR.sol", + "op": "AOR", + "orig": "*", + "original": "AOR/AOR.sol", + "repl": "**" + }, + { + "col": 22, + "description": "ArithmeticOperatorReplacement", + "diff": "--- original\n+++ mutant\n@@ -43,8 +43,9 @@\n function unsigned_times_with_parens(\n uint256 a,\n uint256 b\n+ /// ArithmeticOperatorReplacement(`*` |==> `%`) of: `return ((a)) * b;`\n ) public pure returns (uint256) {\n- return ((a)) * b;\n+ return ((a)) % b;\n }\n \n // Expect 5 mutants:\n", + "id": "21", + "line": 47, + "name": "mutants/21/AOR/AOR.sol", + "op": "AOR", + "orig": "*", + "original": "AOR/AOR.sol", + "repl": "%" + }, + { + "col": 9, + "description": "StatementDeletion", + "diff": "--- original\n+++ mutant\n@@ -54,7 +54,8 @@\n // a * b\n // a % b\n \n+ /// StatementDeletion(`return a ** b` |==> `assert(true)`) of: `return a ** b;`\n function power(uint256 a, uint256 b) public pure returns (uint256) {\n- return a ** b;\n+ assert(true);\n }\n }\n", + "id": "22", + "line": 58, + "name": "mutants/22/AOR/AOR.sol", + "op": "STD", + "orig": "return a ** b", + "original": "AOR/AOR.sol", + "repl": "assert(true)" + }, + { + "col": 18, + "description": "ArithmeticOperatorReplacement", + "diff": "--- original\n+++ mutant\n@@ -54,7 +54,8 @@\n // a * b\n // a % b\n \n+ /// ArithmeticOperatorReplacement(`**` |==> `+`) of: `return a ** b;`\n function power(uint256 a, uint256 b) public pure returns (uint256) {\n- return a ** b;\n+ return a + b;\n }\n }\n", + "id": "23", + "line": 58, + "name": "mutants/23/AOR/AOR.sol", + "op": "AOR", + "orig": "**", + "original": "AOR/AOR.sol", + "repl": "+" + }, + { + "col": 18, + "description": "ArithmeticOperatorReplacement", + "diff": "--- original\n+++ mutant\n@@ -54,7 +54,8 @@\n // a * b\n // a % b\n \n+ /// ArithmeticOperatorReplacement(`**` |==> `-`) of: `return a ** b;`\n function power(uint256 a, uint256 b) public pure returns (uint256) {\n- return a ** b;\n+ return a - b;\n }\n }\n", + "id": "24", + "line": 58, + "name": "mutants/24/AOR/AOR.sol", + "op": "AOR", + "orig": "**", + "original": "AOR/AOR.sol", + "repl": "-" + }, + { + "col": 18, + "description": "ArithmeticOperatorReplacement", + "diff": "--- original\n+++ mutant\n@@ -54,7 +54,8 @@\n // a * b\n // a % b\n \n+ /// ArithmeticOperatorReplacement(`**` |==> `*`) of: `return a ** b;`\n function power(uint256 a, uint256 b) public pure returns (uint256) {\n- return a ** b;\n+ return a * b;\n }\n }\n", + "id": "25", + "line": 58, + "name": "mutants/25/AOR/AOR.sol", + "op": "AOR", + "orig": "**", + "original": "AOR/AOR.sol", + "repl": "*" + }, + { + "col": 18, + "description": "ArithmeticOperatorReplacement", + "diff": "--- original\n+++ mutant\n@@ -54,7 +54,8 @@\n // a * b\n // a % b\n \n+ /// ArithmeticOperatorReplacement(`**` |==> `/`) of: `return a ** b;`\n function power(uint256 a, uint256 b) public pure returns (uint256) {\n- return a ** b;\n+ return a / b;\n }\n }\n", + "id": "26", + "line": 58, + "name": "mutants/26/AOR/AOR.sol", + "op": "AOR", + "orig": "**", + "original": "AOR/AOR.sol", + "repl": "/" + }, + { + "col": 18, + "description": "ArithmeticOperatorReplacement", + "diff": "--- original\n+++ mutant\n@@ -54,7 +54,8 @@\n // a * b\n // a % b\n \n+ /// ArithmeticOperatorReplacement(`**` |==> `%`) of: `return a ** b;`\n function power(uint256 a, uint256 b) public pure returns (uint256) {\n- return a ** b;\n+ return a % b;\n }\n }\n", + "id": "27", + "line": 58, + "name": "mutants/27/AOR/AOR.sol", + "op": "AOR", + "orig": "**", + "original": "AOR/AOR.sol", + "repl": "%" + }, + { + "col": 9, + "description": "StatementDeletion", + "diff": "--- original\n+++ mutant\n@@ -18,7 +18,8 @@\n \n // Expect 1 mutants:\n // a | b;\n+ /// StatementDeletion(`return a ^ b` |==> `assert(true)`) of: `return a ^ b;`\n function bw_xor(int256 a, int256 b) public pure returns (int256) {\n- return a ^ b;\n+ assert(true);\n }\n }\n", + "id": "28", + "line": 22, + "name": "mutants/28/BOR/BOR.sol", + "op": "STD", + "orig": "return a ^ b", + "original": "BOR/BOR.sol", + "repl": "assert(true)" + } +] \ No newline at end of file diff --git a/resources/regressions/test_no_export.json/mutants.log b/resources/regressions/test_no_export.json/mutants.log new file mode 100644 index 0000000..8be8ffe --- /dev/null +++ b/resources/regressions/test_no_export.json/mutants.log @@ -0,0 +1,28 @@ +1,STD,AOR/AOR.sol,13:9,return a + b,assert(true) +2,AOR,AOR/AOR.sol,13:18,+,- +3,AOR,AOR/AOR.sol,13:18,+,* +4,AOR,AOR/AOR.sol,13:18,+,/ +5,AOR,AOR/AOR.sol,13:18,+,% +6,STD,AOR/AOR.sol,22:9,return a - b,assert(true) +7,AOR,AOR/AOR.sol,22:18,-,+ +8,AOR,AOR/AOR.sol,22:18,-,* +9,AOR,AOR/AOR.sol,22:18,-,/ +10,AOR,AOR/AOR.sol,22:18,-,% +11,STD,AOR/AOR.sol,34:9,return ((a)) * b,assert(true) +12,AOR,AOR/AOR.sol,34:22,*,+ +13,AOR,AOR/AOR.sol,34:22,*,- +14,AOR,AOR/AOR.sol,34:22,*,/ +15,AOR,AOR/AOR.sol,34:22,*,% +16,STD,AOR/AOR.sol,47:9,return ((a)) * b,assert(true) +17,AOR,AOR/AOR.sol,47:22,*,+ +18,AOR,AOR/AOR.sol,47:22,*,- +19,AOR,AOR/AOR.sol,47:22,*,/ +20,AOR,AOR/AOR.sol,47:22,*,** +21,AOR,AOR/AOR.sol,47:22,*,% +22,STD,AOR/AOR.sol,58:9,return a ** b,assert(true) +23,AOR,AOR/AOR.sol,58:18,**,+ +24,AOR,AOR/AOR.sol,58:18,**,- +25,AOR,AOR/AOR.sol,58:18,**,* +26,AOR,AOR/AOR.sol,58:18,**,/ +27,AOR,AOR/AOR.sol,58:18,**,% +28,STD,BOR/BOR.sol,22:9,return a ^ b,assert(true) diff --git a/resources/regressions/test_num_mutants.json/gambit_results.json b/resources/regressions/test_num_mutants.json/gambit_results.json new file mode 100644 index 0000000..5430fca --- /dev/null +++ b/resources/regressions/test_num_mutants.json/gambit_results.json @@ -0,0 +1,62 @@ +[ + { + "col": 18, + "description": "ArithmeticOperatorReplacement", + "diff": "--- original\n+++ mutant\n@@ -9,8 +9,9 @@\n // a * b\n // a / b\n // a % b\n+ /// ArithmeticOperatorReplacement(`+` |==> `-`) of: `return a + b;`\n function plus(int256 a, int256 b) public pure returns (int256) {\n- return a + b;\n+ return a - b;\n }\n \n // Expect 4 mutants:\n", + "id": "1", + "line": 13, + "name": "mutants/1/AOR/AOR.sol", + "op": "AOR", + "orig": "+", + "original": "AOR/AOR.sol", + "repl": "-" + }, + { + "col": 22, + "description": "ArithmeticOperatorReplacement", + "diff": "--- original\n+++ mutant\n@@ -30,8 +30,9 @@\n function times_with_parens(\n int256 a,\n int256 b\n+ /// ArithmeticOperatorReplacement(`*` |==> `-`) of: `return ((a)) * b;`\n ) public pure returns (int256) {\n- return ((a)) * b;\n+ return ((a)) - b;\n }\n \n // Expect 5 mutants:\n", + "id": "2", + "line": 34, + "name": "mutants/2/AOR/AOR.sol", + "op": "AOR", + "orig": "*", + "original": "AOR/AOR.sol", + "repl": "-" + }, + { + "col": 22, + "description": "ArithmeticOperatorReplacement", + "diff": "--- original\n+++ mutant\n@@ -43,8 +43,9 @@\n function unsigned_times_with_parens(\n uint256 a,\n uint256 b\n+ /// ArithmeticOperatorReplacement(`*` |==> `/`) of: `return ((a)) * b;`\n ) public pure returns (uint256) {\n- return ((a)) * b;\n+ return ((a)) / b;\n }\n \n // Expect 5 mutants:\n", + "id": "3", + "line": 47, + "name": "mutants/3/AOR/AOR.sol", + "op": "AOR", + "orig": "*", + "original": "AOR/AOR.sol", + "repl": "/" + }, + { + "col": 22, + "description": "ArithmeticOperatorReplacement", + "diff": "--- original\n+++ mutant\n@@ -43,8 +43,9 @@\n function unsigned_times_with_parens(\n uint256 a,\n uint256 b\n+ /// ArithmeticOperatorReplacement(`*` |==> `**`) of: `return ((a)) * b;`\n ) public pure returns (uint256) {\n- return ((a)) * b;\n+ return ((a)) ** b;\n }\n \n // Expect 5 mutants:\n", + "id": "4", + "line": 47, + "name": "mutants/4/AOR/AOR.sol", + "op": "AOR", + "orig": "*", + "original": "AOR/AOR.sol", + "repl": "**" + }, + { + "col": 18, + "description": "ArithmeticOperatorReplacement", + "diff": "--- original\n+++ mutant\n@@ -54,7 +54,8 @@\n // a * b\n // a % b\n \n+ /// ArithmeticOperatorReplacement(`**` |==> `*`) of: `return a ** b;`\n function power(uint256 a, uint256 b) public pure returns (uint256) {\n- return a ** b;\n+ return a * b;\n }\n }\n", + "id": "5", + "line": 58, + "name": "mutants/5/AOR/AOR.sol", + "op": "AOR", + "orig": "**", + "original": "AOR/AOR.sol", + "repl": "*" + } +] \ No newline at end of file diff --git a/resources/regressions/test_num_mutants.json/mutants.log b/resources/regressions/test_num_mutants.json/mutants.log new file mode 100644 index 0000000..b037ce9 --- /dev/null +++ b/resources/regressions/test_num_mutants.json/mutants.log @@ -0,0 +1,5 @@ +1,AOR,AOR/AOR.sol,13:18,+,- +2,AOR,AOR/AOR.sol,34:22,*,- +3,AOR,AOR/AOR.sol,47:22,*,/ +4,AOR,AOR/AOR.sol,47:22,*,** +5,AOR,AOR/AOR.sol,58:18,**,* diff --git a/resources/regressions/test_num_mutants.json/mutants/1/AOR/AOR.sol b/resources/regressions/test_num_mutants.json/mutants/1/AOR/AOR.sol new file mode 100644 index 0000000..9b516ff --- /dev/null +++ b/resources/regressions/test_num_mutants.json/mutants/1/AOR/AOR.sol @@ -0,0 +1,61 @@ +// SPDX-License-Identifier: GPL-3.0-only +pragma solidity >0.7.0; +pragma experimental ABIEncoderV2; + +// This contract provides test functions for Arithmetic operator replacement +contract AOR { + // Expect 4 mutants: + // a - b + // a * b + // a / b + // a % b + /// ArithmeticOperatorReplacement(`+` |==> `-`) of: `return a + b;` + function plus(int256 a, int256 b) public pure returns (int256) { + return a - b; + } + + // Expect 4 mutants: + // a + b + // a * b + // a / b + // a % b + function minus(int256 a, int256 b) public pure returns (int256) { + return a - b; + } + + // Expect 4 mutants: + // a - b + // a * b + // a / b + // a % b + function times_with_parens( + int256 a, + int256 b + ) public pure returns (int256) { + return ((a)) * b; + } + + // Expect 5 mutants: + // a + b + // a - b + // a / b + // a ** b + // a % b + function unsigned_times_with_parens( + uint256 a, + uint256 b + ) public pure returns (uint256) { + return ((a)) * b; + } + + // Expect 5 mutants: + // a + b + // a - b + // a / b + // a * b + // a % b + + function power(uint256 a, uint256 b) public pure returns (uint256) { + return a ** b; + } +} diff --git a/resources/regressions/test_num_mutants.json/mutants/2/AOR/AOR.sol b/resources/regressions/test_num_mutants.json/mutants/2/AOR/AOR.sol new file mode 100644 index 0000000..c31b43f --- /dev/null +++ b/resources/regressions/test_num_mutants.json/mutants/2/AOR/AOR.sol @@ -0,0 +1,61 @@ +// SPDX-License-Identifier: GPL-3.0-only +pragma solidity >0.7.0; +pragma experimental ABIEncoderV2; + +// This contract provides test functions for Arithmetic operator replacement +contract AOR { + // Expect 4 mutants: + // a - b + // a * b + // a / b + // a % b + function plus(int256 a, int256 b) public pure returns (int256) { + return a + b; + } + + // Expect 4 mutants: + // a + b + // a * b + // a / b + // a % b + function minus(int256 a, int256 b) public pure returns (int256) { + return a - b; + } + + // Expect 4 mutants: + // a - b + // a * b + // a / b + // a % b + function times_with_parens( + int256 a, + int256 b + /// ArithmeticOperatorReplacement(`*` |==> `-`) of: `return ((a)) * b;` + ) public pure returns (int256) { + return ((a)) - b; + } + + // Expect 5 mutants: + // a + b + // a - b + // a / b + // a ** b + // a % b + function unsigned_times_with_parens( + uint256 a, + uint256 b + ) public pure returns (uint256) { + return ((a)) * b; + } + + // Expect 5 mutants: + // a + b + // a - b + // a / b + // a * b + // a % b + + function power(uint256 a, uint256 b) public pure returns (uint256) { + return a ** b; + } +} diff --git a/resources/regressions/test_num_mutants.json/mutants/3/AOR/AOR.sol b/resources/regressions/test_num_mutants.json/mutants/3/AOR/AOR.sol new file mode 100644 index 0000000..f9a4969 --- /dev/null +++ b/resources/regressions/test_num_mutants.json/mutants/3/AOR/AOR.sol @@ -0,0 +1,61 @@ +// SPDX-License-Identifier: GPL-3.0-only +pragma solidity >0.7.0; +pragma experimental ABIEncoderV2; + +// This contract provides test functions for Arithmetic operator replacement +contract AOR { + // Expect 4 mutants: + // a - b + // a * b + // a / b + // a % b + function plus(int256 a, int256 b) public pure returns (int256) { + return a + b; + } + + // Expect 4 mutants: + // a + b + // a * b + // a / b + // a % b + function minus(int256 a, int256 b) public pure returns (int256) { + return a - b; + } + + // Expect 4 mutants: + // a - b + // a * b + // a / b + // a % b + function times_with_parens( + int256 a, + int256 b + ) public pure returns (int256) { + return ((a)) * b; + } + + // Expect 5 mutants: + // a + b + // a - b + // a / b + // a ** b + // a % b + function unsigned_times_with_parens( + uint256 a, + uint256 b + /// ArithmeticOperatorReplacement(`*` |==> `/`) of: `return ((a)) * b;` + ) public pure returns (uint256) { + return ((a)) / b; + } + + // Expect 5 mutants: + // a + b + // a - b + // a / b + // a * b + // a % b + + function power(uint256 a, uint256 b) public pure returns (uint256) { + return a ** b; + } +} diff --git a/resources/regressions/test_num_mutants.json/mutants/4/AOR/AOR.sol b/resources/regressions/test_num_mutants.json/mutants/4/AOR/AOR.sol new file mode 100644 index 0000000..3706f5c --- /dev/null +++ b/resources/regressions/test_num_mutants.json/mutants/4/AOR/AOR.sol @@ -0,0 +1,61 @@ +// SPDX-License-Identifier: GPL-3.0-only +pragma solidity >0.7.0; +pragma experimental ABIEncoderV2; + +// This contract provides test functions for Arithmetic operator replacement +contract AOR { + // Expect 4 mutants: + // a - b + // a * b + // a / b + // a % b + function plus(int256 a, int256 b) public pure returns (int256) { + return a + b; + } + + // Expect 4 mutants: + // a + b + // a * b + // a / b + // a % b + function minus(int256 a, int256 b) public pure returns (int256) { + return a - b; + } + + // Expect 4 mutants: + // a - b + // a * b + // a / b + // a % b + function times_with_parens( + int256 a, + int256 b + ) public pure returns (int256) { + return ((a)) * b; + } + + // Expect 5 mutants: + // a + b + // a - b + // a / b + // a ** b + // a % b + function unsigned_times_with_parens( + uint256 a, + uint256 b + /// ArithmeticOperatorReplacement(`*` |==> `**`) of: `return ((a)) * b;` + ) public pure returns (uint256) { + return ((a)) ** b; + } + + // Expect 5 mutants: + // a + b + // a - b + // a / b + // a * b + // a % b + + function power(uint256 a, uint256 b) public pure returns (uint256) { + return a ** b; + } +} diff --git a/resources/regressions/test_num_mutants.json/mutants/5/AOR/AOR.sol b/resources/regressions/test_num_mutants.json/mutants/5/AOR/AOR.sol new file mode 100644 index 0000000..92cbf4d --- /dev/null +++ b/resources/regressions/test_num_mutants.json/mutants/5/AOR/AOR.sol @@ -0,0 +1,61 @@ +// SPDX-License-Identifier: GPL-3.0-only +pragma solidity >0.7.0; +pragma experimental ABIEncoderV2; + +// This contract provides test functions for Arithmetic operator replacement +contract AOR { + // Expect 4 mutants: + // a - b + // a * b + // a / b + // a % b + function plus(int256 a, int256 b) public pure returns (int256) { + return a + b; + } + + // Expect 4 mutants: + // a + b + // a * b + // a / b + // a % b + function minus(int256 a, int256 b) public pure returns (int256) { + return a - b; + } + + // Expect 4 mutants: + // a - b + // a * b + // a / b + // a % b + function times_with_parens( + int256 a, + int256 b + ) public pure returns (int256) { + return ((a)) * b; + } + + // Expect 5 mutants: + // a + b + // a - b + // a / b + // a ** b + // a % b + function unsigned_times_with_parens( + uint256 a, + uint256 b + ) public pure returns (uint256) { + return ((a)) * b; + } + + // Expect 5 mutants: + // a + b + // a - b + // a / b + // a * b + // a % b + + /// ArithmeticOperatorReplacement(`**` |==> `*`) of: `return a ** b;` + function power(uint256 a, uint256 b) public pure returns (uint256) { + return a * b; + } +} diff --git a/resources/regressions/test_seed.json/gambit_results.json b/resources/regressions/test_seed.json/gambit_results.json new file mode 100644 index 0000000..1eddf63 --- /dev/null +++ b/resources/regressions/test_seed.json/gambit_results.json @@ -0,0 +1,122 @@ +[ + { + "col": 18, + "description": "ArithmeticOperatorReplacement", + "diff": "--- original\n+++ mutant\n@@ -9,8 +9,9 @@\n // a * b\n // a / b\n // a % b\n+ /// ArithmeticOperatorReplacement(`+` |==> `*`) of: `return a + b;`\n function plus(int256 a, int256 b) public pure returns (int256) {\n- return a + b;\n+ return a * b;\n }\n \n // Expect 4 mutants:\n", + "id": "1", + "line": 13, + "name": "mutants/1/AOR/AOR.sol", + "op": "AOR", + "orig": "+", + "original": "AOR/AOR.sol", + "repl": "*" + }, + { + "col": 18, + "description": "ArithmeticOperatorReplacement", + "diff": "--- original\n+++ mutant\n@@ -18,8 +18,9 @@\n // a * b\n // a / b\n // a % b\n+ /// ArithmeticOperatorReplacement(`-` |==> `+`) of: `return a - b;`\n function minus(int256 a, int256 b) public pure returns (int256) {\n- return a - b;\n+ return a + b;\n }\n \n // Expect 4 mutants:\n", + "id": "2", + "line": 22, + "name": "mutants/2/AOR/AOR.sol", + "op": "AOR", + "orig": "-", + "original": "AOR/AOR.sol", + "repl": "+" + }, + { + "col": 22, + "description": "ArithmeticOperatorReplacement", + "diff": "--- original\n+++ mutant\n@@ -30,8 +30,9 @@\n function times_with_parens(\n int256 a,\n int256 b\n+ /// ArithmeticOperatorReplacement(`*` |==> `-`) of: `return ((a)) * b;`\n ) public pure returns (int256) {\n- return ((a)) * b;\n+ return ((a)) - b;\n }\n \n // Expect 5 mutants:\n", + "id": "3", + "line": 34, + "name": "mutants/3/AOR/AOR.sol", + "op": "AOR", + "orig": "*", + "original": "AOR/AOR.sol", + "repl": "-" + }, + { + "col": 22, + "description": "ArithmeticOperatorReplacement", + "diff": "--- original\n+++ mutant\n@@ -43,8 +43,9 @@\n function unsigned_times_with_parens(\n uint256 a,\n uint256 b\n+ /// ArithmeticOperatorReplacement(`*` |==> `+`) of: `return ((a)) * b;`\n ) public pure returns (uint256) {\n- return ((a)) * b;\n+ return ((a)) + b;\n }\n \n // Expect 5 mutants:\n", + "id": "4", + "line": 47, + "name": "mutants/4/AOR/AOR.sol", + "op": "AOR", + "orig": "*", + "original": "AOR/AOR.sol", + "repl": "+" + }, + { + "col": 22, + "description": "ArithmeticOperatorReplacement", + "diff": "--- original\n+++ mutant\n@@ -43,8 +43,9 @@\n function unsigned_times_with_parens(\n uint256 a,\n uint256 b\n+ /// ArithmeticOperatorReplacement(`*` |==> `%`) of: `return ((a)) * b;`\n ) public pure returns (uint256) {\n- return ((a)) * b;\n+ return ((a)) % b;\n }\n \n // Expect 5 mutants:\n", + "id": "5", + "line": 47, + "name": "mutants/5/AOR/AOR.sol", + "op": "AOR", + "orig": "*", + "original": "AOR/AOR.sol", + "repl": "%" + }, + { + "col": 18, + "description": "ArithmeticOperatorReplacement", + "diff": "--- original\n+++ mutant\n@@ -9,8 +9,9 @@\n // a * b\n // a / b\n // a % b\n+ /// ArithmeticOperatorReplacement(`+` |==> `%`) of: `return a + b;`\n function plus(int256 a, int256 b) public pure returns (int256) {\n- return a + b;\n+ return a % b;\n }\n \n // Expect 4 mutants:\n", + "id": "6", + "line": 13, + "name": "mutants/6/AOR/AOR.sol", + "op": "AOR", + "orig": "+", + "original": "AOR/AOR.sol", + "repl": "%" + }, + { + "col": 9, + "description": "StatementDeletion", + "diff": "--- original\n+++ mutant\n@@ -18,8 +18,9 @@\n // a * b\n // a / b\n // a % b\n+ /// StatementDeletion(`return a - b` |==> `assert(true)`) of: `return a - b;`\n function minus(int256 a, int256 b) public pure returns (int256) {\n- return a - b;\n+ assert(true);\n }\n \n // Expect 4 mutants:\n", + "id": "7", + "line": 22, + "name": "mutants/7/AOR/AOR.sol", + "op": "STD", + "orig": "return a - b", + "original": "AOR/AOR.sol", + "repl": "assert(true)" + }, + { + "col": 22, + "description": "ArithmeticOperatorReplacement", + "diff": "--- original\n+++ mutant\n@@ -30,8 +30,9 @@\n function times_with_parens(\n int256 a,\n int256 b\n+ /// ArithmeticOperatorReplacement(`*` |==> `%`) of: `return ((a)) * b;`\n ) public pure returns (int256) {\n- return ((a)) * b;\n+ return ((a)) % b;\n }\n \n // Expect 5 mutants:\n", + "id": "8", + "line": 34, + "name": "mutants/8/AOR/AOR.sol", + "op": "AOR", + "orig": "*", + "original": "AOR/AOR.sol", + "repl": "%" + }, + { + "col": 22, + "description": "ArithmeticOperatorReplacement", + "diff": "--- original\n+++ mutant\n@@ -43,8 +43,9 @@\n function unsigned_times_with_parens(\n uint256 a,\n uint256 b\n+ /// ArithmeticOperatorReplacement(`*` |==> `-`) of: `return ((a)) * b;`\n ) public pure returns (uint256) {\n- return ((a)) * b;\n+ return ((a)) - b;\n }\n \n // Expect 5 mutants:\n", + "id": "9", + "line": 47, + "name": "mutants/9/AOR/AOR.sol", + "op": "AOR", + "orig": "*", + "original": "AOR/AOR.sol", + "repl": "-" + }, + { + "col": 18, + "description": "ArithmeticOperatorReplacement", + "diff": "--- original\n+++ mutant\n@@ -54,7 +54,8 @@\n // a * b\n // a % b\n \n+ /// ArithmeticOperatorReplacement(`**` |==> `+`) of: `return a ** b;`\n function power(uint256 a, uint256 b) public pure returns (uint256) {\n- return a ** b;\n+ return a + b;\n }\n }\n", + "id": "10", + "line": 58, + "name": "mutants/10/AOR/AOR.sol", + "op": "AOR", + "orig": "**", + "original": "AOR/AOR.sol", + "repl": "+" + } +] \ No newline at end of file diff --git a/resources/regressions/test_seed.json/mutants.log b/resources/regressions/test_seed.json/mutants.log new file mode 100644 index 0000000..64e2b5f --- /dev/null +++ b/resources/regressions/test_seed.json/mutants.log @@ -0,0 +1,10 @@ +1,AOR,AOR/AOR.sol,13:18,+,* +2,AOR,AOR/AOR.sol,22:18,-,+ +3,AOR,AOR/AOR.sol,34:22,*,- +4,AOR,AOR/AOR.sol,47:22,*,+ +5,AOR,AOR/AOR.sol,47:22,*,% +6,AOR,AOR/AOR.sol,13:18,+,% +7,STD,AOR/AOR.sol,22:9,return a - b,assert(true) +8,AOR,AOR/AOR.sol,34:22,*,% +9,AOR,AOR/AOR.sol,47:22,*,- +10,AOR,AOR/AOR.sol,58:18,**,+ diff --git a/resources/regressions/test_seed.json/mutants/1/AOR/AOR.sol b/resources/regressions/test_seed.json/mutants/1/AOR/AOR.sol new file mode 100644 index 0000000..2e38a56 --- /dev/null +++ b/resources/regressions/test_seed.json/mutants/1/AOR/AOR.sol @@ -0,0 +1,61 @@ +// SPDX-License-Identifier: GPL-3.0-only +pragma solidity >0.7.0; +pragma experimental ABIEncoderV2; + +// This contract provides test functions for Arithmetic operator replacement +contract AOR { + // Expect 4 mutants: + // a - b + // a * b + // a / b + // a % b + /// ArithmeticOperatorReplacement(`+` |==> `*`) of: `return a + b;` + function plus(int256 a, int256 b) public pure returns (int256) { + return a * b; + } + + // Expect 4 mutants: + // a + b + // a * b + // a / b + // a % b + function minus(int256 a, int256 b) public pure returns (int256) { + return a - b; + } + + // Expect 4 mutants: + // a - b + // a * b + // a / b + // a % b + function times_with_parens( + int256 a, + int256 b + ) public pure returns (int256) { + return ((a)) * b; + } + + // Expect 5 mutants: + // a + b + // a - b + // a / b + // a ** b + // a % b + function unsigned_times_with_parens( + uint256 a, + uint256 b + ) public pure returns (uint256) { + return ((a)) * b; + } + + // Expect 5 mutants: + // a + b + // a - b + // a / b + // a * b + // a % b + + function power(uint256 a, uint256 b) public pure returns (uint256) { + return a ** b; + } +} diff --git a/resources/regressions/test_seed.json/mutants/10/AOR/AOR.sol b/resources/regressions/test_seed.json/mutants/10/AOR/AOR.sol new file mode 100644 index 0000000..b577022 --- /dev/null +++ b/resources/regressions/test_seed.json/mutants/10/AOR/AOR.sol @@ -0,0 +1,61 @@ +// SPDX-License-Identifier: GPL-3.0-only +pragma solidity >0.7.0; +pragma experimental ABIEncoderV2; + +// This contract provides test functions for Arithmetic operator replacement +contract AOR { + // Expect 4 mutants: + // a - b + // a * b + // a / b + // a % b + function plus(int256 a, int256 b) public pure returns (int256) { + return a + b; + } + + // Expect 4 mutants: + // a + b + // a * b + // a / b + // a % b + function minus(int256 a, int256 b) public pure returns (int256) { + return a - b; + } + + // Expect 4 mutants: + // a - b + // a * b + // a / b + // a % b + function times_with_parens( + int256 a, + int256 b + ) public pure returns (int256) { + return ((a)) * b; + } + + // Expect 5 mutants: + // a + b + // a - b + // a / b + // a ** b + // a % b + function unsigned_times_with_parens( + uint256 a, + uint256 b + ) public pure returns (uint256) { + return ((a)) * b; + } + + // Expect 5 mutants: + // a + b + // a - b + // a / b + // a * b + // a % b + + /// ArithmeticOperatorReplacement(`**` |==> `+`) of: `return a ** b;` + function power(uint256 a, uint256 b) public pure returns (uint256) { + return a + b; + } +} diff --git a/resources/regressions/test_seed.json/mutants/2/AOR/AOR.sol b/resources/regressions/test_seed.json/mutants/2/AOR/AOR.sol new file mode 100644 index 0000000..60846bd --- /dev/null +++ b/resources/regressions/test_seed.json/mutants/2/AOR/AOR.sol @@ -0,0 +1,61 @@ +// SPDX-License-Identifier: GPL-3.0-only +pragma solidity >0.7.0; +pragma experimental ABIEncoderV2; + +// This contract provides test functions for Arithmetic operator replacement +contract AOR { + // Expect 4 mutants: + // a - b + // a * b + // a / b + // a % b + function plus(int256 a, int256 b) public pure returns (int256) { + return a + b; + } + + // Expect 4 mutants: + // a + b + // a * b + // a / b + // a % b + /// ArithmeticOperatorReplacement(`-` |==> `+`) of: `return a - b;` + function minus(int256 a, int256 b) public pure returns (int256) { + return a + b; + } + + // Expect 4 mutants: + // a - b + // a * b + // a / b + // a % b + function times_with_parens( + int256 a, + int256 b + ) public pure returns (int256) { + return ((a)) * b; + } + + // Expect 5 mutants: + // a + b + // a - b + // a / b + // a ** b + // a % b + function unsigned_times_with_parens( + uint256 a, + uint256 b + ) public pure returns (uint256) { + return ((a)) * b; + } + + // Expect 5 mutants: + // a + b + // a - b + // a / b + // a * b + // a % b + + function power(uint256 a, uint256 b) public pure returns (uint256) { + return a ** b; + } +} diff --git a/resources/regressions/test_seed.json/mutants/3/AOR/AOR.sol b/resources/regressions/test_seed.json/mutants/3/AOR/AOR.sol new file mode 100644 index 0000000..c31b43f --- /dev/null +++ b/resources/regressions/test_seed.json/mutants/3/AOR/AOR.sol @@ -0,0 +1,61 @@ +// SPDX-License-Identifier: GPL-3.0-only +pragma solidity >0.7.0; +pragma experimental ABIEncoderV2; + +// This contract provides test functions for Arithmetic operator replacement +contract AOR { + // Expect 4 mutants: + // a - b + // a * b + // a / b + // a % b + function plus(int256 a, int256 b) public pure returns (int256) { + return a + b; + } + + // Expect 4 mutants: + // a + b + // a * b + // a / b + // a % b + function minus(int256 a, int256 b) public pure returns (int256) { + return a - b; + } + + // Expect 4 mutants: + // a - b + // a * b + // a / b + // a % b + function times_with_parens( + int256 a, + int256 b + /// ArithmeticOperatorReplacement(`*` |==> `-`) of: `return ((a)) * b;` + ) public pure returns (int256) { + return ((a)) - b; + } + + // Expect 5 mutants: + // a + b + // a - b + // a / b + // a ** b + // a % b + function unsigned_times_with_parens( + uint256 a, + uint256 b + ) public pure returns (uint256) { + return ((a)) * b; + } + + // Expect 5 mutants: + // a + b + // a - b + // a / b + // a * b + // a % b + + function power(uint256 a, uint256 b) public pure returns (uint256) { + return a ** b; + } +} diff --git a/resources/regressions/test_seed.json/mutants/4/AOR/AOR.sol b/resources/regressions/test_seed.json/mutants/4/AOR/AOR.sol new file mode 100644 index 0000000..8666cef --- /dev/null +++ b/resources/regressions/test_seed.json/mutants/4/AOR/AOR.sol @@ -0,0 +1,61 @@ +// SPDX-License-Identifier: GPL-3.0-only +pragma solidity >0.7.0; +pragma experimental ABIEncoderV2; + +// This contract provides test functions for Arithmetic operator replacement +contract AOR { + // Expect 4 mutants: + // a - b + // a * b + // a / b + // a % b + function plus(int256 a, int256 b) public pure returns (int256) { + return a + b; + } + + // Expect 4 mutants: + // a + b + // a * b + // a / b + // a % b + function minus(int256 a, int256 b) public pure returns (int256) { + return a - b; + } + + // Expect 4 mutants: + // a - b + // a * b + // a / b + // a % b + function times_with_parens( + int256 a, + int256 b + ) public pure returns (int256) { + return ((a)) * b; + } + + // Expect 5 mutants: + // a + b + // a - b + // a / b + // a ** b + // a % b + function unsigned_times_with_parens( + uint256 a, + uint256 b + /// ArithmeticOperatorReplacement(`*` |==> `+`) of: `return ((a)) * b;` + ) public pure returns (uint256) { + return ((a)) + b; + } + + // Expect 5 mutants: + // a + b + // a - b + // a / b + // a * b + // a % b + + function power(uint256 a, uint256 b) public pure returns (uint256) { + return a ** b; + } +} diff --git a/resources/regressions/test_seed.json/mutants/5/AOR/AOR.sol b/resources/regressions/test_seed.json/mutants/5/AOR/AOR.sol new file mode 100644 index 0000000..67aa6b3 --- /dev/null +++ b/resources/regressions/test_seed.json/mutants/5/AOR/AOR.sol @@ -0,0 +1,61 @@ +// SPDX-License-Identifier: GPL-3.0-only +pragma solidity >0.7.0; +pragma experimental ABIEncoderV2; + +// This contract provides test functions for Arithmetic operator replacement +contract AOR { + // Expect 4 mutants: + // a - b + // a * b + // a / b + // a % b + function plus(int256 a, int256 b) public pure returns (int256) { + return a + b; + } + + // Expect 4 mutants: + // a + b + // a * b + // a / b + // a % b + function minus(int256 a, int256 b) public pure returns (int256) { + return a - b; + } + + // Expect 4 mutants: + // a - b + // a * b + // a / b + // a % b + function times_with_parens( + int256 a, + int256 b + ) public pure returns (int256) { + return ((a)) * b; + } + + // Expect 5 mutants: + // a + b + // a - b + // a / b + // a ** b + // a % b + function unsigned_times_with_parens( + uint256 a, + uint256 b + /// ArithmeticOperatorReplacement(`*` |==> `%`) of: `return ((a)) * b;` + ) public pure returns (uint256) { + return ((a)) % b; + } + + // Expect 5 mutants: + // a + b + // a - b + // a / b + // a * b + // a % b + + function power(uint256 a, uint256 b) public pure returns (uint256) { + return a ** b; + } +} diff --git a/resources/regressions/test_seed.json/mutants/6/AOR/AOR.sol b/resources/regressions/test_seed.json/mutants/6/AOR/AOR.sol new file mode 100644 index 0000000..61a8854 --- /dev/null +++ b/resources/regressions/test_seed.json/mutants/6/AOR/AOR.sol @@ -0,0 +1,61 @@ +// SPDX-License-Identifier: GPL-3.0-only +pragma solidity >0.7.0; +pragma experimental ABIEncoderV2; + +// This contract provides test functions for Arithmetic operator replacement +contract AOR { + // Expect 4 mutants: + // a - b + // a * b + // a / b + // a % b + /// ArithmeticOperatorReplacement(`+` |==> `%`) of: `return a + b;` + function plus(int256 a, int256 b) public pure returns (int256) { + return a % b; + } + + // Expect 4 mutants: + // a + b + // a * b + // a / b + // a % b + function minus(int256 a, int256 b) public pure returns (int256) { + return a - b; + } + + // Expect 4 mutants: + // a - b + // a * b + // a / b + // a % b + function times_with_parens( + int256 a, + int256 b + ) public pure returns (int256) { + return ((a)) * b; + } + + // Expect 5 mutants: + // a + b + // a - b + // a / b + // a ** b + // a % b + function unsigned_times_with_parens( + uint256 a, + uint256 b + ) public pure returns (uint256) { + return ((a)) * b; + } + + // Expect 5 mutants: + // a + b + // a - b + // a / b + // a * b + // a % b + + function power(uint256 a, uint256 b) public pure returns (uint256) { + return a ** b; + } +} diff --git a/resources/regressions/test_seed.json/mutants/7/AOR/AOR.sol b/resources/regressions/test_seed.json/mutants/7/AOR/AOR.sol new file mode 100644 index 0000000..c2a74b7 --- /dev/null +++ b/resources/regressions/test_seed.json/mutants/7/AOR/AOR.sol @@ -0,0 +1,61 @@ +// SPDX-License-Identifier: GPL-3.0-only +pragma solidity >0.7.0; +pragma experimental ABIEncoderV2; + +// This contract provides test functions for Arithmetic operator replacement +contract AOR { + // Expect 4 mutants: + // a - b + // a * b + // a / b + // a % b + function plus(int256 a, int256 b) public pure returns (int256) { + return a + b; + } + + // Expect 4 mutants: + // a + b + // a * b + // a / b + // a % b + /// StatementDeletion(`return a - b` |==> `assert(true)`) of: `return a - b;` + function minus(int256 a, int256 b) public pure returns (int256) { + assert(true); + } + + // Expect 4 mutants: + // a - b + // a * b + // a / b + // a % b + function times_with_parens( + int256 a, + int256 b + ) public pure returns (int256) { + return ((a)) * b; + } + + // Expect 5 mutants: + // a + b + // a - b + // a / b + // a ** b + // a % b + function unsigned_times_with_parens( + uint256 a, + uint256 b + ) public pure returns (uint256) { + return ((a)) * b; + } + + // Expect 5 mutants: + // a + b + // a - b + // a / b + // a * b + // a % b + + function power(uint256 a, uint256 b) public pure returns (uint256) { + return a ** b; + } +} diff --git a/resources/regressions/test_seed.json/mutants/8/AOR/AOR.sol b/resources/regressions/test_seed.json/mutants/8/AOR/AOR.sol new file mode 100644 index 0000000..aa4ecd0 --- /dev/null +++ b/resources/regressions/test_seed.json/mutants/8/AOR/AOR.sol @@ -0,0 +1,61 @@ +// SPDX-License-Identifier: GPL-3.0-only +pragma solidity >0.7.0; +pragma experimental ABIEncoderV2; + +// This contract provides test functions for Arithmetic operator replacement +contract AOR { + // Expect 4 mutants: + // a - b + // a * b + // a / b + // a % b + function plus(int256 a, int256 b) public pure returns (int256) { + return a + b; + } + + // Expect 4 mutants: + // a + b + // a * b + // a / b + // a % b + function minus(int256 a, int256 b) public pure returns (int256) { + return a - b; + } + + // Expect 4 mutants: + // a - b + // a * b + // a / b + // a % b + function times_with_parens( + int256 a, + int256 b + /// ArithmeticOperatorReplacement(`*` |==> `%`) of: `return ((a)) * b;` + ) public pure returns (int256) { + return ((a)) % b; + } + + // Expect 5 mutants: + // a + b + // a - b + // a / b + // a ** b + // a % b + function unsigned_times_with_parens( + uint256 a, + uint256 b + ) public pure returns (uint256) { + return ((a)) * b; + } + + // Expect 5 mutants: + // a + b + // a - b + // a / b + // a * b + // a % b + + function power(uint256 a, uint256 b) public pure returns (uint256) { + return a ** b; + } +} diff --git a/resources/regressions/test_seed.json/mutants/9/AOR/AOR.sol b/resources/regressions/test_seed.json/mutants/9/AOR/AOR.sol new file mode 100644 index 0000000..4d3c74d --- /dev/null +++ b/resources/regressions/test_seed.json/mutants/9/AOR/AOR.sol @@ -0,0 +1,61 @@ +// SPDX-License-Identifier: GPL-3.0-only +pragma solidity >0.7.0; +pragma experimental ABIEncoderV2; + +// This contract provides test functions for Arithmetic operator replacement +contract AOR { + // Expect 4 mutants: + // a - b + // a * b + // a / b + // a % b + function plus(int256 a, int256 b) public pure returns (int256) { + return a + b; + } + + // Expect 4 mutants: + // a + b + // a * b + // a / b + // a % b + function minus(int256 a, int256 b) public pure returns (int256) { + return a - b; + } + + // Expect 4 mutants: + // a - b + // a * b + // a / b + // a % b + function times_with_parens( + int256 a, + int256 b + ) public pure returns (int256) { + return ((a)) * b; + } + + // Expect 5 mutants: + // a + b + // a - b + // a / b + // a ** b + // a % b + function unsigned_times_with_parens( + uint256 a, + uint256 b + /// ArithmeticOperatorReplacement(`*` |==> `-`) of: `return ((a)) * b;` + ) public pure returns (uint256) { + return ((a)) - b; + } + + // Expect 5 mutants: + // a + b + // a - b + // a / b + // a * b + // a % b + + function power(uint256 a, uint256 b) public pure returns (uint256) { + return a ** b; + } +} diff --git a/resources/regressions/uor.json/gambit_results.json b/resources/regressions/uor.json/gambit_results.json new file mode 100644 index 0000000..d26c4ef --- /dev/null +++ b/resources/regressions/uor.json/gambit_results.json @@ -0,0 +1,26 @@ +[ + { + "col": 16, + "description": "UnaryOperatorReplacement", + "diff": "--- original\n+++ mutant\n@@ -10,8 +10,9 @@\n }\n \n // Expect a single mutant: -x\n+ /// UnaryOperatorReplacement(`~` |==> `-`) of: `return ~x;`\n function signed_bw_not(int256 x) public pure returns (int256) {\n- return ~x;\n+ return -x;\n }\n \n // Expect a single mutant: ~x\n", + "id": "1", + "line": 14, + "name": "mutants/1/Ops/UOR/UOR.sol", + "op": "UOR", + "orig": "~", + "original": "Ops/UOR/UOR.sol", + "repl": "-" + }, + { + "col": 16, + "description": "UnaryOperatorReplacement", + "diff": "--- original\n+++ mutant\n@@ -15,7 +15,8 @@\n }\n \n // Expect a single mutant: ~x\n+ /// UnaryOperatorReplacement(`-` |==> `~`) of: `return -x;`\n function signed_neg(int256 x) public pure returns (int256) {\n- return -x;\n+ return ~x;\n }\n }\n", + "id": "2", + "line": 19, + "name": "mutants/2/Ops/UOR/UOR.sol", + "op": "UOR", + "orig": "-", + "original": "Ops/UOR/UOR.sol", + "repl": "~" + } +] \ No newline at end of file diff --git a/resources/regressions/uor.json/mutants.log b/resources/regressions/uor.json/mutants.log new file mode 100644 index 0000000..cf5a132 --- /dev/null +++ b/resources/regressions/uor.json/mutants.log @@ -0,0 +1,2 @@ +1,UOR,Ops/UOR/UOR.sol,14:16,~,- +2,UOR,Ops/UOR/UOR.sol,19:16,-,~ diff --git a/resources/regressions/uor.json/mutants/1/Ops/UOR/UOR.sol b/resources/regressions/uor.json/mutants/1/Ops/UOR/UOR.sol new file mode 100644 index 0000000..50d0957 --- /dev/null +++ b/resources/regressions/uor.json/mutants/1/Ops/UOR/UOR.sol @@ -0,0 +1,22 @@ +// SPDX-License-Identifier: GPL-3.0-only +pragma solidity >0.7.0; +pragma experimental ABIEncoderV2; + +// Unary Operator Replacement +contract UOR { + // Expect no mutants: cannot negate an unsigned integer + function unsigned_bw_not(uint256 x) public pure returns (uint256) { + return ~x; + } + + // Expect a single mutant: -x + /// UnaryOperatorReplacement(`~` |==> `-`) of: `return ~x;` + function signed_bw_not(int256 x) public pure returns (int256) { + return -x; + } + + // Expect a single mutant: ~x + function signed_neg(int256 x) public pure returns (int256) { + return -x; + } +} diff --git a/resources/regressions/uor.json/mutants/2/Ops/UOR/UOR.sol b/resources/regressions/uor.json/mutants/2/Ops/UOR/UOR.sol new file mode 100644 index 0000000..84eae0c --- /dev/null +++ b/resources/regressions/uor.json/mutants/2/Ops/UOR/UOR.sol @@ -0,0 +1,22 @@ +// SPDX-License-Identifier: GPL-3.0-only +pragma solidity >0.7.0; +pragma experimental ABIEncoderV2; + +// Unary Operator Replacement +contract UOR { + // Expect no mutants: cannot negate an unsigned integer + function unsigned_bw_not(uint256 x) public pure returns (uint256) { + return ~x; + } + + // Expect a single mutant: -x + function signed_bw_not(int256 x) public pure returns (int256) { + return ~x; + } + + // Expect a single mutant: ~x + /// UnaryOperatorReplacement(`-` |==> `~`) of: `return -x;` + function signed_neg(int256 x) public pure returns (int256) { + return ~x; + } +} diff --git a/scripts/check_rtd_docs_up_to_date.py b/scripts/check_rtd_docs_up_to_date.py new file mode 100644 index 0000000..1ea5545 --- /dev/null +++ b/scripts/check_rtd_docs_up_to_date.py @@ -0,0 +1,90 @@ +#!/usr/bin/env python3 + +from argparse import ArgumentParser +from urllib.request import urlopen +import difflib +import os +import sys +import re +from generate_rtd_markdown import translate_readme_to_rtd + +OUR_README_PATH = os.path.join(os.path.dirname(__file__), "..", "README.md") + +THEIR_README_URL_NO_BRANCH = ( + "https://raw.githubusercontent.com/Certora/Documentation/{}/docs/gambit/gambit.md" +) + + +def main(): + parser = ArgumentParser() + parser.add_argument( + "--branch", default="master", help="Branch to check README from" + ) + parser.add_argument( + "--no_colors", action="store_true", help="Do not use ansi color on outputs" + ) + args = parser.parse_args() + + exit_code = check_rtd_docs_up_to_date(branch=args.branch, colors=not args.no_colors) + + sys.exit(exit_code) + + +def print_unified_diff(diff, colors=True): + color_fn = {} + if colors: + try: + from ansi.color import fg + + color_fn = {"+": fg.green, "-": fg.red, "@": fg.blue} + except ImportError: + colors = False + + for line in diff: + l: str = line + if colors: + if l.startswith("+++") or l.startswith("---"): + l = fg.yellow(l) + else: + f = color_fn.get(l[0], str) + l = f(l) + print(l, end="") + + +def check_rtd_docs_up_to_date(branch="master", colors=True) -> int: + url = THEIR_README_URL_NO_BRANCH.format(branch) + + with open(OUR_README_PATH) as f: + our_readme_contents = f.read() + + try: + their_readme_contents = urlopen(url).read().decode("utf-8") + + except RuntimeError as e: + print(f"Could not read `gambit.md` from {url}") + print(f"Error: {e}") + return 127 + + print() + our_translated_readme_contents = translate_readme_to_rtd(OUR_README_PATH) + if our_translated_readme_contents == their_readme_contents: + print(f"Docs are in sync!") + return 0 + else: + print(f"Docs are out of sync!") + print() + print("Unified diff: Local vs Remote") + print("=============================") + print() + print_unified_diff( + difflib.unified_diff( + our_translated_readme_contents.splitlines(keepends=True), + their_readme_contents.splitlines(keepends=True), + ), + colors=colors, + ) + return 1 + + +if __name__ == "__main__": + main() diff --git a/scripts/generate_rtd_markdown.py b/scripts/generate_rtd_markdown.py new file mode 100644 index 0000000..8dfae20 --- /dev/null +++ b/scripts/generate_rtd_markdown.py @@ -0,0 +1,207 @@ +#!/usr/bin/env python3 + +""" +Generate RTD version of the Gambit README +""" + +from argparse import ArgumentParser +from typing import Optional +import re + + +def line_is_anchor(line: str) -> bool: + return line.startswith("") + '(test-anchor)=' + >>> get_anchor("# README") + """ + + if not line.startswith("")].strip() + return anchor + + +def is_suppress(line: str) -> bool: + return "" == line.upper().replace(" ", "").strip() + + +def is_end_suppress(line: str) -> bool: + return "" == line.upper().replace(" ", "").strip() + + +def is_emit(line: str) -> bool: + return "" and emit_start > -1: + emit_start = -1 + + # Handle escaped comments from inside of an emit + elif is_escaped_open_comment(line) and emit_start > -1: + lines2.append("") + + elif is_suppress(line): + if suppress_start > 0: + raise RuntimeError( + f"Cannot start a new suppression on line {i+1}: already in a suppression tag started at line {suppress_start+1}" + ) + suppress_start = i + elif is_end_suppress(line): + raise RuntimeError( + f"Illegal end suppress on line {i+1}: not currently in a suppress" + ) + else: + # replace internal links + lines2.append(line.strip("\n")) + combined = "\n".join(lines2) + "\n" + combined = replace_internal_references(combined) + return combined + + +def main(): + parser = ArgumentParser() + parser.add_argument("readme_file", help="README.md file to translate to RTD") + parser.add_argument("--output", "-o", default="gambit.md", help="output file") + + args = parser.parse_args() + rtd = translate_readme_to_rtd(args.readme_file) + with open(args.output, "w+") as f: + print("Writing to", args.output) + f.write(rtd) + + +if __name__ == "__main__": + main() diff --git a/scripts/make_regressions.sh b/scripts/make_regressions.sh index 7f2163f..a79e4b7 100644 --- a/scripts/make_regressions.sh +++ b/scripts/make_regressions.sh @@ -18,42 +18,156 @@ # `resources/regressions/XXXXX`) relative to this script's parent directory. SCRIPTS=$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" &>/dev/null && pwd) +green_check="" +red_x="" +# shellcheck disable=SC1091 +source "$SCRIPTS/util.sh" GAMBIT="$SCRIPTS/.." +GAMBIT_EXECUTABLE="$GAMBIT/target/release/gambit" CONFIGS="$GAMBIT/benchmarks/config-jsons" REGRESSIONS="$GAMBIT"/resources/regressions -echo "scripts: $SCRIPTS" -echo "gambit: $GAMBIT" -echo "configs: $CONFIGS" -echo "regressions: $REGRESSIONS" +TMP_REGRESSIONS="$GAMBIT"/resources/tmp_regressions +EXPECTED_SOLC_VERSION_NUM="8.13" -[ -e "$REGRESSIONS" ] && { - echo "Removing old regressions" - rm -rf "$REGRESSIONS" +if [ -z ${SOLC+x} ]; then + SOLC="solc$EXPECTED_SOLC_VERSION_NUM" +fi + +NUM_CONFIGS=$(ls "$CONFIGS" | wc -l | xargs) + +print_vars() { + echo "scripts: $SCRIPTS" + echo "gambit: $GAMBIT" + echo "configs: $CONFIGS" + echo "regressions: $REGRESSIONS" + echo "temporary regressions: $TMP_REGRESSIONS" +} + +double_check_make_regressions() { + printf "\033[33m[!!!] WARNING!\033[0m You are about to remake all regression tests!!\n" + printf " \033[41;37;1;3mThis will overwrite \`\033[0;41;37;1mresources/regressions\033[0;41;37;1;3m\`!!\033[0m\n" + printf " (\033[1mNote:\033[0m regressions are tracked by Git, so you can recover to a previous state)\n" + while true; do + printf "Do you wish to proceed? [Y/n] " + read -n 1 user_response + echo + + case $user_response in + y | Y) + printf "Continuing with make_regressions.sh...\n" + return 0 + ;; + n | N) + printf "Exiting without continuing\n" + exit 0 + ;; + *) + printf "Unrecognized response: '%s'\n" $user_response + ;; + esac + done +} + +check_solc_version() { + if ! $SOLC --version | grep "0.""$EXPECTED_SOLC_VERSION_NUM" >/dev/null; then + echo "Expected solc version 0.$EXPECTED_SOLC_VERSION_NUM" + exit 1 + fi +} + +build_release() { + old_dir=$(pwd) + cd "$GAMBIT" || exit 1 + cargo build --release + + cd "$old_dir" || exit 1 +} + +clean_state() { + [ -e "$TMP_REGRESSIONS" ] && { + echo "Removing temporary regressions directory $TMP_REGRESSIONS" + rm -rf "$TMP_REGRESSIONS" + } } -echo "Making regressions directory at $REGRESSIONS" -mkdir -p "$REGRESSIONS" -echo "Running conf files" -for conf_path in "$CONFIGS"/*; do - echo - echo - printf "\033[1m- Conf path: %s\033[0m\n" "$conf_path" +setup() { + echo "Making temporary regressions directory at $TMP_REGRESSIONS" + mkdir -p "$TMP_REGRESSIONS" +} + +make_regressions() { + echo "Running on $NUM_CONFIGS configurations" + starting_dir=$(pwd) + failed_confs=() + conf_idx=0 + failed=false + for conf_path in "$CONFIGS"/*; do + conf_idx=$((conf_idx + 1)) + echo + echo + printf "\033[1mConfiguration %s/%s:\033[0m %s\n" "$conf_idx" "$NUM_CONFIGS" "$(basename "$conf_path")" - conf=$(basename "$conf_path") - outdir="$REGRESSIONS"/"$conf" + conf=$(basename "$conf_path") + outdir="$TMP_REGRESSIONS"/"$conf" - ( cd "$GAMBIT" || { echo "Error: couldn't cd $GAMBIT" exit 1 } - printf " \033[1mRunning:\033[0m %s\n" "gambit mutate --json $conf_path" - stdout="$(cargo run -- mutate --json "$conf_path")" - printf " \033[1mGambit Output:\033[0m '\033[3m%s\033[0m'\n" "$stdout" - mv gambit_out "$outdir" - printf " \033[1mMoving Outdir:\033[0m to %s\n" "$outdir" - bash "$SCRIPTS"/remove_sourceroots.sh "$outdir/gambit_results.json" - ) - printf " \033[1mWrote regression:\033[0m %s\n" "$outdir" - -done + printf " %s \033[1mRunning:\033[0m %s\n" "$green_check" "gambit mutate --json $conf_path --solc $SOLC" + stdout="$("$GAMBIT_EXECUTABLE" mutate --json "$conf_path" --solc "$SOLC")" + printf " %s \033[1mGambit Output:\033[0m '\033[3m%s\033[0m'\n" "$green_check" "$stdout" + exit_code=$? + if [ $exit_code -ne 0 ]; then + printf " %s Failed to run config %s\n" "$red_x" "$(basename "$conf_path")" + failed=true + failed_confs+=("$conf_path") + else + printf " %s \033[1mMoving Outdir:\033[0m to %s\n" "$green_check" "$outdir" + mv gambit_out "$outdir" + printf " %s Successfully created regression test case for %s\n" "$green_check" "$(basename "$conf_path")" + fi + cd "$starting_dir" || exit 1 + + done + +} + +summary() { + printf "\n\n\033[1m SUMMARY OF make_regressions.sh\n\n\033[0m" + + if $failed; then + + printf "%s \033[31;1m%s/%s configurations failed to run:\033[0m\n" "$red_x" "${#failed_confs[@]}" "$NUM_CONFIGS" + idx=0 + for conf in "${failed_confs[@]}"; do + idx=$((idx + 1)) + echo " ($idx) $conf" + done + + printf "\n\nRegression tests were not updated\n" + printf "Temporary regression tests were cleaned up" + clean_state + exit 101 + else + printf "%s \033[32;1m All %s configurations ran successfully\033[0m\n" "$green_check" "$NUM_CONFIGS" + [ -e "$REGRESSIONS" ] && { + rm -rf "$REGRESSIONS" + printf "%s Removed old regressions\n" "$green_check" + } + mv "$TMP_REGRESSIONS" "$REGRESSIONS" + printf "%s Moved Temporary regessions to regressions location\n" "$green_check" + printf " %s -> %s\n" "$TMP_REGRESSIONS" "$REGRESSIONS" + printf "%s \033[1;3mRegression tests successfully updated\033[0m\n" "$green_check" + clean_state + fi +} + +double_check_make_regressions +print_vars +check_solc_version +build_release +clean_state +setup +make_regressions +summary diff --git a/scripts/remove_sourceroots.sh b/scripts/remove_sourceroots.sh deleted file mode 100644 index 8f5bde5..0000000 --- a/scripts/remove_sourceroots.sh +++ /dev/null @@ -1,15 +0,0 @@ -#!/usr/bash - -################################################################################ -# remove_sourceroots.sh -# -# remove sourceroot fields from JSON since these are absolute paths - -if [[ "$(uname)" == "Linux" ]]; then - sed -i '/"sourceroot":/d' "$1" -elif [[ "$(uname)" == "Darwin" ]]; then - sed -i "" '/"sourceroot":/d' "$1" -else - echo "Unknown operating system: using the GNU sed interface" - sed -i '/"sourceroot":/d' "$1" -fi diff --git a/scripts/run_regressions.sh b/scripts/run_regressions.sh index a2aa267..8655dac 100644 --- a/scripts/run_regressions.sh +++ b/scripts/run_regressions.sh @@ -19,64 +19,119 @@ # `resources/regressions/XXXXX`) relative to this script's parent directory. SCRIPTS=$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" &>/dev/null && pwd) -GAMBIT="$SCRIPTS/.." +green_check="" +red_x="" +# shellcheck disable=SC1091 +source "$SCRIPTS/util.sh" +GAMBIT="$(cd "$SCRIPTS"/.. && pwd)" +GAMBIT_EXECUTABLE="$GAMBIT/target/release/gambit" CONFIGS="$GAMBIT/benchmarks/config-jsons" REGRESSIONS="$GAMBIT"/resources/regressions -echo "scripts: $SCRIPTS" -echo "gambit: $GAMBIT" -echo "configs: $CONFIGS" -echo "regressions: $REGRESSIONS" +TMP_REGRESSIONS="$GAMBIT"/resources/tmp_regressions +EXPECTED_SOLC_VERSION_NUM="8.13" -[ -e "$REGRESSIONS" ] || { - echo "No regressions exist!" -} +if [ -z ${SOLC+x} ]; then + SOLC="solc$EXPECTED_SOLC_VERSION_NUM" +fi + +NUM_CONFIGS=$(ls "$CONFIGS" | wc -l | xargs) passed=() failed=() -echo "Running tests..." -cd "$GAMBIT" || { - echo "Error: couldn't cd $GAMBIT" - exit 1 + +print_vars() { + echo "scripts: $SCRIPTS" + echo "gambit: $GAMBIT" + echo "configs: $CONFIGS" + echo "regressions: $REGRESSIONS" + echo "temporary regressions: $TMP_REGRESSIONS" +} + +build_release() { + old_dir=$(pwd) + cd "$GAMBIT" || exit 1 + cargo build --release + + cd "$old_dir" || exit 1 } -for conf_path in "$CONFIGS"/*; do - echo - echo - printf "\033[1m- Conf path: %s\033[0m\n" "$conf_path" - - conf=$(basename "$conf_path") - regression_dir="$REGRESSIONS"/"$conf" - - printf " \033[1mRunning:\033[0m %s\n" "gambit mutate --json $conf_path" - stdout="$(cargo run -- mutate --json "$conf_path")" - printf " \033[1mGambit Output:\033[0m '\033[3m%s\033[0m'\n" "$stdout" - printf " \033[1mDiffing\033[0m gambit_out and %s\n" "$regression_dir" - bash "$SCRIPTS"/remove_sourceroots.sh gambit_out/gambit_results.json - if diff -q -r gambit_out "$regression_dir"; then - printf " \033[92mSUCCESS\033[0m\n" - passed+=("$conf") - else - printf " \033[91mFAILED:\033[0m %s\n" "$conf" - failed+=("$conf") + +check_solc_version() { + if ! $SOLC --version | grep "0.""$EXPECTED_SOLC_VERSION_NUM" >/dev/null; then + echo "Expected solc version 0.$EXPECTED_SOLC_VERSION_NUM" + exit 1 fi - rm -rf gambit_out +} + +run_regressions() { + echo "Running regression tests on $NUM_CONFIGS configurations" + + starting_dir=$(pwd) + cd "$GAMBIT" || { + echo "Error: couldn't cd $GAMBIT" + exit 1 + } + + conf_idx=0 -done + for conf_path in "$CONFIGS"/*; do + conf_idx=$((conf_idx + 1)) + echo + echo + printf "\033[1mConfiguration %s/%s:\033[0m %s\n" "$conf_idx" "$NUM_CONFIGS" "$(basename "$conf_path")" -printf "\n\n\033[96mREGRESSION SUMMARY\033[0m\n" -printf "\033[96m==================\033[0m\n\n" + conf=$(basename "$conf_path") + regression_dir="$REGRESSIONS"/"$conf" -printf "\033[92mPassed:\033[0m %s of %s tests\n" ${#passed[@]} $((${#failed[@]} + ${#passed[@]})) -printf "\033[92m-------\033[0m\n" + # Get relative paths for nice printing + rel_conf_path=$(python3 -c "import os.path; print( os.path.relpath('$conf_path', '$(pwd)'))") + rel_regression_dir=$(python3 -c "import os.path; print( os.path.relpath('$regression_dir', '$(pwd)'))") -for conf in "${passed[@]}"; do - printf "\033[92m[+]\033[0m %s\n" "$conf" -done + printf " %s \033[1mRunning:\033[0m %s\n" "$green_check" "$GAMBIT_EXECUTABLE mutate --json $rel_conf_path --solc $SOLC" + stdout="$("$GAMBIT_EXECUTABLE" mutate --json "$conf_path" --solc "$SOLC")" + printf " %s \033[1mGambit Output:\033[0m '\033[3m%s\033[0m'\n" "$green_check" "$stdout" + if diff -q -r gambit_out "$regression_dir" 1>/dev/null; then + printf " %s \033[1mDiffed:\033[0m gambit_out and %s\n" "$green_check" "$rel_regression_dir" + printf " %s No regressions in %s\n" "$green_check" "$conf" + passed+=("$conf") + else + printf " %s \033[1mDiffed:\033[0m gambit_out and %s\n" "$red_x" "$rel_regression_dir" + diff -r gambit_out/mutants "$regression_dir"/mutants + printf " %s Found a regression in \033[3m%s\033[0m\n" "$red_x" "$conf" + failed+=("$conf") + fi + rm -rf gambit_out -printf "\n" + done -printf "\033[91mFailed:\033[0m %s of %s tests\n" ${#failed[@]} $((${#failed[@]} + ${#passed[@]})) -printf "\033[91m-------\033[0m\n" + cd "$starting_dir" || exit 1 + +} + +summary() { + + printf "\n\n\033[96mREGRESSION SUMMARY\033[0m\n" + printf "\033[96m==================\033[0m\n\n" + + printf "\033[92mPassed:\033[0m %s of %s tests\n" ${#passed[@]} $((${#failed[@]} + ${#passed[@]})) + printf "\033[92m-------\033[0m\n" + + for conf in "${passed[@]}"; do + printf "%s %s\n" "$green_check" "$conf" + done + + printf "\n" + + printf "\033[91mFailed:\033[0m %s of %s tests\n" ${#failed[@]} $((${#failed[@]} + ${#passed[@]})) + printf "\033[91m-------\033[0m\n" + + for conf in "${failed[@]}"; do + printf "%s %s\n" "$red_x" "$conf" + done + +} -for conf in "${failed[@]}"; do - printf "\033[91m[-]\033[0m %s\n" "$conf" -done +print_vars +check_solc_version +build_release +run_regressions +summary diff --git a/scripts/util.sh b/scripts/util.sh new file mode 100644 index 0000000..c8d9370 --- /dev/null +++ b/scripts/util.sh @@ -0,0 +1,11 @@ +#!/usr/bin/bash + +# Utilities for regression testing + +green_check="$(printf "[\033[32;1m ✔ \033[0m]")" +yellow_elipses="$(printf "[\033[33;1m...\033[0m]")" +red_x="$(printf "[\033[31;1m ✘ \033[0m]")" + +export green_check +export yellow_elipses +export red_x diff --git a/src/ast.rs b/src/ast.rs deleted file mode 100644 index c995d7e..0000000 --- a/src/ast.rs +++ /dev/null @@ -1,349 +0,0 @@ -use regex::Regex; -use serde::Deserialize; -use serde_json::Value; - -/// This is a thin wrapper around the json AST -/// generated by the solidity compiler. - -#[derive(Debug, Deserialize, Default, Clone)] -pub struct TypeDescriptions { - pub(crate) element: Option, -} - -impl TypeDescriptions { - pub fn new(v: Value) -> Self { - if v.is_null() { - Self { element: None } - } else { - Self { element: Some(v) } - } - } - - pub fn type_string(&self) -> Option { - self.element.as_ref().map(|e| e["typeString"].to_string()) - } -} - -/// Solidity AST representation. -/// -/// There are two fields, `element` which is the underlying json object -/// representing an AST node and `contract` which indicates the name of the -/// contract that this node belongs to. -#[derive(Debug, Deserialize, Default, Clone)] -#[serde(default)] -pub struct SolAST { - pub(crate) element: Option, -} - -impl SolAST { - /// Create a new AST node. - pub fn new(v: Value) -> Self { - if v.is_null() { - Self { element: None } - } else { - Self { element: Some(v) } - } - } - - /// Return the `element` field of a `SolAST` struct. - pub fn get_object(&self) -> Option { - self.element.clone() - } - - /// Return some node of this AST that has the field name `fnm` in the json - /// representation. - pub fn get_node(&self, fnm: &str) -> SolAST { - let node: SolAST = self.get_object().map_or_else( - || SolAST { element: None }, - |v| SolAST { - element: Some(v[fnm].clone()), - }, - ); - node - } - - pub fn is_literal(&self) -> bool { - self.node_type() == Some("Literal".into()) - } - - /// Check if this node has kind `"number"` or if it is a unary operator `"-"` - /// on a kind "number". - /// - /// This function is necessary because solc doesn't parse negative integer - /// literals as literals, but rather as a negative unary operator applied to - /// a literal. For instance, solc parses `-1` as - /// - /// `(unop '-' (number 1))` - pub fn is_literal_number(&self) -> bool { - let k = self.node_kind(); - if Some("number".into()) == k { - true - } else if self.node_type() == Some("UnaryOperator".into()) - && self.operator() == Some("-".into()) - { - let operand = self.get_node("subExpression"); - operand.node_kind() == Some("number".into()) - } else { - false - } - } - - /// A helper that is used in various places to get the value of some - /// field name (`fnm`) in the AST's `element`. - pub fn get_string(&self, fnm: &str) -> Option { - let obj = self.get_object(); - match obj { - Some(o) => { - let v = o[fnm].as_str(); - v.map(|s| s.into()) - } - None => None, - } - } - - /// Returns the `src` field. - pub fn src(&self) -> Option { - self.get_string("src") - } - - /// Returns the `name` field. - pub fn name(&self) -> Option { - self.get_string("name") - } - - /// Returns the `node_type` field. - pub fn node_type(&self) -> Option { - self.get_string("nodeType") - } - - pub fn node_kind(&self) -> Option { - self.get_string("kind") - } - - /// Returns the `expression` field. - pub fn expression(&self) -> SolAST { - self.get_node("expression") - } - - /// Returns the `operator` field. - pub fn operator(&self) -> Option { - self.get_string("operator") - } - - /// Returns the `leftExpression` field. - pub fn left_expression(&self) -> SolAST { - self.get_node("leftExpression") - } - - /// Returns the `rightExpression` field. - pub fn right_expression(&self) -> SolAST { - self.get_node("rightExpression") - } - - /// Returns the `leftHandSide` field. - pub fn left_hand_side(&self) -> SolAST { - self.get_node("leftHandSide") - } - - /// Returns the `rightHandSide` field. - pub fn right_hand_side(&self) -> SolAST { - self.get_node("rightHandSide") - } - - /// Returns the `arguments` representing argument nodes to some function. - pub fn arguments(&self) -> Vec { - let o = self.get_object(); - match o { - None => vec![], - Some(v) => { - let arg = &v["arguments"].as_array(); - match arg { - Some(lst) => lst.iter().map(|e| Self::new(e.clone())).collect(), - None => vec![], - } - } - } - } - - /// Returns `statements` in some block. - pub fn statements(&self) -> Vec { - let o = self.get_object(); - match o { - None => vec![], - Some(v) => { - let arg = &v["statements"].as_array(); - match arg { - Some(lst) => lst.iter().map(|e| Self::new(e.clone())).collect(), - None => vec![], - } - } - } - } - - /// Returns the `condition` field. - pub fn condition(&self) -> SolAST { - self.get_node("condition") - } - - /// Returns the `trueBody` field. - pub fn true_body(&self) -> SolAST { - self.get_node("trueBody") - } - - /// Returns the `falseBody` field. - pub fn false_body(&self) -> SolAST { - self.get_node("falseBody") - } - - /// Returns the `typeDescriptions` field. - pub fn get_type_descs(&self) -> Option { - self.get_object() - .map(|obj| TypeDescriptions::new(obj["typeDescriptions"].clone())) - } - - /// Recursively traverses the AST. - /// - /// This is how Gambit determines what nodes can be mutated using which - /// types of mutations and the exact location in the source where the - /// mutation must be done. - /// - /// # Arguments - /// - /// * `visitor` - see [`run::RunMutations::mk_closures()`] - /// * `skip` - see [`run::RunMutations::mk_closures()`] - /// * `accept` - see [`run::RunMutations::mk_closures()`] - pub fn traverse(self, visitor: &dyn SolASTVisitor, arg: A) -> Vec { - let mut result: Vec = vec![]; - self.traverse_internal(visitor, &arg, &mut result); - result - } - - /// Helper function to traverse AST - /// - /// # Arguments - /// - /// * `visitor` - see [`run::RunMutations::mk_closures()`] - /// * `skip` - see [`run::RunMutations::mk_closures()`] - /// * `accept` - see [`run::RunMutations::mk_closures()`] - /// * `accepted` - is this node the descendent of an accepted node? This - /// value is monotonic as we descend an AST: it begins as false but once - /// set to true will be true for all recursive calls - /// * `acc` - TODO: ? - fn traverse_internal( - &self, - visitor: &dyn SolASTVisitor, - arg: &A, - acc: &mut Vec, - ) { - log::debug!( - "Traversing Node: kind: {:?}, type: {:?}", - self.node_kind(), - self.node_type(), - ); - if visitor.skip_node(self, arg) { - log::debug!(" Skipping"); - return; - } - - if let Some(result) = visitor.visit_node(self, arg) { - log::debug!(" Visit successful"); - acc.push(result); - } else { - log::debug!(" Visit failed") - } - - if self.element.is_none() { - return; - } - - let e = self.element.as_ref().unwrap(); - if e.is_object() { - let e_obj = e.as_object().unwrap(); - - // TODO: We are _cloning_ entire ASTs! This is no bueno! - log::debug!(" Recursively traversing children"); - for v in e_obj.values() { - let child: SolAST = SolAST::new(v.clone()); - child.traverse_internal(visitor, arg, acc); - } - } else if e.is_array() { - let e_arr = e.as_array().unwrap(); - for a in e_arr { - let child: SolAST = SolAST::new(a.clone()); - child.traverse_internal(visitor, arg, acc); - } - } - } - - /// Extracts the bounds from the AST that indicate where in the source - /// a node's text starts and ends. - /// This is represented by the `src` field in the AST about which more - /// information can be found [here](https://docs.soliditylang.org/en/v0.8.17/using-the-compiler.html?highlight=--ast-compact--json#compiler-input-and-output-json-description). - pub fn get_bounds(&self) -> (usize, usize) { - let src = self.src().expect("Source information missing."); - let parts: Vec<&str> = src.split(':').collect(); - let start = parts[0].parse::().unwrap(); - (start, start + parts[1].parse::().unwrap()) - } - - /// Returns the text corresponding to an AST node in the given `source`. - pub fn get_text(&self, source: &[u8]) -> String { - let (start, end) = self.get_bounds(); - let byte_vec = source[start..end].to_vec(); - String::from_utf8(byte_vec).expect("Slice is not u8.") - } - - /// This method is used by a variety of mutations like `FunctionCallMutation`, - /// `RequireMutation`, etc. (see more in `mutation.rs`) to directly - /// mutate the source guided by information gathered from traversing the AST. - pub fn replace_in_source(&self, source: &[u8], new: String) -> String { - let (start, end) = self.get_bounds(); - self.replace_part(source, new, start, end) - } - - /// This method is used to replace part of a statement. - /// Example mutation types that use it are are `BinaryOperatorMutation`, - /// `UnaryOperatorMutation`, and `ElimDelegateMutation`. - pub fn replace_part(&self, source: &[u8], new: String, start: usize, end: usize) -> String { - let before = &source[0..start]; - let changed = new.as_bytes(); - let after = &source[end..source.len()]; - let res = [before, changed, after].concat(); - String::from_utf8(res).expect("Slice is not u8.") - } - - /// This method is used for mutations that comment out - /// some piece of code using block comments. - pub fn comment_out(&self, source: &[u8]) -> String { - let (start, mut end) = self.get_bounds(); - let rest_of_str = String::from_utf8(source[end..source.len()].to_vec()) - .unwrap_or_else(|_| panic!("cannot convert bytes to string.")); - let mtch = Regex::new(r"^\*").unwrap().find(rest_of_str.as_str()); - if let Some(m) = mtch { - end += - rest_of_str[0..m.range().last().unwrap_or_else(|| { - panic!("There was a match but last() still returned None.") - }) + 1] - .as_bytes() - .len(); - } - self.replace_part( - source, - "/*".to_string() + &String::from_utf8(source[start..end].to_vec()).unwrap() + "*/", - start, - end, - ) - } -} - -/// Implement this to traverse an AST -pub trait SolASTVisitor { - /// Performs logic on a given node - fn visit_node(&self, node: &SolAST, arg: &A) -> Option; - - /// Determines if this node should not be recursively visited. If `true`, - /// this will not be visited, nor will its children - fn skip_node(&self, _node: &SolAST, _arg: &A) -> bool { - false - } -} diff --git a/src/cli.rs b/src/cli.rs index b1c95ce..feeb831 100644 --- a/src/cli.rs +++ b/src/cli.rs @@ -6,8 +6,8 @@ static DEFAULT_NO_OVERWRITE: bool = false; static DEFAULT_RANDOM_SEED: bool = false; static DEFAULT_SEED: u64 = 0; static DEFAULT_SKIP_VALIDATE: bool = false; +static DEFAULT_LOG_INVALID: bool = false; static DEFAULT_SOLC_OPTIMIZE: bool = false; -static DEFAULT_SOLC: &str = "solc"; fn default_no_export_mutants() -> bool { DEFAULT_NO_EXPORT_MUTANTS @@ -29,12 +29,16 @@ fn default_skip_validate() -> bool { DEFAULT_SKIP_VALIDATE } +fn default_log_invalid() -> bool { + DEFAULT_LOG_INVALID +} + fn default_solc_optimize() -> bool { DEFAULT_SOLC_OPTIMIZE } -fn default_solc() -> String { - DEFAULT_SOLC.to_string() +fn default_solc() -> Option { + None } fn default_source_root() -> Option { @@ -45,16 +49,25 @@ fn default_num_mutants() -> Option { None } +fn default_include_paths() -> Vec { + vec![] +} + +fn default_import_paths() -> Vec { + vec![] +} + /// Mutate solidity code. /// -/// The `mutate` command requires either a `--filename` or a `--json` -/// configuration file to be passed, and these are mutually exclusive. +/// The `mutate` command requires either a filename or a `--json` configuration +/// file to be passed, and these are mutually exclusive. /// /// # Examples -/// 1. `gambit mutate --filename path/to/file.sol` this will apply all mutations to file.sol. /// -/// 2. `gambit mutate --json path/to/config.json`: this runs mutations specified -/// in the configuration file +/// 1. `gambit mutate path/to/file.sol` will apply all mutations to file.sol. +/// +/// 2. `gambit mutate --json path/to/config.json` runs mutations specified in +/// the configuration file /// /// Only one filename can be specified from command line at a time, but multiple /// files can be specified in a configuration. @@ -66,42 +79,25 @@ pub struct MutateParams { #[arg(long, short, conflicts_with = "filename")] pub json: Option, - /// The name of the file to mutate. Note that this filename must be a - /// descendent of the source root (`.` by default, or specified by the - /// `--sourceroot` flag). - /// - /// # Example - /// - /// Running: - /// - /// `gambit mutate --filename /path/to/file.sol --sourceroot /some/other/path` - /// - /// will cause an error. This is because `/path/to/file.sol` is not - /// (recursively) contained in `/some/other/path`. On the other hand, if - /// our working directory is `/path/to`, running: - /// - /// `gambit mutate --filename /path/to/file.sol` - /// - /// will work because `--sourceroot` is by default `.` which, in this case, - /// expands to `/path/to`, which contains `file.sol`. - #[arg(long, short, conflicts_with = "json")] + /// The name of the file to mutate. + #[arg(conflicts_with = "json")] pub filename: Option, /// If specified, randomly downsamples the number of mutants - #[arg(long, short, default_value = None)] + #[arg(long, short, default_value = None, conflicts_with = "json")] #[serde(default = "default_num_mutants")] pub num_mutants: Option, /// Use a random seed instead of the specified seed. This will override any /// value passed in with the `--seed` flag - #[arg(long, default_value = "false")] + #[arg(long, default_value = "false", conflicts_with = "json")] #[serde(default = "default_random_seed")] pub random_seed: bool, /// Specify a seed for randomized down sampling. By default seed=0 is used /// and is deterministic, but nondeterminism can be enabled with the /// `--random-seed` flag - #[arg(long, short, default_value = "0")] + #[arg(long, short, default_value = "0", conflicts_with = "json")] #[serde(default = "default_seed")] pub seed: u64, @@ -113,14 +109,24 @@ pub struct MutateParams { /// it is the current working directory. All filenames (either specified by /// the --filename flag or as a "filename" field in a JSON configuration /// file) must exist inside the sourceroot directory. - #[arg(long, default_value = None)] + #[arg(long, default_value = None, hide = true, conflicts_with = "json")] #[serde(default = "default_source_root")] pub sourceroot: Option, /// Specify the mutation operators - #[arg(long, num_args(1..))] + #[arg(long, num_args(0..), conflicts_with = "json")] pub mutations: Option>, + /// Specify _fallback mutation operators_. These operators are not applied + /// to a program point unless all other operators fail. Fallback expression + /// mutations are only applied to certain program points. For instance, + /// in the expression `a + b + c`, a fallback expression mutation such as + /// EVR will only be applied to the full expression, and not to any + /// subexpressions, and only if no mutants were generated for `a + b + c` or + /// its subexpressions + #[arg(long, num_args(0..), conflicts_with = "json")] + pub fallback_mutations: Option>, + /// Skip mutant export #[arg(long, default_value_t = DEFAULT_NO_EXPORT_MUTANTS)] #[serde(default = "default_no_export_mutants")] @@ -132,43 +138,66 @@ pub struct MutateParams { pub no_overwrite: bool, /// Solidity binary name, e.g., --solc solc8.10, --solc 7.5, etc. - #[arg(long, default_value = "solc")] + #[arg(long, default_value = None)] #[serde(default = "default_solc")] - pub solc: String, + pub solc: Option, /// Run solc with the `--optimize` flag - #[arg(long, default_value = "false")] + #[arg(long, default_value = "false", conflicts_with = "json")] #[serde(default = "default_solc_optimize")] pub solc_optimize: bool, /// Specify function names to mutate - #[arg(long, num_args(1..))] + #[arg(long, num_args(1..), conflicts_with = "json")] pub functions: Option>, /// Specify a contract to mutate - #[arg(long)] + #[arg(long, conflicts_with = "json")] pub contract: Option, - /// Basepath argument to solc - #[arg(long)] + /// Specify a directory to search for solidity files during import + #[arg(long, num_args(1..), conflicts_with = "json")] + #[serde(default = "default_import_paths")] + pub import_paths: Vec, + + /// Map directory to search for solidity files [format: map=path] + #[arg(long, num_args(1..), conflicts_with = "json")] + #[serde(default = "default_import_paths")] + pub import_maps: Vec, + + /// Deprecated: Basepath argument to solc (`--base-path`) + #[arg(long, hide = true, conflicts_with = "json")] pub solc_base_path: Option, - /// Allowpath argument to solc - #[arg(long)] - pub solc_allow_paths: Option>, + /// Deprecated: Include paths argument to solc (`--include-paths`) + #[arg(long = "solc_include_path", hide = true, conflicts_with = "json")] + #[serde(default = "default_include_paths")] + pub solc_include_paths: Vec, - /// Includepath argument to solc - #[arg(long)] - pub solc_include_path: Option, + /// Allowpath argument to solc used during validation + #[arg(long, conflicts_with = "json")] + pub solc_allow_paths: Option>, /// Solidity remappings - #[arg(long, num_args(1..))] + #[arg(long, hide = true, num_args(1..), conflicts_with = "json")] pub solc_remappings: Option>, - /// Specify this + /// Do not validate mutants by invoking solc #[arg(long, default_value = "false")] #[serde(default = "default_skip_validate")] pub skip_validate: bool, + + /// Log any invalid mutations that are encountered during mutant validation + #[arg(long, default_value = "false")] + #[serde(default = "default_log_invalid")] + pub log_invalid: bool, + + /// Manually specify any solc arguments. These will bypass any other args + /// passed to solc (e.g., --solc_include_paths). This is meant as a backup + /// method in case the normal Gambit CLI does not provide the needed + /// flexibility + #[arg(long, default_value=None, conflicts_with = "json")] + pub solc_raw_args: Option>, } #[derive(Debug, Deserialize, Serialize)] @@ -181,20 +210,32 @@ pub struct GambitConfigFile { pub enum Command { Mutate(Box), // Maybe we want to do other things in the future like support checking mutants? Summary(SummaryParams), + /// Print the current Gambit version number + Version, } -/// Summarize mutants generated by a Gambit run. By default, all mutant ids are -/// summarized. Use the `--mids` flag to specify a list of mids to summarize +/// Summarize mutants generated by a Gambit run. +/// +/// By default, high level statistics are reported. Use the `--mids` flag to +/// summarize a specific list of mutant ids, and use the `--all` flag to +/// summarize all mutant ids. #[derive(Debug, Clone, Parser, Deserialize, Serialize)] #[command(rename_all = "kebab-case")] pub struct SummaryParams { /// Print summaries of the specified mutant IDs (these IDs correspond to the /// "id" field in `gambit_results.json`). Multiple MIDs can be specified. - /// If `--all` is specified, this is ignored. - #[arg(long, default_value = None, num_args(0..))] + #[arg(long, short='M', default_value = None, num_args(0..), conflicts_with = "all_mids")] pub mids: Option>, + /// Print a summary of all MIDs + #[arg(long = "all", short = 'a', conflicts_with = "mids")] + pub print_all_mids: bool, + + /// Print a short version of each mutant + #[arg(long, short = 's')] + pub short: bool, + /// Gambit results directory - #[arg(long, default_value = crate::DEFAULT_GAMBIT_OUTPUT_DIRECTORY)] + #[arg(long, short='D', default_value = crate::DEFAULT_GAMBIT_OUTPUT_DIRECTORY)] pub mutation_directory: String, } diff --git a/src/compile.rs b/src/compile.rs index 88ebb2c..0aab095 100644 --- a/src/compile.rs +++ b/src/compile.rs @@ -1,9 +1,6 @@ -use crate::invoke_command; -use crate::SolAST; -use serde_json::Value; +use crate::{invoke_command, MutateParams}; use std::{ - error, - fs::File, + env, error, path::{Path, PathBuf}, }; @@ -13,12 +10,8 @@ type CompilerRet = (i32, Vec, Vec); /// helper functions. The main object of interest in this module is `Solc`. /// compilation constants -static INPUT_JSON: &str = "input_json"; -static ALLOWPATHS: &str = "--allow-paths"; -static INCLUDEPATH: &str = "--include-path"; -static BASEPATH: &str = "--base-path"; +static ALLOWPATH: &str = "--allow-paths"; static OPTIMIZE: &str = "--optimize"; -static DOT_JSON: &str = ".json"; /// Compilation configurations. This exists across compilations of individual /// files @@ -26,12 +19,20 @@ static DOT_JSON: &str = ".json"; pub struct Solc { /// The solc executable string pub solc: String, + /// The output directory for solc to compile to (-o|--output-dir in solc) output_directory: PathBuf, + /// The root of the virtual filesystem (--base-path in solc) basepath: Option, + /// Make additional source directory availabe to the default import callback (--include-path in solc) + include_paths: Vec, + /// Allow a given path for imports (--allow-paths in solc) allow_paths: Option>, - include_path: Option, + /// Specify remappings (xyz=/path/to/xyz in solc) remappings: Option>, + /// Enable optimization flag (--optimize in solc) optimize: bool, + /// Bypass all other flags and manually specify raw arguments passed to solc + raw_args: Option>, } impl Solc { @@ -40,13 +41,25 @@ impl Solc { solc, output_directory, basepath: None, + include_paths: vec![], allow_paths: None, - include_path: None, remappings: None, optimize: false, + raw_args: None, } } + pub fn with_vfs_roots_from_params(&mut self, params: &MutateParams) -> &Self { + if !params.import_paths.is_empty() { + self.with_basepath(params.import_paths.get(0).unwrap().clone()); + for path in params.import_paths[1..].iter() { + self.with_include_path(path.clone()); + } + } + self.with_remappings(params.import_maps.clone()); + self + } + pub fn output_directory(&self) -> &Path { &self.output_directory } @@ -58,18 +71,32 @@ impl Solc { } } + pub fn with_output_directory(&mut self, output_directory: PathBuf) -> &Self { + self.output_directory = output_directory; + self + } + pub fn with_basepath(&mut self, basepath: String) -> &Self { self.basepath = Some(basepath); self } - pub fn with_allow_paths(&mut self, allow_paths: Vec) -> &Self { - self.allow_paths = Some(allow_paths); + pub fn with_include_path(&mut self, include_path: String) -> &Self { + self.include_paths.push(include_path); self } - pub fn with_include_path(&mut self, include_path: String) -> &Self { - self.include_path = Some(include_path); + pub fn with_import_path(&mut self, import_path: String) -> &Self { + if self.basepath.is_none() { + self.basepath = Some(import_path); + } else { + self.include_paths.push(import_path); + } + self + } + + pub fn with_allow_paths(&mut self, allow_paths: Vec) -> &Self { + self.allow_paths = Some(allow_paths); self } @@ -82,80 +109,18 @@ impl Solc { self.optimize = optimize; self } -} -impl Solc { - /// Compile a solidity file to an AST - /// - /// This method: - /// 1. Creates a new directory in `self.conf.output_directory` to store the - /// compiled AST file - /// 2. Invokes solc with flags derived from `self.conf` - /// 3. Copies the AST file to a JSON file in the same directory - /// 4. Reads the JSON into a SolAST struct and returns it - pub fn compile_ast(&self, solidity_file: &Path) -> Result> { - log::debug!( - "Invoking AST compilation (--stop-after parse) on {}", - solidity_file.display() - ); - let outdir = &self.output_directory; - let mk_dir_result = Self::make_ast_dir(solidity_file, outdir.as_path()); - let (ast_dir, ast_path, json_path) = match mk_dir_result { - Ok(x) => x, - Err(e) => { - log::error!( - "Error: Failed to run make_ast_dir({}, {})\nEncountered error {}", - solidity_file.display(), - outdir.as_path().display(), - e - ); - return Err(e); - } - }; - - match self.invoke_compiler(solidity_file, &ast_dir, false) { - Ok((code, stdout, stderr)) => { - if code != 0 { - log::error!( - "Solidity compiler returned exit code {} on file `{}`", - code, - solidity_file.display() - ); - log::error!("stdout: {}", String::from_utf8(stdout).unwrap()); - log::error!("stderr: {}", String::from_utf8(stderr).unwrap()); - } - } - Err(e) => { - log::error!( - "Failed to compile source with invoke_compiler({}, {}, {}) \nEncountered error {}", - solidity_file.display(), - ast_dir.display(), - true, - e - ); - return Err(e); - } - } - std::fs::copy(&ast_path, &json_path)?; - log::debug!("Wrote AST to {}", &ast_path.display()); - log::debug!("Wrote AST as JSON to {}", &json_path.display()); - - let json_f = File::open(&json_path)?; - let ast_json: Value = serde_json::from_reader(json_f)?; - log::debug!("Deserialized JSON AST from {}", &json_path.display()); - Ok(SolAST { - element: Some(ast_json), - }) + pub fn with_raw_args(&mut self, raw_args: Vec) -> &Self { + self.raw_args = Some(raw_args); + self } +} +impl Solc { /// Invoke the full solidity compiler and return the exit code, stdout, and stderr - pub fn compile( - &self, - solidity_file: &Path, - outdir: &Path, - ) -> Result> { + pub fn compile(&self, solidity_file: &Path) -> Result> { log::debug!("Invoking full compilation on {}", solidity_file.display()); - self.invoke_compiler(solidity_file, outdir, false) + self.invoke_compiler(solidity_file) } /// Perform the actual compilation by invoking a process. This is a wrapper @@ -169,13 +134,8 @@ impl Solc { /// (e.g., when doing an initial compilation of an original unmutated /// solidity file), and getting detailed information on why such a /// compilation failed is important! - fn invoke_compiler( - &self, - solidity_file: &Path, - ast_dir: &Path, - stop_after_parse: bool, - ) -> Result> { - let flags = self.make_compilation_flags(solidity_file, ast_dir, stop_after_parse); + fn invoke_compiler(&self, solidity_file: &Path) -> Result> { + let flags = self.make_compilation_flags(solidity_file); let flags: Vec<&str> = flags.iter().map(|s| s as &str).collect(); let pretty_flags = flags .iter() @@ -184,8 +144,9 @@ impl Solc { .join(" "); log::debug!( - "Invoking solc on {}: `{} {}`", + "Invoking solc on {} from {}: `{} {}`", solidity_file.display(), + env::current_dir()?.display(), self.solc, pretty_flags, ); @@ -220,105 +181,41 @@ impl Solc { } } - /// A helper function to create the directory where the AST (.ast) and it's - /// json representation (.ast.json) are stored. - /// - /// # Arguments - /// - /// * `solidity_file` - Solidity file that is going to be compiled - /// * `output_directory` - The output directory - /// - /// # Returns - /// - /// This returns a 3-tuple: - /// * `ast_dir` - the path to the directory of the solidity AST - /// * `ast_path` - the solidity AST file (contained inside `sol_ast_dir`) - /// * `json_path` - the solidity AST JSON file (contained inside - /// `sol_ast_dir`) - fn make_ast_dir( - solidity_file: &Path, - output_directory: &Path, - ) -> Result<(PathBuf, PathBuf, PathBuf), Box> { - let extension = solidity_file.extension(); - if extension.is_none() || !extension.unwrap().eq("sol") { - panic!("Invalid Extension: {}", solidity_file.display()); - } - - let input_json_dir = output_directory.join(INPUT_JSON); - if input_json_dir.exists() { - log::debug!("{} already exists", input_json_dir.display()); - } else { - log::debug!("{} doesn't exist", input_json_dir.display()); - } - - let filename = PathBuf::from(solidity_file.file_name().unwrap()); - let sol_ast_dir = input_json_dir - .join(filename) - .parent() - .unwrap() - .to_path_buf(); - - std::fs::create_dir_all(&sol_ast_dir)?; - log::debug!("Created AST directory {}", input_json_dir.display()); - - let ast_fnm = Path::new(solidity_file) - .file_name() - .unwrap() - .to_str() - .unwrap() - .to_owned() - + "_json.ast"; - let ast_path = sol_ast_dir.join(&ast_fnm); - let json_path = sol_ast_dir.join(ast_fnm + DOT_JSON); - Ok((sol_ast_dir, ast_path, json_path)) - } - /// Create the compilation flags for compiling `solidity_file` in `ast_dir` - fn make_compilation_flags( - &self, - solidity_file: &Path, - ast_dir: &Path, - stop_after_parse: bool, - ) -> Vec { - let mut flags: Vec = vec![ - "--ast-compact-json".into(), - solidity_file.to_str().unwrap().into(), - "--output-dir".into(), - ast_dir.to_str().unwrap().into(), - "--overwrite".into(), - ]; - if stop_after_parse { - flags.push("--stop-after".into()); - flags.push("parsing".into()); - } - - if let Some(basepath) = &self.basepath { - flags.push(BASEPATH.into()); - flags.push(basepath.clone()); - } + fn make_compilation_flags(&self, solidity_file: &Path) -> Vec { + if let Some(ref flags) = self.raw_args { + flags.clone() + } else { + let mut flags: Vec = vec![ + solidity_file.to_str().unwrap().into(), + "--output-dir".into(), + self.output_directory.to_str().unwrap().into(), + "--overwrite".into(), + ]; + + if let Some(basepath) = &self.basepath { + flags.push("--base-path".into()); + flags.push(basepath.clone()); + } - if let Some(allow_paths) = &self.allow_paths { - flags.push(ALLOWPATHS.into()); - for r in allow_paths { - flags.push(r.clone()); + if let Some(allow_paths) = &self.allow_paths { + flags.push(ALLOWPATH.into()); + for r in allow_paths { + flags.push(r.clone()); + } } - } - if let Some(include_path) = &self.include_path { - flags.push(INCLUDEPATH.into()); - flags.push(include_path.clone()); - } + if let Some(remaps) = &self.remappings { + for r in remaps { + flags.push(r.clone()); + } + } - if let Some(remaps) = &self.remappings { - for r in remaps { - flags.push(r.clone()); + if self.optimize { + flags.push(OPTIMIZE.into()); } - } - if self.optimize { - flags.push(OPTIMIZE.into()); + flags } - - flags } } diff --git a/src/filter.rs b/src/filter.rs index ec91c08..fff2bee 100644 --- a/src/filter.rs +++ b/src/filter.rs @@ -1,20 +1,22 @@ use rand::prelude::*; use rand_chacha::ChaCha8Rng; use std::error; +use tempfile::{tempdir, NamedTempFile}; -use crate::{Mutant, Mutator}; +use crate::{Mutant, MutantWriter, Mutator, Solc}; /// This module downsamples mutants. /// Implement this trait to filter mutants after they have been created. pub trait MutantFilter { /// Filter the mutants of a mutator, validating them via compilation if - /// `self.validate()` returns `true`. + /// `self.validate()` returns `true`. When successful, return an + /// Ok((valid-mutants, invalid-mutants)) fn filter_mutants( - &self, + &mut self, mutator: &Mutator, num_mutants: usize, - ) -> Result, Box>; + ) -> Result<(Vec, Vec), Box>; fn validate(&self) -> bool; } @@ -26,26 +28,33 @@ pub struct RandomDownSampleFilter { /// Should filtered mutants be validated with an external compiler run? This /// is more expensive but disabling this option may produce invalid mutants. validate: bool, + + validator: Validator, } impl RandomDownSampleFilter { - pub fn new(seed: Option, validate: bool) -> Self { - Self { seed, validate } + pub fn new(seed: Option, validate: bool, validator: Validator) -> Self { + Self { + seed, + validate, + validator, + } } } impl MutantFilter for RandomDownSampleFilter { fn filter_mutants( - &self, + &mut self, mutator: &Mutator, num_mutants: usize, - ) -> Result, Box> { + ) -> Result<(Vec, Vec), Box> { // Make a copy that we can mutate - let mutants = mutator.mutants(); - let mut mutants: Vec<(usize, Mutant)> = mutants.iter().cloned().enumerate().collect(); + let mut mutants: Vec<(usize, Mutant)> = + mutator.mutants().iter().cloned().enumerate().collect(); // The sampled mutants. We want to sort by the original index into let mut sampled: Vec<(usize, Mutant)> = vec![]; + let mut invalid: Vec<(usize, Mutant)> = vec![]; let mut r = match self.seed { None => ChaCha8Rng::from_entropy(), @@ -57,8 +66,10 @@ impl MutantFilter for RandomDownSampleFilter { let idx = r.gen_range(0..mutants.len()); let mutant = mutants.remove(idx); if self.validate() { - if let Ok(true) = mutator.validate_mutant(&mutant.1) { + if let Ok(true) = self.validator.validate_mutant(&mutant.1) { sampled.push(mutant) + } else { + invalid.push(mutant) } } else { sampled.push(mutant); @@ -67,10 +78,61 @@ impl MutantFilter for RandomDownSampleFilter { sampled.sort_by(|m1, m2| m1.0.partial_cmp(&m2.0).unwrap()); - Ok(sampled.iter().map(|m| m.1.clone()).collect()) + Ok(( + sampled.iter().map(|m| m.1.clone()).collect(), + invalid.iter().map(|m| m.1.clone()).collect(), + )) } fn validate(&self) -> bool { self.validate } } + +#[derive(Debug)] +/// Responsible for mutant validation logic +pub struct Validator { + pub solc: Solc, +} + +impl Validator { + /// validate a mutant by writing it to disk and compiling it. If compilation + /// fails then this is an invalid mutant. + pub fn validate_mutant(&mut self, mutant: &Mutant) -> Result> { + let source_filename = mutant.path(); + let source_parent_dir = source_filename.parent().unwrap(); + let mutant_file = NamedTempFile::new_in(source_parent_dir)?; + let mutant_file_path = mutant_file.path(); + log::debug!( + "Validating mutant of {}: copying mutated code to {}", + source_filename.display(), + mutant_file_path.display() + ); + let dir = tempdir()?; + MutantWriter::write_mutant_to_file(mutant_file_path, mutant)?; + let was_success = match self + .solc + .with_output_directory(dir.into_path()) + .compile(mutant_file_path) + { + Ok((code, _, _)) => code == 0, + Err(_) => false, + }; + Ok(was_success) + } + + /// Return a tuple of (valid-mutants, invalid-mutants) + pub fn get_valid_mutants(&mut self, mutants: &[Mutant]) -> (Vec, Vec) { + log::info!("Validating mutants..."); + let mut valid_mutants = vec![]; + let mut invalid_mutants: Vec = vec![]; + for m in mutants.iter() { + if let Ok(true) = self.validate_mutant(m) { + valid_mutants.push(m.clone()) + } else { + invalid_mutants.push(m.clone()) + } + } + (valid_mutants, invalid_mutants) + } +} diff --git a/src/lib.rs b/src/lib.rs index 8f38779..d09d7b6 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1,8 +1,5 @@ -mod ast; use std::{collections::HashMap, fs, path::PathBuf, time::Instant}; -pub use ast::*; - mod cli; pub use cli::*; @@ -10,6 +7,7 @@ mod compile; pub use compile::*; mod filter; +use csv::Writer; pub use filter::*; mod mutation; @@ -21,9 +19,6 @@ pub use mutant_writer::*; mod mutator; pub use mutator::*; -mod source; -pub use source::*; - mod summary; pub use summary::*; @@ -33,8 +28,13 @@ pub use test_util::*; mod util; pub use util::*; -/// Execute the `mutate` command. This returns a mapping from output directories +/// Execute the `mutate` command and return a mapping from output directories /// to generated mutants. +/// +/// `gambit mutate` runs on a vector of mutate parameters. Each mutate parameter +/// specifies an output directory. Parameters with the same output directory are +/// grouped and run together, and will have unique mutant ids between them. +/// Mutant ids may be shared between mutants with different output directories. pub fn run_mutate( mutate_params: Vec, ) -> Result>, Box> { @@ -118,8 +118,8 @@ pub fn run_mutate( * ====== */ log::info!("Creating mutator"); let mut mutator = Mutator::from(params); - log::info!("Generating mutants"); - let mutants = mutator.mutate()?.clone(); + let sources = params.filename.iter().cloned().collect::>(); + let mutants = mutator.mutate(sources)?.clone(); log::info!( "(pre filter/validate) Generated {} mutants for {}", &mutants.len(), @@ -130,10 +130,47 @@ pub fn run_mutate( * FILTER/VALIDATE * * =============== */ - // TODO: Separate out Filtering from Validation + // We allow users to filter generated mutants down (currently just + // by --num_mutants, which randomly downsamples to a specified + // number of mutants). + // + // We also allow users to validate the generated mutants by + // compiling them with Solc. + // + // When we are both filtering and validating there is a cyclic + // dependency: + // + // + Filter depends on Validation: we don't want to filter down to 5 + // mutants and have 4 of them be invalid. Therefore, when we + // filter we need to know if a mutant is valid. + // + Validation depends on Filter: We don't want to validate 1000 + // mutants if we are going to filter down to 5 mutants. Validation + // is by far the most expensive part of Gambit, so skipping + // validation for 90% of the generated mutants is desirable. + // Therefore, when we are filtering and validating, we defer + // validation until the filter tries to produce a mutant + + // Set up our Validator, which is just a wrapper around a Solc + // instance. + let mut solc = Solc::new( + params.solc.clone().unwrap_or_else(|| "solc".to_string()), + outdir_path.clone(), + ); + solc.with_vfs_roots_from_params(params); + let mut validator = Validator { solc }; + log::debug!("Validator: {:?}", validator); - // Check if we are filtering - let mutants = if let Some(num_mutants) = params.num_mutants { + // There are three cases we consier: + // 1. We are downsampling due to `--num_mutants` being supplied by + // the user. + // + // 2. `--num_mutants` was not specified, and the user requested that + // we skip validation + // + // 3. `--num_mutants` was not specified and the user did NOT request + // that we skip validation + let (sampled, invalid) = if let Some(num_mutants) = params.num_mutants { + // Case 1: We are downsampling log::info!("Filtering down to {} mutants", num_mutants); log::debug!(" seed: {:?}", params.seed); log::debug!(" validating?: {}", !params.skip_validate); @@ -142,29 +179,66 @@ pub fn run_mutate( } else { Some(params.seed) }; - let filter = RandomDownSampleFilter::new(seed, !params.skip_validate); - let mutants = filter.filter_mutants(&mutator, num_mutants)?; - log::info!("Filtering resulted in {} mutants", mutants.len()); - mutants + let mut filter = + RandomDownSampleFilter::new(seed, !params.skip_validate, validator); + let (sampled, invalid) = filter.filter_mutants(&mutator, num_mutants)?; + if !params.skip_validate { + log::info!( + "Filtering and Validation resulted in {} valid mutants", + sampled.len() + ); + log::info!(" and {} invalid mutants", invalid.len()); + } else { + log::info!("Filtering resulted in {} mutants", sampled.len()); + } + (sampled, invalid) } else if params.skip_validate { + // Case 2: We did not downsample and we are skipping validation log::info!("Skipping validation"); - mutants + (mutants, vec![]) } else { - let mutants = mutator.get_valid_mutants(&mutants); - log::info!("Validation resulted in {} mutants", mutants.len()); - mutants + // Case 3: We did not downsample and we are validating + let (sampled, invalid) = validator.get_valid_mutants(&mutants); + log::info!("Validation resulted in {} valid mutants", sampled.len()); + log::info!(" and {} invalid mutants", invalid.len()); + (sampled, invalid) }; - total_num_mutants += mutants.len(); - log::info!("Adding {} mutants to global mutant pool", mutants.len()); - let mut mutants: Vec<(Mutant, bool)> = - mutants.iter().map(|m| (m.clone(), export)).collect(); + // Note: This probably belongs below w/ other mutant writer stuff, + // but the invalid mutant info goes out of scope at the end of this + // loop. We would want to preserve this by storing it in a map from + // output directories to invalid mutants. Then, when we iterate + // through outdirectories for mutant writing we could access the + // corresponding invalid mutants + if params.log_invalid { + let invalid_log = &outdir_path.join("invalid.log"); + let mut w = Writer::from_path(invalid_log)?; + for (i, mutant) in invalid.iter().enumerate() { + let (line_no, col_no) = mutant.get_line_column(); + let mid = i + 1; + let line_col = format!("{}:{}", line_no, col_no); + w.write_record([ + mid.to_string().as_str(), + mutant.op.short_name().as_str(), + mutant.vfs_path().to_str().unwrap(), + line_col.as_str(), + mutant.orig.as_str(), + mutant.repl.as_str(), + ])?; + } + } + + total_num_mutants += sampled.len(); + log::info!("Adding {} mutants to global mutant pool", sampled.len()); + + let mut sampled: Vec<(Mutant, bool)> = + sampled.iter().map(|m| (m.clone(), export)).collect(); if !mutants_by_out_dir.contains_key(outdir) { mutants_by_out_dir.insert(outdir.clone(), vec![]); } let ms: &mut Vec<(Mutant, bool)> = mutants_by_out_dir.get_mut(outdir).unwrap(); - ms.append(&mut mutants); + ms.append(&mut sampled); } } @@ -196,3 +270,7 @@ pub fn run_summary(params: SummaryParams) -> Result<(), Box Result<(), Box> { let _ = env_logger::builder().try_init(); match Command::parse() { - Command::Mutate(mut params) => { - // The user has specified a configuration file. - // - // Configuration files have two forms: (1) a JSON array of JSON - // objects, where each object represents a `MutateParams` struct, - // and (2) a single JSON object representing a `MutateParams` - // struct. The second case is syntactic sugar for an array with a - // single object. - // - // To tell the difference we deserialzie as a `serde_json::Value` - // and check if it's an array or an object and create a - // `Vec` based on this. - if let Some(json_path) = ¶ms.json { - log::info!("Running from configuration"); - // Run from config file - let json_contents = std::fs::read_to_string(json_path)?; - let json: serde_json::Value = serde_json::from_reader(json_contents.as_bytes())?; - log::info!("Read configuration json: {:#?}", json); - - let mut mutate_params: Vec = if json.is_array() { - match serde_json::from_str(&json_contents) { - Ok(xs) => xs, - Err(msg) => { - println!("{}", &msg); - std::process::exit(1); - } - } - } else if json.is_object() { - let single_param: MutateParams = match serde_json::from_str(&json_contents) { - Ok(xs) => xs, - Err(msg) => { - println!("{}", &msg); - std::process::exit(1); - } - }; - vec![single_param] - } else { - panic!("Invalid configuration file: must be an array or an object") - }; - log::debug!("Deserialized JSON into MutateParams: {:#?}", &mutate_params); - - // # Path Resolutions in Configuration Files - // - // All paths specified _in a configuration file_ are relative to - // the parent directory of the configuration file. This means - // that they will always resolve to the same canonical path, - // regardless of which directory Gambit is called from. - // - // ## Source Root Resolution - // - // The _source root_ describes where the conceptual root of the - // file source tree is. This is used for outputting relative - // paths when Gambit reports on a mutation run and exports - // mutants to disk. - // - // If a "sourceroot" field is provided in the configration file, - // Gambit resolves it according to the following rules: - // - // 1. A **relative** source root path is resolved with respect to - // the parent directory of the configuration file and - // canonicalized. - // - // 2. An **absolute** source root path resolves to itself - // - // If no source root is provided in the configuration file, - // Gambit uses the current working directory as the source root. - // - // ## Filename Resolution - // - // After Source Root Resolution is performed, Gambit performs - // Filename Resolution. First, Gambit resolves each filename - // according to the following rules: - // - // 1. A **relative** filename is resolved with respect to the - // parent directory of the configuration file. - // - // 2. An **absolute** filename resolves to itself - // - // After Filename Resolution, Gambit ensures that each - // parameter's `filename` value is prefixed by (or belongs to) - // it's source root. - // - // NOTE: not all files need to belong to `sourceroot`! Only the - // `param.filename`, since this is written to logs. In - // particular, compiler arguments (e.g., specified by the - // `--solc-allowpaths` flag) will not be checked for inclusion - // in `sourceroot`. - let config_pb = PathBuf::from(&json_path); - log::info!("config: {}", config_pb.display()); - let config_pb = config_pb.canonicalize()?; - log::info!("canonical config: {}", config_pb.display()); - let config_parent_pb = config_pb.parent().unwrap(); - log::info!("config parent: {}", config_parent_pb.display()); - let json_parent_directory = config_parent_pb.canonicalize()?; - - log::info!("Performing Path Resolution for Configurations"); - log::info!("Found {} configurations", mutate_params.len()); - - for (i, params) in mutate_params.iter_mut().enumerate() { - // Source Root Resolution - log::info!("Configuration {}", i + 1); - log::info!(" Performing Source Root Resolution"); - let source_root_path: PathBuf = match params.sourceroot.clone() { - Some(sr) => { - let raw_source_root_path = PathBuf::from(&sr); - let resolved_source_root_path = if raw_source_root_path.is_absolute() { - raw_source_root_path.canonicalize()? - } else { - json_parent_directory - .join(raw_source_root_path) - .canonicalize()? - }; - log::info!( - " [->] Resolved sourceroot `{}` to `{}`", - &sr, - resolved_source_root_path.display() - ); - resolved_source_root_path - } - None => { - let resolved_source_root_path = PathBuf::from(".").canonicalize()?; - log::info!(" No sourceroot provided in configration"); - log::info!( - " [->] Resolved sourceroot to current working directory `{}`", - resolved_source_root_path.display() - ); - resolved_source_root_path - } - }; - let source_root_string = source_root_path.to_str().unwrap().to_string(); - - // Filename Resolution - // - // We need to check for the following filenames to resolve - // with respect to the config file's parent directory: - // - // | Parameter | Resolve WRT Conf? | Sourceroot Inclusion? | - // | ----------------- | ----------------- | --------------------- | - // | filename | Yes | Yes | - // | outdir | If not None | No | - // | solc_allow_paths | Yes | No | - // | solc_include_path | Yes | No | - // | solc_base_path | Yes | No | - // | solc_remappings | Yes | No | - log::info!(" Performing Filename Resolution"); - - // PARAM: Filename - log::info!(" [.] Resolving params.filename"); - let filename_path: PathBuf = match params.filename.clone() { - Some(filename) => { - resolve_config_file_path(&filename, &json_parent_directory)? - } - None => { - log::error!("[!!] Found a configuration without a filename!"); - log::error!("[!!] Parameters: {:#?}", params); - log::error!("[!!] Exiting."); - // TODO: Replace exit with an error - std::process::exit(1); - } - }; - let filename_string = filename_path.to_str().unwrap().to_string(); - - // Check that filename is a member of sourceroot - if !filename_path.starts_with(&source_root_path) { - log::error!( "[!!] Illegal Configuration: Resolved filename `{}` is not prefixed by the derived sourceroot {}", - &filename_string, - &source_root_string, - ); - log::error!("[!!] Parameters:\n{:#?}", params); - log::error!("[!!] Exiting."); - // TODO: Replace exit with an error - std::process::exit(1); - } - log::info!( - " [->] Resolved filename `{}` belongs to sourceroot `{}`", - &filename_string, - &source_root_string - ); - - // PARAM: Outdir - // We can't use `resolve_config_file_path` because it might - // not exist yet, so we can't canonicalize - - log::info!(" [.] Resolving params.outdir"); - let outdir_path = match ¶ms.outdir { - Some(outdir) => { - let outdir_path = PathBuf::from(outdir); - if outdir_path.is_absolute() { - normalize_path(&outdir_path) - } else { - normalize_path(&json_parent_directory.join(&outdir_path)) - } - } - None => normalize_path( - &PathBuf::from(".").join(default_gambit_output_directory()), - ), - }; - let outdir = outdir_path.to_str().unwrap().to_string(); - log::info!( - " [->] Resolved path `{}` to `{}`", - ¶ms - .outdir - .clone() - .unwrap_or(default_gambit_output_directory()), - &outdir, - ); - - // PARAM: solc_allow_paths - log::info!(" [.] Resolving params.allow_paths"); - let allow_paths = if let Some(allow_paths) = ¶ms.solc_allow_paths { - Some(resolve_config_file_paths( - allow_paths, - &json_parent_directory, - )?) - } else { - None - }; - - // PARAM: solc_include_path - log::info!(" [.] Resolving params.include_path"); - let include_path = if let Some(include_path) = ¶ms.solc_include_path { - Some(resolve_config_file_path( - include_path, - &json_parent_directory, - )?) - .map(|ip| ip.to_str().unwrap().to_string()) - } else { - None - }; - - // PARAM: solc_base_path - log::info!(" [.] Resolving params.solc_basepath"); - let basepath = if let Some(basepaths) = ¶ms.solc_base_path { - Some(resolve_config_file_path(basepaths, &json_parent_directory)?) - .map(|bp| bp.to_str().unwrap().to_string()) - } else { - None - }; - - // PARAM: solc_remappings - log::info!(" [.] Resolving params.solc_remapping"); - let remapping: Option> = - params.solc_remappings.as_ref().map(|remapping| { - remapping - .iter() - .map(|rm| { - repair_remapping( - rm.as_str(), - Some(json_parent_directory.to_str().unwrap()), - ) - }) - .collect() - }); - - // Finally, update params with resolved source root and filename. - // (We don't update earlier to preserve the state of params - // for error reporting: reporting the parsed in value of - // `params` will be more helpful to the end user than - // reporting the modified value of params). - params.sourceroot = Some(source_root_string.clone()); - params.filename = Some(filename_string.clone()); - params.outdir = Some(outdir); - params.solc_allow_paths = allow_paths; - params.solc_include_path = include_path; - params.solc_base_path = basepath; - params.solc_remappings = remapping; - } - run_mutate(mutate_params)?; + Command::Mutate(params) => { + if params.json.is_some() { + run_mutate_on_json(params)?; } else { - log::debug!("Running CLI MutateParams: {:#?}", ¶ms); - // # Path Resolution for CLI Provided Parameters - // - // All relative paths specified _from the CLI_ are relative to - // the current working directory. This means that relative paths - // will resolve to different canonical paths depending on where - // they are called from. - // - // ## Source Root Resolution - // - // The _source root_ describes where the conceptual root of the - // file source tree is. This is used for outputting relative - // paths when Gambit reports on a mutation run and exports - // mutants to disk. - // - // If the `--sourceroot` parameter is provided by the user, - // Gambit resolves it according to the following rules: - // - // 1. A **relative** source root path is resolved with respect to - // the current working directory - // - // 2. An **absolute** source root path resolves to itself - // - // If no source root is provided, Gambit uses the current - // working directory as the source root. - // - // ## Filename Resolution - // - // After Source Root Resolution is performed, Gambit performs - // Filename Resolution. First, Gambit resolves each filename - // according to the following rules: - // - // 1. A **relative** filename is resolved with respect to the - // current working directory. - // - // 2. An **absolute** filename resolves to itself - // - // If no filename is provided, Gambit reports an error and - // exits. - // - // After Filename Resolution, Gambit ensures that each - // parameter's filename is prefixed by (or belongs to) it's - // source root. If not, Gambit reports an error and exits. - - // Source Root Resolution - log::info!("Performing Path Resolution for CLI"); - log::info!(" Performing Source Root Resolution"); - let source_root_path: PathBuf = match params.sourceroot.clone() { - Some(sr) => { - let raw_source_root_path = PathBuf::from(&sr); - let resolved_source_root_path = raw_source_root_path.canonicalize()?; - log::info!( - " [->] Resolved sourceroot `{}` to `{}`", - &sr, - resolved_source_root_path.display() - ); - resolved_source_root_path - } - None => { - let resolved_source_root_path = PathBuf::from(".").canonicalize()?; - log::info!(" No sourceroot provided in configration"); - log::info!( - " [->] Resolved sourceroot to current working directory `{}`", - resolved_source_root_path.display() - ); - resolved_source_root_path - } - }; - let source_root_string = source_root_path.to_str().unwrap().to_string(); - - // Filename Resolution - // - // We need to canonicalize the following files, possibly - // checking for sourceroot inclusion. - // - // | Parameter | Sourceroot Inclusion? | - // | ----------------- | --------------------- | - // | filename | Yes | - // | outdir | No | - // | solc_allow_paths | No | - // | solc_include_path | No | - // | solc_base_path | No | - // | solc_remappings | No | - log::info!(" Performing Filename Resolution"); - - log::info!(" [.] Resolving params.filename"); - let filename_path: PathBuf = match params.filename.clone() { - Some(filename) => { - let raw_filename_path = PathBuf::from(&filename); - let resolved_filename_path = raw_filename_path.canonicalize()?; - log::info!( - " [->] Resolved filename `{}` to `{}`", - &filename, - resolved_filename_path.display() - ); - resolved_filename_path - } - None => { - log::error!("[!!] Found a configuration without a filename!"); - log::error!("[!!] Parameters: {:#?}", params); - log::error!("[!!] Exiting."); - // TODO: Replace exit with an error - std::process::exit(1); - } - }; - let filename_string = filename_path.to_str().unwrap().to_string(); - - // Check that filename is a member of sourceroot - if !filename_path.starts_with(&source_root_path) { - log::error!( "[!!] Illegal Configuration: Resolved filename `{}` is not prefixed by the derived sourceroot {}", - &filename_string, - &source_root_string, - ); - log::error!("[!!] Parameters:\n{:#?}", params); - log::error!("[!!] Exiting."); - // TODO: Replace exit with an error - std::process::exit(1); - } - log::info!( - " [->] Resolved filename `{}` belongs to sourceroot `{}`", - &filename_string, - &source_root_string - ); - - log::info!(" [.] Resolving params.outdir {:?}", ¶ms.outdir); - let outdir = normalize_path(&PathBuf::from( - ¶ms.outdir.unwrap_or(default_gambit_output_directory()), - )) - .to_str() - .unwrap() - .to_string(); - - log::info!(" [.] Resolving params.solc_allow_paths"); - let solc_allowpaths = params.solc_allow_paths.map(|aps| { - aps.iter() - .map(|p| { - PathBuf::from(p) - .canonicalize() - .unwrap() - .to_str() - .unwrap() - .to_string() - }) - .collect() - }); - - log::info!(" [.] Resolving params.solc_include_path"); - let solc_include_path = params.solc_include_path.map(|ip| { - PathBuf::from(ip) - .canonicalize() - .unwrap() - .to_str() - .unwrap() - .to_string() - }); - - log::info!(" [.] Resolving params.solc_base_path"); - let solc_basepath = params.solc_base_path.map(|bp| { - PathBuf::from(bp) - .canonicalize() - .unwrap() - .to_str() - .unwrap() - .to_string() - }); - - log::info!(" [.] Resolving params.solc_remapping"); - let solc_remapping = params.solc_remappings.as_ref().map(|rms| { - rms.iter() - .map(|rm| repair_remapping(rm.as_str(), None)) - .collect() - }); - log::info!( - " [->] Resolved solc_remapping:\n {:#?} to \n {:#?}", - ¶ms.solc_remappings, - &solc_remapping - ); - - // Finally, update params with resolved source root and filename. - // (We don't update earlier to preserve the state of params - // for error reporting: reporting the parsed in value of - // `params` will be more helpful to the end user than - // reporting the modified value of params). - params.sourceroot = Some(source_root_string); - params.filename = Some(filename_string); - params.outdir = Some(outdir); - params.solc_allow_paths = solc_allowpaths; - params.solc_include_path = solc_include_path; - params.solc_base_path = solc_basepath; - params.solc_remappings = solc_remapping; - - run_mutate(vec![*params])?; + run_mutate_on_filename(params)?; } } Command::Summary(params) => { run_summary(params)?; } + Command::Version => { + print_version(); + } } Ok(()) } /// Resolve a filename with respect to the directory containing the config file +/// and canonicalize fn resolve_config_file_path( path: &String, json_parent_directory: &Path, @@ -491,7 +39,7 @@ fn resolve_config_file_path( } else { json_parent_directory.join(&path).canonicalize()? }; - log::info!( + log::debug!( " [->] Resolved path `{}` to `{}`", path.display(), result.display() @@ -514,3 +62,477 @@ fn resolve_config_file_paths( } Ok(result) } + +fn print_experimental_feature_warnings(params: &MutateParams) { + // First, check for fallback mutations + if params.fallback_mutations.is_some() { + print_experimental_feature_warning("fallback_mutations", "1.0.0"); + } + + let experimental_mutation_operators = [("evr", "1.0.0")] + .iter() + .map(|item| (normalize_mutation_operator_name(item.0), item.1)) + .collect::>(); + + // Collect all mutation operators + let all_mutations = match (¶ms.mutations, ¶ms.fallback_mutations) { + (Some(mutations), None) => mutations.clone(), + (None, Some(fallback_mutations)) => fallback_mutations.clone(), + (Some(r1), Some(r2)) => r1.iter().chain(r2).cloned().collect(), + _ => vec![], + } + .iter() + .map(|name| normalize_mutation_operator_name(name)) + .collect::>(); + + for (mutation, version) in experimental_mutation_operators + .iter() + .filter(|(experimental_op, _)| all_mutations.contains(experimental_op)) + { + print_experimental_feature_warning( + format!("{}:{}", "MutationType", mutation).as_str(), + version, + ) + } +} + +fn print_deprecation_warnings(params: &MutateParams, is_cli: bool) { + // We want to format parameter names differently depending on if this + // parameter was from a CLI invocation or a configuration file + let format_param = |p: &str| { + if is_cli { + format!("--{}", p) + } else { + p.to_string() + } + }; + if params.sourceroot.is_some() { + print_deprecation_warning( + format_param("sourceroot").as_str(), + "1.0.0", + "sourceroot is no longer used and will be ignored", + ); + } + + if params.solc_base_path.is_some() { + print_deprecation_warning( + format_param("solc_base_path").as_str(), + "1.0.0", + "Use import_path instead", + ); + } + + if !params.solc_include_paths.is_empty() { + print_deprecation_warning( + format_param("solc_include_path").as_str(), + "1.0.0", + "Use import_path instead", + ); + } + + if params.solc_remappings.is_some() { + print_deprecation_warning( + format_param("solc_remapping").as_str(), + "1.0.0", + "Use import_path instead", + ); + } +} + +fn run_mutate_on_json(params: Box) -> Result<(), Box> { + // The user has specified a configuration file. + // + // Configuration files have two forms: (1) a JSON array of JSON + // objects, where each object represents a `MutateParams` struct, + // and (2) a single JSON object representing a `MutateParams` + // struct. The second case is syntactic sugar for an array with a + // single object. + // + // To tell the difference we deserialize as a `serde_json::Value` + // and check if it's an array or an object and create a + // `Vec` based on this. + let json_path = ¶ms.json.ok_or("No JSON Path")?; + log::info!("Running from configuration"); + // Run from config file + let json_contents = match std::fs::read_to_string(json_path) { + Ok(contents) => contents, + Err(e) => { + gambit::print_file_not_found_error(json_path); + Err(e)? + } + }; + let json: serde_json::Value = serde_json::from_reader(json_contents.as_bytes())?; + log::info!("Read configuration json: {:#?}", json); + + let mut mutate_params: Vec = if json.is_array() { + serde_json::from_str(&json_contents)? + } else if json.is_object() { + vec![serde_json::from_str(&json_contents)?] + } else { + gambit::print_invalid_conf_error( + "must be an array or an object", + "All Gambit configurations must be a valid JSON array or JSON object", + ); + std::process::exit(1); + }; + log::debug!("Deserialized JSON into MutateParams: {:#?}", &mutate_params); + + let config_pb = PathBuf::from(&json_path); + let config_pb = config_pb.canonicalize()?; + let config_parent_pb = config_pb.parent().unwrap(); + let json_parent_directory = config_parent_pb.canonicalize()?; + + log::info!("config: {:?}", config_pb); + log::info!("canonical config: {:?}", config_pb); + log::info!("config parent: {}", config_parent_pb.display()); + + log::info!("Performing Path Resolution for Configurations"); + log::info!("Found {} configurations", mutate_params.len()); + + // Pass-through args + let pass_through_outdir = if let Some(outdir) = params.outdir { + Some(PathBuf::from(".").canonicalize()?.join(outdir)) + } else { + None + } + .map(|pb| pb.to_str().unwrap().to_string()); + + for (i, p) in mutate_params.iter_mut().enumerate() { + // Add pass-through args from CLI to each mutate param we deserialized from the config file + + if params.log_invalid { + p.log_invalid = true; + } + if params.no_export { + p.no_export = true; + } + if params.skip_validate { + p.skip_validate = true; + } + if params.no_overwrite { + p.no_overwrite = true; + } + if params.solc.is_some() { + p.solc = params.solc.clone(); + } + if pass_through_outdir.is_some() { + p.outdir = pass_through_outdir.clone(); + } + + log::info!("Configuration {}", i + 1); + + print_deprecation_warnings(p, false); + print_experimental_feature_warnings(p); + + // PARAM: Filename + log::info!(" [.] Resolving params.filename"); + let filename = match p.filename { + Some(ref f) => f.clone(), + None => { + gambit::print_invalid_conf_missing_field_error("filename"); + std::process::exit(1); + } + }; + let filepath = PathBuf::from(&filename); + let filepath = if filepath.is_absolute() { + filepath + } else { + let joined = config_parent_pb.join(filepath); + match joined.canonicalize() { + Ok(p) => p, + Err(_) => { + gambit::print_file_not_found_error(joined.to_str().unwrap()); + std::process::exit(1) + } + } + }; + + // PARAM: Outdir + // + If an absolute `outdir` is specified, normalize it + // + If a relative (non-absolute) `outdir` is specified, + // normalize it with respect to the JSON parent directory + // + If no `outdir` is specified, use `$CWD/gambit_out` + // + // Note: we cannot use `resolve_config_file_path` because + // `outdir` might not exist yet + + log::debug!(" [.] Resolving params.outdir"); + let outdir_path = match &p.outdir { + Some(outdir) => { + let outdir_path = PathBuf::from(outdir); + if outdir_path.is_absolute() { + normalize_path(&outdir_path) + } else { + normalize_path(&json_parent_directory.join(&outdir_path)) + } + } + None => normalize_path(&PathBuf::from(".").join(default_gambit_output_directory())), + }; + let outdir = outdir_path.to_str().unwrap().to_string(); + log::debug!( + " [->] Resolved path `{:?}` to `{}`", + &p.outdir.clone(), + &outdir, + ); + + // PARAM: solc_allowpaths + log::debug!(" [.] Resolving params.solc_allow_paths"); + let allow_paths = if let Some(allow_paths) = &p.solc_allow_paths { + Some(resolve_config_file_paths( + allow_paths, + &json_parent_directory, + )?) + } else { + None + }; + + log::debug!( + " [.] Resolving params.import_paths: {:?}", + p.solc_base_path + ); + + let mut import_paths = p + .import_paths + .iter() + .map( + |ip| match resolve_config_file_path(ip, &json_parent_directory) { + Ok(p) => p.to_str().unwrap().to_string(), + Err(_) => { + gambit::print_file_not_found_error( + json_parent_directory.join(ip).to_str().unwrap(), + ); + std::process::exit(1); + } + }, + ) + .collect::>(); + + log::debug!( + " [.] Resolving params.solc_base_path: {:?}", + p.solc_base_path + ); + if let Some(ref base_path) = p.solc_base_path { + let base_path = match resolve_config_file_path(base_path, &json_parent_directory) { + Ok(p) => p.to_str().unwrap().to_string(), + Err(_) => { + gambit::print_file_not_found_error( + json_parent_directory.join(base_path).to_str().unwrap(), + ); + std::process::exit(1); + } + }; + + if !import_paths.contains(&base_path) { + import_paths.push(base_path); + } + p.solc_base_path = None; + } + + if !p.solc_include_paths.is_empty() { + for include_path in p.solc_include_paths.iter() { + let include_path = + match resolve_config_file_path(include_path, &json_parent_directory) { + Ok(p) => p.to_str().unwrap().to_string(), + Err(_) => { + gambit::print_file_not_found_error( + json_parent_directory.join(include_path).to_str().unwrap(), + ); + std::process::exit(1); + } + }; + + if !import_paths.contains(&include_path) { + import_paths.push(include_path); + } + } + p.solc_include_paths = vec![]; + } + + log::debug!(" [->] Resolved params.import_paths: {:?}", import_paths); + + let mut import_maps = vec![]; + for import_map in p.import_maps.iter() { + import_maps.push(import_map.clone()); + } + log::debug!(" [.] Resolving params.solc_remapping"); + if let Some(ref remappings) = p.solc_remappings { + for remapping in remappings.iter() { + import_maps.push(remapping.clone()); + } + p.solc_remappings = None; + } + + if import_paths.is_empty() { + let default_import_path = json_parent_directory.to_str().unwrap().to_string(); + print_warning( + "No `import_paths` specified in config", + format!("Adding default import path {}.\nTo fix, add\n \"import_paths\": [\"SOME_IMPORT_PATH\"],\nto {}", default_import_path, default_import_path).as_str(), + ); + import_paths.push(default_import_path); + } + + log::debug!(" [->] Resolved params.import_maps: {:?}", import_maps); + p.filename = Some(filepath.to_str().unwrap().to_string()); + p.outdir = Some(outdir); + p.import_paths = import_paths; + p.import_maps = import_maps; + p.solc_allow_paths = allow_paths; + } + run_mutate(mutate_params)?; + Ok(()) +} + +fn run_mutate_on_filename(mut params: Box) -> Result<(), Box> { + log::info!("Running CLI MutateParams: {:#?}", ¶ms); + + print_deprecation_warnings(¶ms, true); + print_experimental_feature_warnings(¶ms); + + log::debug!(" [.] Resolving params.filename"); + let filename = match params.filename { + Some(ref f) => f.clone(), + None => { + gambit::print_invalid_conf_missing_field_error("filename"); + std::process::exit(1); + } + }; + let filepath = match PathBuf::from(&filename).canonicalize() { + Ok(path) => path, + Err(_) => { + gambit::print_file_not_found_error(&filename); + std::process::exit(1); + } + }; + + log::debug!(" [.] Resolving params.outdir {:?}", ¶ms.outdir); + + let outdir = normalize_path(&PathBuf::from( + ¶ms.outdir.unwrap_or(default_gambit_output_directory()), + )) + .to_str() + .unwrap() + .to_string(); + log::debug!(" [.] Resolved params.outdir to {}", outdir); + + log::debug!( + " [.] Resolving params.solc_allow_paths: {:?}", + params.solc_allow_paths + ); + let solc_allowpaths = params.solc_allow_paths.map(|aps| { + aps.iter() + .map(|p| { + PathBuf::from(p) + .canonicalize() + .unwrap() + .to_str() + .unwrap() + .to_string() + }) + .collect() + }); + log::debug!( + " [.] Resolved params.solc_allow_paths to {:?}", + solc_allowpaths + ); + + log::debug!( + " [.] Resolving params.solc_base_path: {:?}", + params.solc_base_path + ); + + let mut import_paths = params + .import_paths + .iter() + .filter_map(|ip| { + if let Ok(path) = PathBuf::from(ip).canonicalize() { + Some(path.to_str().unwrap().to_string()) + } else { + print_warning( + "Import path not found", + format!("Failed to resolve import path {}", ip).as_str(), + ); + None + } + }) + .collect::>(); + + log::debug!(" [->] Resolved params.import_paths: {:?}", import_paths); + + log::debug!( + " [.] Resolving params.solc_base_path: {:?}", + params.solc_base_path + ); + if let Some(ref base_path) = params.solc_base_path { + let base_path = match PathBuf::from(&base_path).canonicalize() { + Ok(p) => p.to_str().unwrap().to_string(), + Err(_) => { + gambit::print_file_not_found_error(base_path.as_str()); + std::process::exit(1); + } + }; + if !import_paths.contains(&base_path) { + import_paths.push(base_path); + } + params.solc_base_path = None; + } + + if !params.solc_include_paths.is_empty() { + for include_path in params.solc_include_paths.iter() { + let include_path = match PathBuf::from(&include_path).canonicalize() { + Ok(p) => p.to_str().unwrap().to_string(), + Err(_) => { + gambit::print_file_not_found_error(include_path.as_str()); + std::process::exit(1); + } + }; + if !import_paths.contains(&include_path) { + import_paths.push(include_path); + } + } + params.solc_include_paths = vec![]; + } + if import_paths.is_empty() { + let default_import_path = PathBuf::from(".") + .canonicalize() + .ok() + .map(|x| x.to_str().unwrap().to_string()); + if let Some(path) = default_import_path { + import_paths.push(path); + } else { + print_error( + "Import Path Error", + "Could not canonicalize default import path '.'", + ); + std::process::exit(1); + } + } + + log::debug!(" [->] Resolved params.import_paths: {:?}", import_paths); + + let mut import_maps = vec![]; + for import_map in params.import_maps.iter() { + import_maps.push(import_map.clone()); + } + + if let Some(ref remappings) = params.solc_remappings { + for remapping in remappings.iter() { + import_maps.push(remapping.clone()); + } + params.solc_remappings = None; + } + log::debug!(" [->] Resolved params.import_maps: {:?}", import_maps); + + // Finally, update params with resolved source root and filename. + // (We don't update earlier to preserve the state of params + // for error reporting: reporting the parsed in value of + // `params` will be more helpful to the end user than + // reporting the modified value of params). + params.filename = Some(filepath.to_str().unwrap().to_string()); + params.outdir = Some(outdir); + params.solc_allow_paths = solc_allowpaths; + params.import_paths = import_paths; + params.solc_remappings = None; + + run_mutate(vec![*params])?; + Ok(()) +} diff --git a/src/mutant_writer.rs b/src/mutant_writer.rs index 6ead4ec..add7b04 100644 --- a/src/mutant_writer.rs +++ b/src/mutant_writer.rs @@ -50,12 +50,12 @@ impl MutantWriter { for (i, (mutant, _)) in mutants.iter().enumerate() { let mid = i + 1; - let (lineno, colno) = mutant.get_line_column()?; - let line_col = format!("{}:{}", lineno, colno); + let (lineno, colno) = mutant.get_line_column(); + let line_col = format!("{}:{}", lineno + 1, colno + 1); w.write_record([ mid.to_string().as_str(), - mutant.op.to_string().as_str(), - mutant.source.relative_filename()?.to_str().unwrap(), + mutant.op.short_name().as_str(), + mutant.vfs_path().to_str().unwrap(), line_col.as_str(), mutant.orig.as_str(), mutant.repl.as_str(), @@ -75,14 +75,17 @@ impl MutantWriter { let mut json: Vec = Vec::new(); for (i, ((mutant, _), diff)) in mutants.iter().zip(diffs).enumerate() { let mid = i + 1; - let sourceroot = mutant.source.sourceroot().to_str().unwrap().to_string(); json.push(serde_json::json!({ "name": Self::get_mutant_filename(&PathBuf::from("mutants"), mid, mutant), "description": mutant.op.to_string(), + "op": mutant.op.short_name(), "id": mid.to_string(), "diff": diff, - "sourceroot": sourceroot, - "original": mutant.source.relative_filename()?, + "original": mutant.vfs_path(), + "orig": &mutant.orig, + "repl": &mutant.repl, + "line": &mutant.get_line_column().0 + 1, + "col": &mutant.get_line_column().1 + 1 })); } @@ -110,8 +113,8 @@ impl MutantWriter { mutants_dir: &Path, mutant: &Mutant, ) -> Result> { - let filename = mutants_dir.join(mutant.source.filename().file_name().unwrap()); - let mutant_contents = mutant.as_source_string()?; + let filename = mutants_dir.join(mutant.vfs_path()); + let mutant_contents = mutant.mutant_source()?; log::debug!("Writing mutant {:?} to {}", mutant, &filename.display()); @@ -131,7 +134,7 @@ impl MutantWriter { filename: &Path, mutant: &Mutant, ) -> Result<(), Box> { - let mutant_contents = mutant.as_source_string()?; + let mutant_contents = mutant.mutant_source()?; log::debug!("Writing mutant {:?} to {}", mutant, &filename.display()); @@ -160,9 +163,9 @@ impl MutantWriter { mutant: &Mutant, ) -> Result> { let filename = Self::get_mutant_filename(mutants_dir, mid, mutant); - let mutant_contents = mutant.as_source_string()?; + let mutant_contents = mutant.mutant_source()?; - log::info!( + log::debug!( "Writing mutant (mid={}) {:?} to {}", mid, mutant, @@ -180,13 +183,7 @@ impl MutantWriter { /// This is computed from the relative path of the original sourcefile, relative to /// the specified `sourceroot`, and is computed with `Source.relative_filename()` fn get_mutant_filename(mutants_dir: &Path, mid: usize, mutant: &Mutant) -> PathBuf { - let rel_filename = match mutant.source.relative_filename() { - Ok(rel_fn) => rel_fn, - Err(e) => panic!( - "Error getting relative filename from {:?}\n\nError:{:?}", - &mutant.source, e - ), - }; + let rel_filename = mutant.vfs_path(); mutants_dir .join(Path::new(&mid.to_string())) .join(rel_filename) @@ -194,8 +191,8 @@ impl MutantWriter { /// Get the diff of the mutant and the original file fn diff_mutant(mutant: &Mutant) -> Result> { - let orig_contents: String = String::from_utf8_lossy(mutant.source.contents()).into(); - let mutant_contents = mutant.as_source_string().unwrap(); + let orig_contents = mutant.original_source().to_string(); + let mutant_contents = mutant.mutant_source().unwrap(); let diff = TextDiff::from_lines(&orig_contents, &mutant_contents) .unified_diff() diff --git a/src/mutation.rs b/src/mutation.rs index 87270d9..7c6a111 100644 --- a/src/mutation.rs +++ b/src/mutation.rs @@ -1,27 +1,105 @@ -use crate::{get_indent, SolAST, Source}; +use crate::{get_indent, get_vfs_path, print_error, print_warning, Mutator}; use clap::ValueEnum; +use num_bigint::BigInt; +use num_traits::{One, Signed, Zero}; use serde::{Deserialize, Serialize}; -use std::{error, fmt::Display, rc::Rc}; +use solang::{ + file_resolver::FileResolver, + sema::ast::{CallTy, Expression, Function, Namespace, RetrieveType, Statement, Type}, +}; +use solang_parser::pt::{CodeLocation, Loc}; +use std::{ + error, + fmt::{Debug, Display}, + path::PathBuf, + rc::Rc, + sync::Arc, +}; + +/// MutantLoc describes all location-based data of a mutant, including which +/// file the mutant mutates, the original solang Loc, and the line and column +/// numbers +#[derive(Clone)] +pub struct MutantLoc { + /// The location of the node that is mutated + pub loc: Loc, + /// The (starting) line number of the mode being mutated 0-indexed + pub line_no: usize, + /// The column number of the node being mutated 0-indexed + pub col_no: usize, + /// The full path to the original source file + pub path: PathBuf, + /// The path in the Virtual File System. This is interpreted as the path of + /// the original source file relative to an import root + pub vfs_path: PathBuf, +} + +impl Debug for MutantLoc { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + f.debug_struct("MutantLoc") + .field("path", &self.path.display()) + .field("loc", &self.loc) + .field("line_no", &self.line_no) + .field("col_no", &self.col_no) + .finish() + } +} + +impl MutantLoc { + pub fn new(loc: Loc, resolver: &FileResolver, namespace: Rc) -> MutantLoc { + let file = namespace.files.get(loc.file_no()).unwrap(); + let (line_no, col_no) = file.offset_to_line_column(loc.start()); + let path = file.path.clone(); + + let vfs_path = if let Some(vfs_path) = get_vfs_path(resolver, &file.path) { + vfs_path + } else if let Ok(can_path) = file.path.canonicalize() { + print_warning( + "File Not In Import Paths", + format!( + "File {} not a part of any import paths. Using canonical path {}", + file.path.display(), + can_path.display() + ) + .as_str(), + ); + can_path + } else { + print_error( + "File Not In Import Paths", + format!( + "File {} not a part of any import paths and could not canonicalize.", + file.path.display() + ) + .as_str(), + ); + std::process::exit(1); + }; + + MutantLoc { + loc, + line_no, + col_no, + path, + vfs_path, + } + } +} /// This struct describes a mutant. -#[derive(Debug, Clone)] +#[derive(Clone)] pub struct Mutant { - /// The original program's source - pub source: Rc, + /// The location of the mutant (including file number, start, and end) + pub mutant_loc: MutantLoc, /// The mutation operator that was applied to generate this mutant pub op: MutationType, - /// The string representation of the original node - pub orig: String, - - /// The index into the program source marking the beginning (inclusive) of - /// the source to be replaced - pub start: usize, + /// Original file's source + pub source: Arc, - /// The index into the program source marking the end (inclusive) of the - /// source to be replaced - pub end: usize, + /// Original text to be replaced + pub orig: String, /// The string replacement pub repl: String, @@ -29,53 +107,81 @@ pub struct Mutant { impl Mutant { pub fn new( - source: Rc, + resolver: &FileResolver, + namespace: Rc, + loc: Loc, op: MutationType, - start: usize, - end: usize, + orig: String, repl: String, ) -> Mutant { - let orig = String::from_utf8(source.contents()[start..end].to_vec()).unwrap(); - Mutant { - source, - op, - orig, - start, - end, - repl, + if let Loc::File(file_no, _, _) = loc { + let source = resolver.get_contents_of_file_no(file_no).unwrap(); + let mutant_loc = MutantLoc::new(loc, resolver, namespace); + Mutant { + mutant_loc, + op, + source, + orig, + repl, + } + } else { + panic!("Location must be Loc::File(...), but found {:?}", loc) } } + pub fn loc(&self) -> &Loc { + &self.mutant_loc.loc + } + + pub fn path(&self) -> &PathBuf { + &self.mutant_loc.path + } + + pub fn vfs_path(&self) -> &PathBuf { + &self.mutant_loc.vfs_path + } + + pub fn get_line_column(&self) -> (usize, usize) { + let mloc = &self.mutant_loc; + (mloc.line_no, mloc.col_no) + } + /// Render this mutant as String with the full source file contents /// /// TODO: Cache these contents: this data might be needed multiple times, /// and if so this should be cached as it currently involves file IO (though /// Source::contents() should also be cached) - pub fn as_source_string(&self) -> Result> { - let contents = self.source.contents(); - let prelude = &contents[0..self.start]; - let postlude = &contents[self.end..contents.len()]; + pub fn mutant_source(&self) -> Result> { + let loc = self.loc(); + let start = loc.start(); + let end = loc.end(); + + let contents: Arc = self.source.clone(); + let orig = &contents[start..end]; + + let prelude = &contents[0..start]; + let postlude = &contents[end..contents.len()]; - let res = [prelude, self.repl.as_bytes(), postlude].concat(); - let mut_string = String::from_utf8(res)?; + let (line_no, _) = self.get_line_column(); + + let res = [prelude, self.repl.as_str(), postlude].concat(); + let mut_string = res; let mut lines = mut_string.lines(); - let (line, _) = self.source.get_line_column(self.start)?; let mut lines2 = vec![]; - for _ in 1..line { + for _ in 1..line_no { lines2.push(lines.next().unwrap()); } let mut_line = lines.next().unwrap(); - let orig_string = String::from_utf8(contents.to_vec())?; - let orig_line = orig_string.lines().nth(line - 1).unwrap(); + let orig_line = contents.lines().nth(line_no).unwrap(); let indent = get_indent(mut_line); let comment = format!( "{}/// {}(`{}` |==> `{}`) of: `{}`", indent, self.op.to_string(), - self.orig.trim(), + orig.trim(), self.repl, orig_line.trim() ); @@ -87,369 +193,984 @@ impl Mutant { } // XXX: this is a hack to avoid trailing newline diffs - if contents.last().unwrap() == &b'\n' { + if contents.ends_with('\n') { lines2.push(""); } Ok(lines2.join("\n")) } - pub fn get_line_column(&self) -> Result<(usize, usize), Box> { - self.source.get_line_column(self.start) + pub fn original_source(&self) -> Arc { + self.source.clone() } } impl Display for Mutant { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let contents = self.source.contents(); - let (start, end) = (self.start, self.end); - let orig = &contents[start..end]; - let repl = &self.repl; write!( f, "{}: {} |==> {}", self.op.to_string(), - String::from_utf8_lossy(orig), - repl + &self.orig, + &self.repl ) } } +impl Debug for Mutant { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + f.debug_struct("Mutant") + .field("op", &self.op) + .field("orig", &self.orig) + .field("repl", &self.repl) + .field("mutant_loc", &self.mutant_loc) + .finish() + } +} + /// Every kind of mutation implements this trait. A mutation can check if it /// applies to an AST node, and can mutate an AST node. pub trait Mutation { - /// Check if this mutation applies to this AST node - fn applies_to(&self, node: &SolAST) -> bool; + fn mutate_function(&self, mutator: &Mutator, func: &Function) -> Vec; + + fn mutate_statement(&self, mutator: &Mutator, stmt: &Statement) -> Vec; + + fn mutate_expression(&self, mutator: &Mutator, expr: &Expression) -> Vec; - /// Generate all mutants of a given node by this agent - fn mutate(&self, node: &SolAST, source: Rc) -> Vec; + fn mutate_expression_fallback(&self, mutator: &Mutator, expr: &Expression) -> Vec; + + /// Is a given mutation operator a fallback mutation? + fn is_fallback_mutation(&self, mutator: &Mutator) -> bool; } /// Kinds of mutations. +/// +/// Note: to add another mutation, do the following steps: +/// 1. Add a new entry to the `MutationType` enum +/// 2. Update `MutationType::to_string` w/ new mutation type +/// 3. Update `MutationType::shortname` w/ new mutation type +/// 4. Update `normalize_mutation_operator_name()` in `utils.rs` w/ new mutation type #[derive(Hash, Eq, PartialEq, Clone, Copy, Debug, ValueEnum, Deserialize, Serialize)] pub enum MutationType { - AssignmentMutation, - BinaryOpMutation, - DeleteExpressionMutation, - ElimDelegateMutation, - FunctionCallMutation, - IfStatementMutation, - RequireMutation, - SwapArgumentsFunctionMutation, - SwapArgumentsOperatorMutation, - UnaryOperatorMutation, + ArithmeticOperatorReplacement, + BitwiseOperatorReplacement, + ElimDelegateCall, + LiteralValueReplacement, + LogicalOperatorReplacement, + RelationalOperatorReplacement, + ShiftOperatorReplacement, + StatementDeletion, + UnaryOperatorReplacement, + ExpressionValueReplacement, } impl ToString for MutationType { fn to_string(&self) -> String { let str = match self { - MutationType::AssignmentMutation => "AssignmentMutation", - MutationType::BinaryOpMutation => "BinaryOpMutation", - MutationType::DeleteExpressionMutation => "DeleteExpressionMutation", - MutationType::ElimDelegateMutation => "ElimDelegateMutation", - MutationType::FunctionCallMutation => "FunctionCallMutation", - MutationType::IfStatementMutation => "IfStatementMutation", - MutationType::RequireMutation => "RequireMutation", - MutationType::SwapArgumentsFunctionMutation => "SwapArgumentsFunctionMutation", - MutationType::SwapArgumentsOperatorMutation => "SwapArgumentsOperatorMutation", - MutationType::UnaryOperatorMutation => "UnaryOperatorMutation", + MutationType::ArithmeticOperatorReplacement => "ArithmeticOperatorReplacement", + MutationType::BitwiseOperatorReplacement => "ConditionalOperatorReplacement", + MutationType::ElimDelegateCall => "ElimDelegateCall", + MutationType::ExpressionValueReplacement => "ExpressionValueReplacement", + MutationType::LiteralValueReplacement => "LiteralValueReplacement", + MutationType::LogicalOperatorReplacement => "LogicalOperatorReplacement", + MutationType::RelationalOperatorReplacement => "RelationalOperatorReplacement", + MutationType::ShiftOperatorReplacement => "ShiftOperatorReplacement", + MutationType::StatementDeletion => "StatementDeletion", + MutationType::UnaryOperatorReplacement => "UnaryOperatorReplacement", }; str.into() } } impl Mutation for MutationType { - fn applies_to(&self, node: &SolAST) -> bool { + fn mutate_function(&self, _mutator: &Mutator, _func: &Function) -> Vec { + vec![] + } + + fn mutate_statement(&self, mutator: &Mutator, stmt: &Statement) -> Vec { + let file_no = stmt.loc().file_no(); + let resolver = &mutator.file_resolver; + let ns = mutator + .namespace + .as_ref() + .expect("Cannot mutate an expression without a set namespace") + .clone(); + let contents = resolver.get_contents_of_file_no(file_no).unwrap(); + let loc = stmt.loc(); + if loc.try_file_no().is_none() { + return vec![]; + } match self { - MutationType::AssignmentMutation => { - if let Some(n) = node.node_type() { - return n == "Assignment"; - } + MutationType::StatementDeletion => { + statement_deletion(self, resolver, ns, stmt, &contents) } - MutationType::BinaryOpMutation => { - if let Some(n) = node.node_type() { - return n == "BinaryOperation"; - } + _ => vec![], + } + } + + fn mutate_expression(&self, mutator: &Mutator, expr: &Expression) -> Vec { + self._mutate_expression_helper(mutator, expr, false) + } + + fn mutate_expression_fallback(&self, mutator: &Mutator, expr: &Expression) -> Vec { + self._mutate_expression_helper(mutator, expr, true) + } + + fn is_fallback_mutation(&self, mutator: &Mutator) -> bool { + mutator.conf.fallback_operators.contains(self) + } +} + +impl MutationType { + pub fn default_mutation_operators() -> Vec { + vec![ + MutationType::ArithmeticOperatorReplacement, + MutationType::BitwiseOperatorReplacement, + MutationType::ElimDelegateCall, + MutationType::LiteralValueReplacement, + MutationType::LogicalOperatorReplacement, + MutationType::RelationalOperatorReplacement, + MutationType::ShiftOperatorReplacement, + MutationType::StatementDeletion, + MutationType::UnaryOperatorReplacement, + ] + } + + pub fn default_fallback_mutation_operators() -> Vec { + vec![] + } + + pub fn short_name(&self) -> String { + match self { + MutationType::ArithmeticOperatorReplacement => "AOR", + MutationType::BitwiseOperatorReplacement => "BOR", + MutationType::ElimDelegateCall => "EDC", + MutationType::ExpressionValueReplacement => "EVR", + MutationType::LiteralValueReplacement => "LVR", + MutationType::LogicalOperatorReplacement => "LOR", + MutationType::RelationalOperatorReplacement => "ROR", + MutationType::ShiftOperatorReplacement => "SOR", + MutationType::StatementDeletion => "STD", + MutationType::UnaryOperatorReplacement => "UOR", + } + .to_string() + } + + /// Perform actual mutation. Expects a `mutator` and and `expr`, as well + /// as a `bool` telling us if we should be performing fallback mutations + /// or regular mutations + fn _mutate_expression_helper( + &self, + mutator: &Mutator, + expr: &Expression, + is_fallback: bool, + ) -> Vec { + if self.is_fallback_mutation(mutator) != is_fallback { + return vec![]; + } + let file_no = expr.loc().file_no(); + let resolver = &mutator.file_resolver; + let contents = &resolver.get_contents_of_file_no(file_no).unwrap(); + let ns = mutator + .namespace + .as_ref() + .expect("Cannot mutate an expression without a set namespace") + .clone(); + match self { + // Binary Operators + MutationType::ArithmeticOperatorReplacement => { + arith_op_replacement(self, resolver, ns, expr, contents) } - MutationType::DeleteExpressionMutation => { - if let Some(n) = node.node_type() { - return n == "ExpressionStatement"; - } + MutationType::ShiftOperatorReplacement => { + shift_op_replacement(self, resolver, ns, expr, contents) } - MutationType::ElimDelegateMutation => { - return node.node_type().map_or_else( - || false, - |n| { - n == "FunctionCall" - && (node - .expression() - .node_type() - .map_or_else(|| false, |nt| nt == "MemberAccess")) - && (node - .expression() - .get_string("memberName") - .map_or_else(|| false, |mn| mn == "delegatecall")) - }, - ); + MutationType::BitwiseOperatorReplacement => { + bitwise_op_replacement(self, resolver, ns, expr, contents) } - MutationType::FunctionCallMutation => { - if let Some(n) = node.node_type() { - return n == "FunctionCall" && !node.arguments().is_empty(); - } + MutationType::RelationalOperatorReplacement => { + rel_op_replacement(self, resolver, ns, expr, contents) } - MutationType::IfStatementMutation => { - if let Some(n) = node.node_type() { - return n == "IfStatement"; - } + MutationType::LogicalOperatorReplacement => { + logical_op_replacement(self, resolver, ns, expr, contents) } - MutationType::RequireMutation => { - return node.node_type().map_or_else( - || false, - |n| { - n == "FunctionCall" - && (node - .expression() - .name() - .map_or_else(|| false, |nm| nm == "require")) - && !node.arguments().is_empty() - }, - ); + // Other + MutationType::LiteralValueReplacement => { + literal_value_replacement(self, resolver, ns, expr, contents) } - MutationType::SwapArgumentsFunctionMutation => { - if let Some(n) = node.node_type() { - return n == "FunctionCall" && node.arguments().len() > 1; - } + MutationType::UnaryOperatorReplacement => { + unary_op_replacement(self, resolver, ns, expr, contents) } - MutationType::SwapArgumentsOperatorMutation => { - let non_comm_ops = vec!["-", "/", "%", "**", ">", "<", ">=", "<=", "<<", ">>"]; - if let Some(n) = node.node_type() { - return n == "BinaryOperation" - && non_comm_ops.contains( - &node - .operator() - .unwrap_or_else(|| panic!("Expression does not have operator")) - .as_str(), - ); - } + MutationType::ExpressionValueReplacement => { + expression_value_replacement(self, resolver, ns, expr, contents) } - MutationType::UnaryOperatorMutation => { - if let Some(n) = node.node_type() { - return n == "UnaryOperation"; - } + + // Old Operators + MutationType::ElimDelegateCall => { + elim_delegate_mutation(self, resolver, ns, expr, contents) } + _ => vec![], } - false } +} - /// Produce all mutants at the given node - /// - /// # Arguments - /// - /// * `node` - The Solidity AST node to mutate - /// * `source` - The original source file: we use this to generate a new - /// source file - fn mutate(&self, node: &SolAST, source: Rc) -> Vec { - if !self.applies_to(node) { - return vec![]; - } - match self { - MutationType::AssignmentMutation => { - let rhs = node.right_hand_side(); - let node_kind = rhs.node_kind(); - let orig = rhs.get_text(source.contents()); - let replacements: Vec<&str> = if let Some(kind) = node_kind { - if &kind == "bool" { - vec!["true", "false"] - } else if rhs.is_literal_number() { - vec!["(-1)", "0", "1"] - } else { - vec!["0", "(-1)", "1", "true", "false"] - } - } else { - vec!["0", "(-1)", "1", "true", "false"] +/// Find the location of an operator. This is not explicitly represented in an +/// AST node, so we have to do some digging. +fn get_op_loc(expr: &Expression, source: &Arc) -> Option { + Some(match expr { + // Regular Binary operator + Expression::Add { left, right, .. } + | Expression::Subtract { left, right, .. } + | Expression::Multiply { left, right, .. } + | Expression::Divide { left, right, .. } + | Expression::Modulo { left, right, .. } + | Expression::BitwiseOr { left, right, .. } + | Expression::BitwiseAnd { left, right, .. } + | Expression::BitwiseXor { left, right, .. } + | Expression::ShiftLeft { left, right, .. } + | Expression::ShiftRight { left, right, .. } + | Expression::Assign { left, right, .. } + | Expression::More { left, right, .. } + | Expression::Less { left, right, .. } + | Expression::MoreEqual { left, right, .. } + | Expression::LessEqual { left, right, .. } + | Expression::Equal { left, right, .. } + | Expression::NotEqual { left, right, .. } + | Expression::Or { left, right, .. } + | Expression::And { left, right, .. } => { + let start = left.loc().end(); + let end = right.loc().start(); + if start >= end { + // Okay, we gotta do this the hard way. Here is what happened: + // We had an op+assignment expression like `a += b`, which got + // desugared to `a = a + b`. There is a bug in Solang's + // desugaring https://github.com/hyperledger/solang/issues/1521 + // that triggers when the LHS of a += b is a storage access. + // This bug causes the location of the LHS to be that of the + // entire expression, so LHS.end() is actually the end of the + // entire expression (so printing source[LHS.start()..LHS.end()] + // would print a += b). + // + // We detect this, issue a warning with the logger, and continue + log::warn!( + "Error: invalid location generated by Solang for LHS of expression {}", + &source[expr.loc().start()..expr.loc().end()], + ); + log::warn!( + "expr.start()..lhs.end(): {}", + &source[expr.loc().start()..start] + ); + log::warn!( + "lhs.start()..expr.end(): {}", + &source[end..expr.loc().end()] + ); + log::warn!("left: {}", &source[left.loc().start()..left.loc().end()]); + log::warn!("right: {}", &source[right.loc().start()..right.loc().end()]); + log::warn!("No mutants generated for this node"); + return None; + } + let op = get_operator(expr); + let substr = &source[start..end]; + let first_op_char = op.chars().next().unwrap(); + let op_offset_in_substr = match substr.chars().position(|c| c == first_op_char) { + Some(x) => x, + None => { + print_error(format!("Could not find start/end to operator {:?}", op).as_str(), + format!( + "Error finding start/end to operator {:?} in substring {}\nExpression: {:?}\nFile: {}, Pos: {:?}", + op, + substr, + expr, + left.loc().file_no(), + (start, end) + ) + .as_str() + ); + std::process::exit(1); } - .iter() - .filter(|v| !orig.eq(*v)) - .copied() - .collect(); + }; - let (s, e) = rhs.get_bounds(); + let op_start = start + (op_offset_in_substr as usize); + let op_end = op_start + op.len(); + left.loc().with_start(op_start).with_end(op_end) + } + Expression::StringConcat { .. } | Expression::StringCompare { .. } => todo!(), + + Expression::Power { base, exp, .. } => { + let start = base.loc().end(); + let end = exp.loc().start(); + let op = get_operator(expr); + let substr = &source[start..end]; + let first_op_char = op.chars().next().unwrap(); + let op_offset_in_substr = substr.chars().position(|c| c == first_op_char).unwrap(); + let op_start = start + op_offset_in_substr; + let op_end = op_start + op.len(); + base.loc().with_start(op_start).with_end(op_end) + } + Expression::PreIncrement { loc, .. } | Expression::PreDecrement { loc, .. } => { + loc.with_end(loc.start() + get_operator(expr).len()) + } + Expression::PostIncrement { loc, .. } | Expression::PostDecrement { loc, .. } => { + loc.with_start(loc.end() - get_operator(expr).len()) + } + + Expression::Not { loc, .. } + | Expression::BitwiseNot { loc, .. } + | Expression::Negate { loc, .. } => loc.with_end(loc.start() + get_operator(expr).len()), + + Expression::ConditionalOperator { + cond, true_option, .. + } => { + let start = cond.loc().end(); + let end = true_option.loc().start(); + let op = get_operator(expr); + let substr = &source[start..end]; + let first_op_char = op.chars().next().unwrap(); + let op_offset_in_substr = substr.chars().position(|c| c == first_op_char).unwrap(); + let op_start = start + op_offset_in_substr; + let op_end = op_start + op.len(); + cond.loc().with_start(op_start).with_end(op_end) + } + + _ => panic!("No op location for {:?}", expr), + }) +} + +/// Get a string representation of an operator +fn get_operator(expr: &Expression) -> &str { + match expr { + Expression::Add { .. } => "+", + Expression::Subtract { .. } => "-", + Expression::Multiply { .. } => "*", + Expression::Divide { .. } => "/", + Expression::Modulo { .. } => "%", + Expression::Power { .. } => "**", + Expression::BitwiseOr { .. } => "|", + Expression::BitwiseAnd { .. } => "&", + Expression::BitwiseXor { .. } => "^", + Expression::ShiftLeft { .. } => "<<", + Expression::ShiftRight { .. } => ">>", + Expression::PreIncrement { .. } => "++", + Expression::PreDecrement { .. } => "--", + Expression::PostIncrement { .. } => "++", + Expression::PostDecrement { .. } => "--", + Expression::More { .. } => ">", + Expression::Less { .. } => "<", + Expression::MoreEqual { .. } => ">=", + Expression::LessEqual { .. } => "<=", + Expression::Equal { .. } => "==", + Expression::NotEqual { .. } => "!=", + Expression::Not { .. } => "!", + Expression::BitwiseNot { .. } => "~", + Expression::Negate { .. } => "-", + Expression::ConditionalOperator { .. } => "?", + Expression::Or { .. } => "||", + Expression::And { .. } => "&&", + _ => "", + } +} + +fn arith_op_replacement( + op: &MutationType, + file_resolver: &FileResolver, + namespace: Rc, + expr: &Expression, + contents: &Arc, +) -> Vec { + let loc = expr.loc(); + let arith_op = get_operator(expr); + let mut replacements: Vec<&str> = ["+", "-", "*", "/", "**", "%"] + .iter() + .filter(|x| **x != arith_op) + .copied() + .collect(); + + if loc.try_file_no().is_none() { + return vec![]; + } + match expr { + Expression::Divide { .. } + | Expression::Modulo { .. } + | Expression::Multiply { .. } + | Expression::Subtract { .. } + | Expression::Add { .. } => { + if let Type::Int(_) = expr.ty() { + // When we're signed, filter out `**`, which is illegal + replacements.retain(|x| *x != "**"); + }; + + let op_loc = get_op_loc(expr, contents); + if let Some(op_loc) = op_loc { replacements .iter() - .map(|r| Mutant::new(source.clone(), *self, s, e, r.to_string())) + .map(|r| { + Mutant::new( + file_resolver, + namespace.clone(), + op_loc, + *op, + arith_op.to_string(), + r.to_string(), + ) + }) .collect() + } else { + vec![] } - MutationType::BinaryOpMutation => { - let orig = node.operator().unwrap(); - let orig = String::from(orig.trim()); - - let ops: Vec<&str> = vec!["+", "-", "*", "/", "%", "**"] + } + Expression::Power { .. } => { + let op_loc = get_op_loc(expr, contents); + if let Some(op_loc) = op_loc { + replacements .iter() - .filter(|v| !orig.eq(*v)) - .copied() - .collect(); - - let (_, endl) = node.left_expression().get_bounds(); - let (startr, _) = node.right_expression().get_bounds(); - ops.iter() - .map(|op| Mutant::new(source.clone(), *self, endl, startr, op.to_string())) + .map(|r| { + Mutant::new( + file_resolver, + namespace.clone(), + op_loc, + *op, + arith_op.to_string(), + r.to_string(), + ) + }) .collect() + } else { + vec![] } + } + _ => vec![], + } +} - MutationType::DeleteExpressionMutation => { - let (start, end) = node.get_bounds(); - let empty_expression_statement = "assert(true)".to_string(); +fn bitwise_op_replacement( + op: &MutationType, + file_resolver: &FileResolver, + namespace: Rc, + expr: &Expression, + source: &Arc, +) -> Vec { + let loc = expr.loc(); + if loc.try_file_no().is_none() { + return vec![]; + } + match expr { + Expression::BitwiseOr { .. } => { + let op_loc = get_op_loc(expr, source); + if let Some(op_loc) = op_loc { vec![Mutant::new( - source, - *self, - start, - end, - empty_expression_statement, + file_resolver, + namespace, + op_loc, + *op, + "|".to_string(), + "&".to_string(), )] + } else { + vec![] } - MutationType::ElimDelegateMutation => { - let (_, endl) = node.expression().expression().get_bounds(); - let (_, endr) = node.expression().get_bounds(); - + } + Expression::BitwiseAnd { .. } => { + let op_loc = get_op_loc(expr, source); + if let Some(op_loc) = op_loc { vec![Mutant::new( - source, - *self, - endl + 1, - endr, - "call".to_string(), + file_resolver, + namespace, + op_loc, + *op, + "&".to_string(), + "|".to_string(), )] + } else { + vec![] } - - // TODO: Should we enable this? I'm not sure if this is the best mutation operator - MutationType::FunctionCallMutation => { - // if let Some(arg) = node.arguments().choose(rand) { - // node.replace_in_source(source, arg.get_text(source)) - // } else { - // node.get_text(source) - // } - - vec![] // For now I'm removing this operator: not sure what it does! + } + Expression::BitwiseXor { .. } => { + let op_loc = get_op_loc(expr, source); + if let Some(op_loc) = op_loc { + vec![Mutant::new( + file_resolver, + namespace, + op_loc, + *op, + "^".to_string(), + "&".to_string(), + )] + } else { + vec![] } + } + _ => vec![], + } +} - MutationType::IfStatementMutation => { - let cond = node.condition(); - let orig = cond.get_text(source.contents()); - let bs: Vec<&str> = vec!["true", "false"] - .iter() - .filter(|v| !orig.eq(*v)) - .copied() - .collect(); +fn literal_value_replacement( + op: &MutationType, + file_resolver: &FileResolver, + namespace: Rc, + expr: &Expression, + source: &Arc, +) -> Vec { + let loc = expr.loc(); + let orig = source[loc.start()..loc.end()].to_string(); + if loc.try_file_no().is_none() { + return vec![]; + } + // We are only replacing BoolLiterals, NumberLiterals, and + // RationalNumberLiterals. It's not clear what other literals we should + // replace + let replacements = match expr { + Expression::BoolLiteral { value, .. } => vec![(!value).to_string()], + Expression::NumberLiteral { ty, value, .. } => match ty { + solang::sema::ast::Type::Address(_) => vec![], + solang::sema::ast::Type::Int(_) => { + if value.is_zero() { + vec!["-1".to_string(), "1".to_string()] + } else if value.is_positive() { + vec![ + "0".to_string(), + (-value).to_string(), + (value + BigInt::one()).to_string(), + ] + } else { + vec![ + "0".to_string(), + (-value).to_string(), + (value - BigInt::one()).to_string(), + ] + } + } + solang::sema::ast::Type::Uint(_) => { + if value.is_zero() { + vec!["1".to_string()] + } else { + vec!["0".to_string(), (value + BigInt::one()).to_string()] + } + } + _ => vec![], + }, + Expression::RationalNumberLiteral { value: _, .. } => vec![], + Expression::BytesLiteral { .. } => vec![], + Expression::CodeLiteral { .. } => vec![], + Expression::StructLiteral { .. } => vec![], + Expression::ArrayLiteral { .. } => vec![], + Expression::ConstArrayLiteral { .. } => vec![], + _ => vec![], + }; + let mut mutants = vec![]; + for r in replacements { + mutants.push(Mutant::new( + file_resolver, + namespace.clone(), + loc, + *op, + orig.clone(), + r.clone(), + )); + } + mutants +} - let (start, end) = cond.get_bounds(); +fn logical_op_replacement( + op: &MutationType, + file_resolver: &FileResolver, + namespace: Rc, + expr: &Expression, + source: &Arc, +) -> Vec { + let loc = expr.loc(); + if loc.try_file_no().is_none() { + return vec![]; + } - bs.iter() - .map(|r| Mutant::new(source.clone(), *self, start, end, r.to_string())) - .collect() + // First, compile a list of replacements for this logical operator. Each replacement is either + // LHS, RHS, true, or false, as well as the location of the replacing + // expression (this is only used for RHS and LHS, since we need to compute + // the replacement value) + let replacements = match expr { + Expression::And { left, right, .. } => { + vec![("LHS", left.loc()), ("RHS", right.loc()), ("false", loc)] + } + Expression::Or { left, right, .. } => { + vec![("LHS", left.loc()), ("RHS", right.loc()), ("true", loc)] + } + Expression::Not { .. } => { + vec![("true", expr.loc()), ("false", expr.loc())] + } + _ => { + return vec![]; + } + }; + + // Now, apply each replacement to create a mutant + let mut mutants = vec![]; + let orig = source[loc.start()..loc.end()].to_string(); + for (r, sub_loc) in replacements { + mutants.push(match r { + "LHS" | "RHS" => { + let repl = source[sub_loc.start()..sub_loc.end()].to_string(); + Mutant::new( + file_resolver, + namespace.clone(), + loc, + *op, + orig.clone(), + repl, + ) } + "true" | "false" => Mutant::new( + file_resolver, + namespace.clone(), + loc, + *op, + orig.clone(), + r.to_string(), + ), + _ => panic!("Illegal State"), + }); + } + mutants +} - MutationType::RequireMutation => { - let arg = &node.arguments()[0]; - let orig = arg.get_text(source.contents()); - let bs: Vec<&str> = vec!["true", "false"] - .iter() - .filter(|v| !orig.eq(*v)) - .copied() - .collect(); - let (start, end) = arg.get_bounds(); - bs.iter() - .map(|r| Mutant::new(source.clone(), *self, start, end, r.to_string())) - .collect() +fn rel_op_replacement( + op: &MutationType, + file_resolver: &FileResolver, + namespace: Rc, + expr: &Expression, + source: &Arc, +) -> Vec { + let loc = expr.loc(); + if loc.try_file_no().is_none() { + return vec![]; + } + + let replacements = match expr { + Expression::Less { .. } => vec!["<=", "!=", "false"], + Expression::LessEqual { .. } => vec!["<", "==", "true"], + Expression::More { .. } => vec![">=", "!=", "false"], + Expression::MoreEqual { .. } => vec![">", "==", "true"], + Expression::Equal { left, .. } => { + // Assuming that we only need the left type to determine legal mutations + match left.ty() { + // The following types are orderable, so we use those for better mutation operators + solang::sema::ast::Type::Int(_) + | solang::sema::ast::Type::Uint(_) + | solang::sema::ast::Type::Rational => vec!["<=", ">=", "false"], + + // The following types are not orderable, so we replace with true and false + // TODO: Can Addresses be ordered? + solang::sema::ast::Type::Address(_) => vec!["false"], + _ => vec!["false"], + } + } + Expression::NotEqual { left, .. } => { + // Assuming that we only need the left type to determine legal mutations + match left.ty() { + // The following types are orderable, so we use those for better mutation operators + solang::sema::ast::Type::Int(_) + | solang::sema::ast::Type::Uint(_) + | solang::sema::ast::Type::Rational => vec!["<", ">", "true"], + + // The following types are not orderable, so we replace with true and false + // TODO: Can Addresses be ordered? + solang::sema::ast::Type::Address(_) => vec!["true"], + _ => vec!["true"], } + } + _ => return vec![], + }; + + // Now, apply the replacements. Some replacements will replace the entire + // expression, while others will replace only the operator. + let mut mutants = vec![]; + let expr_start = loc.start(); + let expr_end = loc.end(); + let expr_string = &source[expr_start..expr_end].to_string(); + + let rel_op_loc = get_op_loc(expr, source); + if rel_op_loc.is_none() { + return vec![]; + } + let rel_op_loc = rel_op_loc.unwrap(); + let rel_op_start = rel_op_loc.start(); + let rel_op_end = rel_op_loc.end(); + let rel_op_string = source[rel_op_start..rel_op_end].to_string(); + for r in replacements { + mutants.push(match r { + // true and false replacements replace the entire expression, so use + // the expression's location (`loc`) and the expression's raw strin + // (`expr_string`) + "true" | "false" => Mutant::new( + file_resolver, + namespace.clone(), + loc, + *op, + expr_string.to_string(), + r.to_string(), + ), + // other replacements replace only the relational operator, so use + // the rel op location (`rel_op_loc`) and the rel op's raw string + // (`expr_string`) + _ => Mutant::new( + file_resolver, + namespace.clone(), + rel_op_loc, + *op, + rel_op_string.clone(), + r.to_string(), + ), + }); + } + mutants +} - MutationType::SwapArgumentsFunctionMutation => { +fn shift_op_replacement( + op: &MutationType, + file_resolver: &FileResolver, + namespace: Rc, + expr: &Expression, + source: &Arc, +) -> Vec { + let loc = expr.loc(); + if loc.try_file_no().is_none() { + return vec![]; + } + match expr { + Expression::ShiftLeft { .. } => { + let op_loc = get_op_loc(expr, source); + if let Some(op_loc) = op_loc { + vec![Mutant::new( + file_resolver, + namespace, + op_loc, + *op, + "<<".to_string(), + ">>".to_string(), + )] + } else { vec![] - - // TODO: I'm removing this operator for now as I'm not sure how - // to implement it deterministically. I'm also faily convinced - // that this operator should be removed - - // let mut children = node.arguments(); - // children.shuffle(rand); - - // if children.len() == 2 { - // node.replace_multiple( - // source, - // vec![ - // (children[0].clone(), children[1].get_text(source)), - // (children[1].clone(), children[0].get_text(source)), - // ], - // ) - // } else { - // node.get_text(source) - // } } - - MutationType::SwapArgumentsOperatorMutation => { - let left = node.left_expression(); - let right = node.right_expression(); - let (left_start, left_end) = left.get_bounds(); - let (right_start, right_end) = right.get_bounds(); - let start = left_start; - let end = right_end; - let op = node.operator().unwrap(); - let op = format!(" {} ", op.trim()); - let contents = source.contents(); - let left_contents = - String::from_utf8(contents[left_start..left_end].to_vec()).unwrap(); - let right_contents = - String::from_utf8(contents[right_start..right_end].to_vec()).unwrap(); - - let mut repl: String = right_contents; - repl.push_str(&op); - repl.push_str(&left_contents); - - vec![Mutant::new(source.clone(), *self, start, end, repl)] + } + Expression::ShiftRight { .. } => { + let op_loc = get_op_loc(expr, source); + if let Some(op_loc) = op_loc { + vec![Mutant::new( + file_resolver, + namespace, + op_loc, + *op, + ">>".to_string(), + "<<".to_string(), + )] + } else { + vec![] } + } + _ => vec![], + } +} - MutationType::UnaryOperatorMutation => { - let prefix_ops = vec!["++", "--", "~"]; - let suffix_ops = vec!["++", "--"]; - - let op = node - .operator() - .expect("Unary operation must have an operator!"); +fn statement_deletion( + op: &MutationType, + file_resolver: &FileResolver, + namespace: Rc, + stmt: &Statement, + source: &Arc, +) -> Vec { + let loc = stmt.loc(); + let orig = source[loc.start()..loc.end()].to_string(); + match stmt { + // Do not delete complex/nested statements + Statement::Block { .. } + | Statement::Destructure(..) + | Statement::VariableDecl(..) + | Statement::If(..) + | Statement::While(..) + | Statement::For { .. } + | Statement::DoWhile(..) + | Statement::Assembly(..) + | Statement::TryCatch(..) + // Also do not delete underscore statement + | Statement::Underscore(_) => vec![], + + Statement::Expression(..) + | Statement::Delete(..) + | Statement::Continue(..) + | Statement::Break(..) + | Statement::Revert { .. } + | Statement::Return(..) + | Statement::Emit { .. } => vec![Mutant::new( + file_resolver, + namespace, + loc, + *op, + orig, + "assert(true)".to_string(), + )] + } +} - let (start, end) = node.get_bounds(); - let is_prefix = source.contents()[start] == op.as_bytes()[0]; - let replacements: Vec<&str> = if is_prefix { prefix_ops } else { suffix_ops } +fn unary_op_replacement( + op: &MutationType, + file_resolver: &FileResolver, + namespace: Rc, + expr: &Expression, + source: &Arc, +) -> Vec { + let loc = expr.loc(); + + if loc.try_file_no().is_none() { + return vec![]; + } + let muts = match expr { + Expression::BitwiseNot { .. } | Expression::Negate { .. } => { + let unary_op = get_operator(expr); + let replacements: Vec<&&str> = ["-", "~"].iter().filter(|x| **x != unary_op).collect(); + let op_loc = get_op_loc(expr, source); + if let Some(op_loc) = op_loc { + let muts = replacements .iter() - .filter(|v| !op.eq(*v)) - .copied() + .map(|r| { + Mutant::new( + file_resolver, + namespace.clone(), + op_loc, + *op, + unary_op.to_string(), + r.to_string(), + ) + }) .collect(); - let (start, end) = if is_prefix { - (start, start + op.len()) - } else { - (end - op.len(), end) - }; - - replacements - .iter() - .map(|r| Mutant::new(source.clone(), *self, start, end, r.to_string())) - .collect() + muts + } else { + vec![] } } + _ => vec![], + }; + muts +} + +#[allow(dead_code)] +fn elim_delegate_mutation( + op: &MutationType, + file_resolver: &FileResolver, + namespace: Rc, + expr: &Expression, + source: &Arc, +) -> Vec { + // TODO: implement + match expr { + Expression::ExternalFunctionCallRaw { + loc, + ty: CallTy::Delegate, + address, + .. + } => { + // Ugh, okay, so we need to do messy string manipulation to get the + // location of the function name because that isn't tracked in the + // AST. The idea is that we start scanning from the right of the + // address (e.g., `foo` in `foo.bar()`), and look for the first + // index of `delegatecall`. We then add an offset of 12 (length of + // "delegatecall"). + let addr_loc = address.loc(); + let idx = addr_loc.end() + 1; + let no_address = &source[idx..loc.end()]; + let delegate_call_start = idx + no_address.find("delegatecall").unwrap(); + let delegate_call_end = delegate_call_start + 12; + + vec![Mutant::new( + file_resolver, + namespace, + Loc::File(loc.file_no(), delegate_call_start, delegate_call_end), + *op, + "delegatecall".to_string(), + "call".to_string(), + )] + } + _ => vec![], } } -impl MutationType { - pub fn default_mutation_operators() -> Vec { - vec![ - MutationType::AssignmentMutation, - MutationType::BinaryOpMutation, - MutationType::DeleteExpressionMutation, - MutationType::ElimDelegateMutation, - MutationType::FunctionCallMutation, - MutationType::IfStatementMutation, - MutationType::RequireMutation, - // MutationType::SwapArgumentsFunctionMutation, - MutationType::SwapArgumentsOperatorMutation, - MutationType::UnaryOperatorMutation, - ] +fn defaults_by_type(ty: &Type) -> Vec<&str> { + match ty { + Type::Bool => vec!["true", "false"], + Type::Int(_) => vec!["-1", "0", "1"], + Type::Uint(_) => vec!["0", "1"], + _ => vec![], + } +} + +#[allow(dead_code)] +fn expression_value_replacement( + op: &MutationType, + file_resolver: &FileResolver, + namespace: Rc, + expr: &Expression, + source: &Arc, +) -> Vec { + // TODO: implement + let replacements = match expr { + Expression::Add { ty, .. } + | Expression::Subtract { ty, .. } + | Expression::Multiply { ty, .. } + | Expression::Divide { ty, .. } + | Expression::Modulo { ty, .. } + | Expression::Power { ty, .. } + | Expression::BitwiseOr { ty, .. } + | Expression::BitwiseAnd { ty, .. } + | Expression::BitwiseXor { ty, .. } + | Expression::ShiftLeft { ty, .. } + | Expression::ShiftRight { ty, .. } + | Expression::ConstantVariable { ty, .. } + | Expression::StorageVariable { ty, .. } + | Expression::Load { ty, .. } + | Expression::GetRef { ty, .. } + | Expression::BitwiseNot { ty, .. } + | Expression::Negate { ty, .. } + | Expression::ConditionalOperator { ty, .. } + | Expression::StorageLoad { ty, .. } => defaults_by_type(ty), + Expression::Variable { ty, .. } => defaults_by_type(ty), + + Expression::ZeroExt { to, .. } + | Expression::Cast { to, .. } + | Expression::BytesCast { to, .. } + | Expression::CheckingTrunc { to, .. } + | Expression::Trunc { to, .. } + | Expression::SignExt { to, .. } => defaults_by_type(to), + + Expression::More { .. } + | Expression::Less { .. } + | Expression::MoreEqual { .. } + | Expression::LessEqual { .. } + | Expression::Equal { .. } + | Expression::NotEqual { .. } + | Expression::Not { .. } + | Expression::Or { .. } + | Expression::And { .. } => defaults_by_type(&Type::Bool), + + Expression::InternalFunctionCall { returns, .. } + | Expression::ExternalFunctionCall { returns, .. } => match &returns[..] { + [ty] => defaults_by_type(ty), + _ => vec![], + }, + + _ => vec![], + }; + let mut mutants = vec![]; + let loc = expr.loc(); + let expr_start = loc.start(); + let expr_end = loc.end(); + let expr_string = &source[expr_start..expr_end]; + + for r in replacements { + mutants.push(Mutant::new( + file_resolver, + namespace.clone(), + loc, + *op, + expr_string.to_string(), + r.to_string(), + )); } + mutants } /// This testing module defines and uses the testing infrastructure, allowing @@ -486,86 +1207,16 @@ impl MutationType { #[cfg(test)] mod test { use crate::test_util::*; - use crate::{MutationType, MutationType::*, Mutator, MutatorConf, Solc, Source}; + use crate::{MutationType, Mutator, MutatorConf, Solc}; + use solang::file_resolver::FileResolver; use std::collections::HashSet; + use std::error; use std::path::PathBuf; - use std::rc::Rc; - use std::{error, path::Path}; use tempfile::Builder; - #[test] - pub fn test_assignment_mutation() -> Result<(), Box> { - let ops = vec![AssignmentMutation]; - assert_exact_mutants_for_statements( - &vec!["uint256 x;", "x = 3;"], - &ops, - &vec!["(-1)", "0", "1"], - ); - assert_exact_mutants_for_statements(&vec!["int256 x;", "x = 1;"], &ops, &vec!["(-1)", "0"]); - assert_exact_mutants_for_statements(&vec!["int256 x;", "x = 0;"], &ops, &vec!["(-1)", "1"]); - // FIXME: The following three test cases are BROKEN!! Currently these - // all get mutated to [-1, 1, 0, false, true] because they are not - // 'number's. Validation would strip out the true/false. We would want - // constant propagation to strip out the 0 in `x = -0` - assert_num_mutants_for_statements( - &vec!["int256 x;", "x = -2;"], - &vec![AssignmentMutation], - 5, - ); - assert_num_mutants_for_statements( - &vec!["int256 x;", "x = -1;"], - &vec![AssignmentMutation], - 5, - ); - assert_num_mutants_for_statements( - &vec!["int256 x;", "x = -0;"], - &vec![AssignmentMutation], - 5, - ); - - assert_exact_mutants_for_statements(&vec!["bool b;", "b = true;"], &ops, &vec!["false"]); - assert_exact_mutants_for_statements(&vec!["bool b;", "b = false;"], &ops, &vec!["true"]); - - Ok(()) - } - - #[test] - pub fn test_binary_op_mutation() -> Result<(), Box> { - let ops = vec![BinaryOpMutation]; - let repls = vec!["+", "-", "*", "/", "%", "**"]; - // Closure to drop the given operator for he set of replacements - let without = |s: &str| { - let r: Vec<&str> = repls - .iter() - .filter(|r| !s.eq(**r)) - .map(|s| s.clone()) - .collect(); - r - }; - assert_exact_mutants_for_statements(&vec!["uint256 x = 1 + 2;"], &ops, &without("+")); - assert_exact_mutants_for_statements(&vec!["uint256 x = 2 - 1;"], &ops, &without("-")); - assert_exact_mutants_for_statements(&vec!["uint256 x = 1 * 2;"], &ops, &without("*")); - assert_exact_mutants_for_statements(&vec!["uint256 x = 2 / 1;"], &ops, &without("/")); - assert_exact_mutants_for_statements(&vec!["uint256 x = 1 % 2;"], &ops, &without("%")); - assert_exact_mutants_for_statements(&vec!["uint256 x = 1 ** 2;"], &ops, &without("**")); - Ok(()) - } - - #[test] - pub fn test_delete_expression_mutation() -> Result<(), Box> { - let ops = vec![DeleteExpressionMutation]; - assert_exact_mutants_for_statements(&vec!["gasleft();"], &ops, &vec!["assert(true)"]); - assert_exact_mutants_for_statements( - &vec!["uint256 x = 0;", "x = 3;"], - &ops, - &vec!["assert(true)"], - ); - Ok(()) - } - #[test] pub fn test_elim_delegate_mutation() -> Result<(), Box> { - let _ops = vec![ElimDelegateMutation]; + let ops = vec![MutationType::ElimDelegateCall]; // TODO: how should I test this? let code = "\ // SPDX-License-Identifier: GPL-3.0-only @@ -577,6 +1228,8 @@ contract B { uint public value; function setVars(uint _num) public payable { + uint c = 1 + 2; + num = _num; sender = msg.sender; value = msg.value; @@ -600,168 +1253,373 @@ contract A { } } "; - let ops = vec![MutationType::ElimDelegateMutation]; let expected = vec!["call"]; assert_exact_mutants_for_source(code, &ops, &expected); Ok(()) } #[test] - pub fn test_function_call_mutation() -> Result<(), Box> { - let _ops = vec![FunctionCallMutation]; - // TODO: how should I test this? - Ok(()) + fn test_aor() { + let ops = vec![MutationType::ArithmeticOperatorReplacement]; + assert_exact_mutants_for_statements( + &vec!["uint256 a", "uint256 b"], + &vec!["uint256 c = a + b;"], + &ops, + &vec!["-", "*", "/", "**", "%"], + ); + assert_exact_mutants_for_statements( + &vec!["int256 a", "int256 b"], + &vec!["int256 c = a + b;"], + &ops, + &vec!["-", "*", "/", "%"], + ); + + assert_exact_mutants_for_statements( + &vec!["uint256 a", "uint256 b"], + &vec!["uint256 c = a - b;"], + &ops, + &vec!["+", "*", "/", "**", "%"], + ); + + assert_exact_mutants_for_statements( + &vec!["uint256 a", "uint256 b"], + &vec!["uint256 c = a * b;"], + &ops, + &vec!["+", "-", "/", "**", "%"], + ); + assert_exact_mutants_for_statements( + &vec!["uint256 a", "uint256 b"], + &vec!["uint256 c = a ** b;"], + &ops, + &vec!["+", "-", "/", "*", "%"], + ); + assert_exact_mutants_for_statements( + &vec!["uint256 a", "uint256 b"], + &vec!["uint256 c = a % b;"], + &ops, + &vec!["+", "-", "/", "*", "**"], + ); } #[test] - pub fn test_if_statement_mutation() -> Result<(), Box> { - let ops = vec![IfStatementMutation]; - assert_num_mutants_for_statements( - &vec!["uint256 x;", "if (true) { x = 1; } else { x = 2 ;}"], + fn test_bor() { + let ops = vec![MutationType::BitwiseOperatorReplacement]; + assert_exact_mutants_for_statements( + &vec!["uint256 a", "uint256 b"], + &vec!["uint256 c = a | b;"], &ops, - 1, + &vec!["&"], + ); + + assert_exact_mutants_for_statements( + &vec!["uint256 a", "uint256 b"], + &vec!["uint256 c = a & b;"], + &ops, + &vec!["|"], + ); + + assert_exact_mutants_for_statements( + &vec!["uint256 a", "uint256 b"], + &vec!["uint256 c = a ^ b;"], + &ops, + &vec!["&"], ); - assert_num_mutants_for_statements(&vec!["if (true) {}"], &ops, 1); - Ok(()) } #[test] - pub fn test_require_mutation() -> Result<(), Box> { - let ops = vec![RequireMutation]; - assert_num_mutants_for_statements(&vec!["bool c = true;", "require(c);"], &ops, 2); - assert_num_mutants_for_statements(&vec!["require(true);"], &ops, 1); - assert_num_mutants_for_statements( - &vec!["bool a = true;", "bool b = false;", "require(a && b);"], + fn test_lvr() { + let ops = vec![MutationType::LiteralValueReplacement]; + // Numbers + assert_exact_mutants_for_statements( + &vec!["uint256 a", "uint256 b"], + &vec!["uint256 c = a * b + 11;"], &ops, - 2, + &vec!["0", "12"], ); - Ok(()) + assert_exact_mutants_for_statements( + &vec!["uint256 a", "uint256 b"], + &vec!["uint256 c = a * b + 0;"], + &ops, + &vec!["1"], + ); + assert_exact_mutants_for_statements( + &vec!["int256 a", "int256 b"], + &vec!["int256 c = a * b + 11;"], + &ops, + &vec!["0", "-11", "12"], + ); + assert_exact_mutants_for_statements( + &vec!["int256 a", "int256 b"], + &vec!["int256 c = a * b + 0;"], + &ops, + &vec!["1", "-1"], + ); + + // Booleans + assert_exact_mutants_for_statements(&vec![], &vec!["bool b = true;"], &ops, &vec!["false"]); + assert_exact_mutants_for_statements(&vec![], &vec!["bool b = false;"], &ops, &vec!["true"]); } #[test] - pub fn test_unary_op_mutation() -> Result<(), Box> { - let ops = vec![UnaryOperatorMutation]; - let prefix = vec!["++", "--", "~"]; - let suffix = vec!["++", "--"]; - - // Closure to drop the given operator for he set of replacements - let without_prefix = |s: &str| { - let r: Vec<&str> = prefix - .iter() - .filter(|r| !s.eq(**r)) - .map(|s| s.clone()) - .collect(); - r - }; - let without_suffix = |s: &str| { - let r: Vec<&str> = suffix - .iter() - .filter(|r| !s.eq(**r)) - .map(|s| s.clone()) - .collect(); - r - }; + fn test_lor() { + let ops = vec![MutationType::LogicalOperatorReplacement]; + + assert_exact_mutants_for_statements( + &vec!["bool a", "bool b"], + &vec!["bool c = a || b;"], + &ops, + &vec!["a", "b", "true"], + ); + + assert_exact_mutants_for_statements( + &vec!["bool a", "bool b"], + &vec!["bool c = a && b;"], + &ops, + &vec!["a", "b", "false"], + ); + } + + #[test] + fn test_ror() { + assert_exact_mutants_for_statements( + &vec!["uint256 a", "uint256 b"], + &vec!["if (a < b) {}"], + &vec![MutationType::RelationalOperatorReplacement], + &vec!["<=", "false", "!="], + ); + + assert_exact_mutants_for_statements( + &vec!["uint256 a", "uint256 b"], + &vec!["if (a == b) {}"], + &vec![MutationType::RelationalOperatorReplacement], + &vec!["<=", "false", ">="], + ); + + assert_exact_mutants_for_statements( + &vec!["uint256 a", "uint256 b"], + &vec!["if (a > b) {}"], + &vec![MutationType::RelationalOperatorReplacement], + &vec!["!=", "false", ">="], + ); + + assert_exact_mutants_for_statements( + &vec!["uint256 a", "uint256 b"], + &vec!["if (a <= b) {}"], + &vec![MutationType::RelationalOperatorReplacement], + &vec!["<", "true", "=="], + ); + + assert_exact_mutants_for_statements( + &vec!["uint256 a", "uint256 b"], + &vec!["if (a != b) {}"], + &vec![MutationType::RelationalOperatorReplacement], + &vec!["<", "true", ">"], + ); + + assert_exact_mutants_for_statements( + &vec!["uint256 a", "uint256 b"], + &vec!["if (a >= b) {}"], + &vec![MutationType::RelationalOperatorReplacement], + &vec!["==", "true", ">"], + ); + + assert_exact_mutants_for_statements( + &vec!["bool a", "bool b"], + &vec!["if (a != b) {}"], + &vec![MutationType::RelationalOperatorReplacement], + &vec!["true"], + ); + assert_exact_mutants_for_statements( - &vec!["uint256 a = 10;", "uint256 x = ++a;"], + &vec!["bool a", "bool b"], + &vec!["if (a == b) {}"], + &vec![MutationType::RelationalOperatorReplacement], + &vec!["false"], + ); + } + + #[test] + fn test_std() { + let ops = vec![MutationType::StatementDeletion]; + assert_exact_mutants_for_statements( + &vec!["uint256 a", "uint256 b"], + &vec!["uint256 c = a + b;"], &ops, - &without_prefix("++"), + &vec![], ); assert_exact_mutants_for_statements( - &vec!["uint256 a = 10;", "uint256 x = --a;"], + &vec!["uint256 a", "uint256 b"], + &vec!["uint256 c;", "c = a + b;"], &ops, - &without_prefix("--"), + &vec!["assert(true)"], ); assert_exact_mutants_for_statements( - &vec!["uint256 a = 10;", "uint256 x = ~a;"], + &vec!["bool a"], + &vec!["while (a) { continue; }"], &ops, - &without_prefix("~"), + &vec!["assert(true)"], ); assert_exact_mutants_for_statements( - &vec!["uint256 a = 10;", "uint256 x = a--;"], + &vec!["bool a"], + &vec!["while (a) { break; }"], &ops, - &without_suffix("--"), + &vec!["assert(true)"], ); assert_exact_mutants_for_statements( - &vec!["uint256 a = 10;", "uint256 x = a++;"], + &vec!["bool a"], + &vec!["revert();"], &ops, - &without_suffix("++"), + &vec!["assert(true)"], + ); + // TODO: add a test for `delete expr` + // TODO: add a test for `emit ...` + } + + #[test] + fn test_sor() { + let ops = vec![MutationType::ShiftOperatorReplacement]; + assert_exact_mutants_for_statements( + &vec!["uint256 a", "uint256 b"], + &vec!["uint256 c = a << b;"], + &ops, + &vec![">>"], + ); + + assert_exact_mutants_for_statements( + &vec!["uint256 a", "uint256 b"], + &vec!["uint256 c = a >> b;"], + &ops, + &vec!["<<"], + ); + } + + #[test] + fn test_uor() { + let ops = vec![MutationType::UnaryOperatorReplacement]; + assert_exact_mutants_for_statements( + &vec!["int256 a"], + &vec!["int256 b = -a;"], + &ops, + &vec!["~"], + ); + assert_exact_mutants_for_statements( + &vec!["int256 a"], + &vec!["int256 b = ~a;"], + &ops, + &vec!["-"], ); - Ok(()) } + #[allow(dead_code)] fn assert_num_mutants_for_statements( + params: &Vec<&str>, statements: &Vec<&str>, ops: &Vec, expected: usize, ) { - let mutator = apply_mutation_to_statements(statements, None, ops).unwrap(); + let (mutator, sol_source) = + apply_mutation_to_statements(statements, params, None, ops).unwrap(); assert_eq!( expected, mutator.mutants().len(), "Error: applied ops\n -> {:?}\nto program\n -> {:?}\nat {:?} for more info", ops, statements.join(" "), - mutator - .sources - .iter() - .map(|s| s.filename()) - .collect::>() + sol_source ); } + #[allow(dead_code)] fn assert_exact_mutants_for_statements( + params: &Vec<&str>, statements: &Vec<&str>, ops: &Vec, expected: &Vec<&str>, ) { - let mutator = apply_mutation_to_statements(statements, None, ops).unwrap(); + let (mutator, sol_file) = + apply_mutation_to_statements(statements, params, None, ops).unwrap(); + let expected_set: HashSet<&str> = expected.iter().map(|s| s.trim()).collect(); + let actuals_set: HashSet<&str> = mutator + .mutants() + .iter() + .map(|m| m.repl.as_str().trim()) + .collect(); + let expected_str = expected_set + .iter() + .cloned() + .collect::>() + .join(", "); + let actuals_str = actuals_set + .iter() + .cloned() + .collect::>() + .join(", "); + let program = + ansi_term::Color::Yellow.paint(format!("```\n{}\n```", statements.join(";\n"))); assert_eq!( expected.len(), mutator.mutants().len(), - "Error: applied ops\n -> {:?}\nto program\n -> {:?}\nat {:?} for more info", + "Error: applied ops: + -> {:?} + to program:\n{}\n + [+] Expected mutants: {} + [X] Actual mutants: {} + See {} for more info", ops, - statements.join(" "), - mutator - .sources - .iter() - .map(|s| s.filename()) - .collect::>() + program, + ansi_term::Color::Green.paint(expected_str), + ansi_term::Color::Red.paint(actuals_str), + sol_file ); - let actuals: HashSet<&str> = mutator.mutants().iter().map(|m| m.repl.as_str()).collect(); - let expected: HashSet<&str> = expected.iter().map(|s| *s).collect(); - assert_eq!(actuals, expected); + assert_eq!( + actuals_set, + expected_set, + "Error: applied ops: + -> {:?} + to program:\n{}\n + [+] Expected mutants: {} + [X] Actual mutants: {} + See {} for more info", + ops, + program, + ansi_term::Color::Green.paint(expected_str), + ansi_term::Color::Red.paint(actuals_str), + sol_file + ); } fn apply_mutation_to_statements( statements: &Vec<&str>, + params: &Vec<&str>, returns: Option<&str>, ops: &Vec, - ) -> Result> { - let source = wrap_and_write_solidity_to_temp_file(statements, returns).unwrap(); + ) -> Result<(Mutator, String), Box> { + let source = wrap_and_write_solidity_to_temp_file(statements, params, returns).unwrap(); + let prefix = format!( + "gambit-compile-dir-{}", + source.file_name().unwrap().to_str().unwrap() + ); let outdir = Builder::new() - .prefix("gambit-compile-dir") + .prefix(prefix.as_str()) .rand_bytes(5) - .tempdir()?; - let mut mutator = make_mutator(ops, source, outdir.into_path()); - mutator.mutate()?; + .tempdir_in(source.parent().unwrap())?; + let mut mutator = make_mutator(ops, &vec![], outdir.into_path()); + let source_name = source.to_str().unwrap().to_string(); + mutator.mutate(vec![source_name.clone()])?; - Ok(mutator) + Ok((mutator, source_name)) } fn _assert_num_mutants_for_source(source: &str, ops: &Vec, expected: usize) { - let mutator = apply_mutation_to_source(source, ops).unwrap(); + let (mutator, sol_file) = apply_mutation_to_source(source, ops).unwrap(); assert_eq!( expected, mutator.mutants().len(), "Error: applied ops\n -> {:?}\nto program\n -> {:?}\n\nSee {:?} for more info", ops, source, - mutator - .sources - .iter() - .map(|s| s.filename()) - .collect::>() + sol_file ); } @@ -770,18 +1628,14 @@ contract A { ops: &Vec, expected: &Vec<&str>, ) { - let mutator = apply_mutation_to_source(source, ops).unwrap(); + let (mutator, sol_file) = apply_mutation_to_source(source, ops).unwrap(); assert_eq!( expected.len(), mutator.mutants().len(), - "Error: applied ops\n -> {:?}\nto program\n -> {:?}\nat {:?} for more info", + "Error: applied ops\n -> {:?}\nto program\n -> {:?}\nat {} for more info", ops, source, - mutator - .sources - .iter() - .map(|s| s.filename()) - .collect::>() + sol_file ); let actuals: HashSet<&str> = mutator.mutants().iter().map(|m| m.repl.as_str()).collect(); @@ -792,32 +1646,37 @@ contract A { fn apply_mutation_to_source( source: &str, ops: &Vec, - ) -> Result> { + ) -> Result<(Mutator, String), Box> { let source = write_solidity_to_temp_file(source.to_string()).unwrap(); + let source_filename = source.to_str().unwrap().to_string(); let outdir = Builder::new() .prefix("gambit-compile-dir") .rand_bytes(5) .tempdir()?; - let mut mutator = make_mutator(ops, source, outdir.into_path()); - mutator.mutate()?; + let mut mutator = make_mutator(ops, &vec![], outdir.into_path()); + mutator.file_resolver.add_import_path(&PathBuf::from("/")); + mutator.mutate(vec![source_filename.clone()])?; - Ok(mutator) + Ok((mutator, source_filename)) } /// Create a mutator for a single file, creating required components (e.g., /// Solc, creating Sources and rapping them in a Vec>, etc) - fn make_mutator(ops: &Vec, filename: PathBuf, outdir: PathBuf) -> Mutator { + fn make_mutator( + ops: &Vec, + fallback: &Vec, + outdir: PathBuf, + ) -> Mutator { let conf = MutatorConf { mutation_operators: ops.clone(), + fallback_operators: fallback.clone(), funcs_to_mutate: None, contract: None, }; - let sourceroot = filename.parent().unwrap(); - let source = Source::new(filename.clone(), sourceroot.to_path_buf()) - .expect(format!("Could not build source from {}", filename.display()).as_str()); - let sources = vec![Rc::new(source)]; let solc = Solc::new("solc".into(), PathBuf::from(outdir)); - Mutator::new(conf, sources, solc) + let mut cache = FileResolver::default(); + cache.add_import_path(&PathBuf::from("")); + Mutator::new(conf, cache, solc) } } diff --git a/src/mutator.rs b/src/mutator.rs index 6d05831..53aef9d 100644 --- a/src/mutator.rs +++ b/src/mutator.rs @@ -1,10 +1,24 @@ use crate::{ - default_gambit_output_directory, mutation::MutationType, source::Source, Mutant, MutantWriter, - MutateParams, Mutation, SolAST, SolASTVisitor, Solc, + default_gambit_output_directory, get_vfs_path, mutation::MutationType, + normalize_mutation_operator_name, print_error, print_warning, Mutant, MutateParams, Mutation, + Solc, }; use clap::ValueEnum; -use std::{error, path::PathBuf, rc::Rc}; -use tempfile::{tempdir, NamedTempFile}; +use solang::{ + file_resolver::FileResolver, + parse_and_resolve, + sema::{ + ast::{Expression, Namespace, Statement}, + Recurse, + }, +}; +use solang_parser::pt::CodeLocation; +use std::{ + error, + ffi::{OsStr, OsString}, + path::PathBuf, + rc::Rc, +}; /// This module is responsible for high level logic of running mutation over /// Solidity programs. @@ -15,6 +29,12 @@ pub struct MutatorConf { /// Mutation operators to apply during mutation pub mutation_operators: Vec, + /// Operators to use when an expression or statement didn't + /// otherwise mutate. These act as a fallback to help ensure + /// a given program point is mutated without creating too many + /// mutants. + pub fallback_operators: Vec, + /// If this is `Some(fnames)` then only mutate functions with names in /// `fnames`. If this is `None` then mutate all function names pub funcs_to_mutate: Option>, @@ -29,15 +49,26 @@ impl From<&MutateParams> for MutatorConf { let mutation_operators = if let Some(ops) = &mutate_params.mutations { ops.iter() .map(|op| { - MutationType::from_str(op.as_str(), true) + MutationType::from_str(normalize_mutation_operator_name(op).as_str(), true) .unwrap_or_else(|_| panic!("Unrecognized mutation operator {op}")) }) .collect() } else { MutationType::default_mutation_operators() }; + let fallback_operators = if let Some(ops) = &mutate_params.fallback_mutations { + ops.iter() + .map(|op| { + MutationType::from_str(normalize_mutation_operator_name(op).as_str(), true) + .unwrap_or_else(|_| panic!("Unrecognized mutation operator {op}")) + }) + .collect() + } else { + MutationType::default_fallback_mutation_operators() + }; MutatorConf { mutation_operators, + fallback_operators, funcs_to_mutate: mutate_params.functions.clone(), contract: mutate_params.contract.clone(), } @@ -45,116 +76,147 @@ impl From<&MutateParams> for MutatorConf { } /// The mutator performs the actual logic of mutating a program, writes -#[derive(Debug)] pub struct Mutator { /// Configuration for this mutator pub conf: MutatorConf, - /// The original sources - pub sources: Vec>, - /// The mutants, in order of generation pub mutants: Vec, - /// Solc configuration - solc: Solc, + /// The file resolver + pub file_resolver: FileResolver, + + /// The namespace being mutated + pub namespace: Option>, /// A temporary directory to store intermediate work _tmp: PathBuf, } +impl std::fmt::Debug for Mutator { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + f.debug_struct("Mutator") + .field("conf", &self.conf) + .field("mutants", &self.mutants) + .field("_tmp", &self._tmp) + .finish() + } +} + impl From<&MutateParams> for Mutator { - fn from(value: &MutateParams) -> Self { - let conf = MutatorConf::from(value); + fn from(params: &MutateParams) -> Self { + let conf = MutatorConf::from(params); let mut solc = Solc::new( - value.solc.clone(), - value + params.solc.clone().unwrap_or_else(|| "solc".to_string()), + params .outdir .clone() .unwrap_or(default_gambit_output_directory()) .into(), ); - solc.with_optimize(value.solc_optimize); - if let Some(basepath) = value.solc_base_path.clone() { - solc.with_basepath(basepath); + solc.with_optimize(params.solc_optimize); + + if params.solc_base_path.is_some() { + print_warning( + "Invalid MutateParams: solc_base_path", + "solc_base_path is ignored. Use import_paths instead", + ); } - if let Some(allowpaths) = value.solc_allow_paths.clone() { - solc.with_allow_paths(allowpaths); + + if params.solc_remappings.is_some() { + print_warning( + "Invalid MutateParams: solc_remappings", + "solc_remappings is ignored. Use import_maps instead", + ); } - if let Some(remappings) = value.solc_remappings.clone() { - solc.with_remappings(remappings); + + if let Some(allowpaths) = params.solc_allow_paths.clone() { + solc.with_allow_paths(allowpaths); } - let sourceroot = match &value.sourceroot { - Some(sourceroot) => PathBuf::from(sourceroot), - None => { - // Attempt to use CWD as the sourceroot. Ensuer that the - // filename belongs to (is prefixed by) the sourceroot - let sourceroot = PathBuf::from(".").canonicalize().unwrap(); - let filename = &value - .filename - .as_ref() - .unwrap_or_else(|| panic!("Found unresolved filename in params: {:?}", value)); - let filepath = PathBuf::from(filename).canonicalize().unwrap(); - if !&filepath.starts_with(&sourceroot) { - panic!("Unresolved sourceroot! Attempted to use the current working directory {} but filename {} was not a descendent.", sourceroot.display(), filepath.display()); - } + // Every mutator has a FileResolver. A FileResolver is a solang-provided + // struct that resolves files, performs import resolution, and then + // performs type resolution. + let mut file_resolver = FileResolver::default(); - sourceroot + // Add import paths to file resolver + if params.import_paths.is_empty() { + print_error( + "No import paths found", + "Tried to create a Mutator without an import path", + ); + std::process::exit(1); + } else { + for import_path in params.import_paths.iter() { + file_resolver.add_import_path(&PathBuf::from(import_path)); } - }; + } + + // Add any remappings to file resolver + for rm in ¶ms.import_maps { + let split_rm: Vec<&str> = rm.split('=').collect(); + if split_rm.len() != 2 { + panic!("Invalid remapping: {}", rm); + } + let map = split_rm[0]; + let target = split_rm[1]; + + file_resolver.add_import_map(OsString::from(map), target.into()); + } - let mut sources: Vec> = vec![]; - if let Some(filename) = &value.filename { - log::info!("Creating Source from filename: {}", filename); - sources.push(Rc::new( - Source::new(filename.into(), sourceroot) - .unwrap_or_else(|_| panic!("Couldn't read source {}", filename)), - )) + if let Some(allow_paths) = ¶ms.solc_allow_paths { + for allow_path in allow_paths.iter() { + file_resolver.add_import_path(&PathBuf::from(allow_path)); + } } - Mutator::new(conf, sources, solc) + + Mutator::new(conf, file_resolver, solc) } } impl Mutator { - pub fn new(conf: MutatorConf, sources: Vec>, solc: Solc) -> Mutator { + pub fn new(conf: MutatorConf, file_resolver: FileResolver, solc: Solc) -> Mutator { log::info!( - "Creating mutator:\n conf: {:#?}\n sources: {:?}\n solc: {:#?}", + "Creating mutator:\n conf: {:#?}\n solc: {:#?}", conf, - sources, solc ); Mutator { conf, - sources, mutants: vec![], - solc, + file_resolver, + namespace: None, _tmp: "".into(), } } + pub fn mutation_operators(&self) -> &[MutationType] { + self.conf.mutation_operators.as_slice() + } + + pub fn fallback_mutation_operators(&self) -> &[MutationType] { + self.conf.fallback_operators.as_slice() + } + /// Run all mutations! This is the main external entry point into mutation. - /// This function: - /// - /// 1. Mutates each file - /// 2. TODO: Optionally validates (default: yes) all generated/filtered mutants - /// - /// and returns a Vec of mutants. These are not yet written to disk, and can - /// be further validated, suppressed, and downsampled as desired. - pub fn mutate(&mut self) -> Result<&Vec, Box> { + /// This function mutates each file and returns a Vec of mutants. These are + /// not yet written to disk, and can be further validated, suppressed, and + /// downsampled as desired. + pub fn mutate( + &mut self, + filenames: Vec, + ) -> Result<&Vec, Box> { let mut mutants: Vec = vec![]; - let solc = &self.solc; - for source in self.sources.iter() { - log::info!("Mutating source {}", source.filename().display()); + for filename in filenames.iter() { + log::info!("Mutating file {}", filename); - match self.mutate_file(source.clone(), solc) { - Ok(mut file_mutants) => { - log::info!(" Generated {} mutants from source", file_mutants.len()); - mutants.append(&mut file_mutants); + match self.mutate_file(filename) { + Ok(file_mutants) => { + log::info!(" Generated {} mutants from file", file_mutants.len()); } Err(e) => { - log::warn!("Couldn't mutate source {}", source.filename().display()); + log::warn!("Couldn't mutate file {}", filename); log::warn!("Encountered error: {}", e); } } @@ -165,31 +227,103 @@ impl Mutator { } /// Mutate a single file. - fn mutate_file( - &self, - source: Rc, - solc: &Solc, - ) -> Result, Box> { - let ast = solc.compile_ast(source.filename())?; - if !solc.output_directory().exists() { - log::debug!( - "[Pre traverse] Output directory {} doesn't exist!", - solc.output_directory().display() - ); + fn mutate_file(&mut self, filename: &String) -> Result, Box> { + // Check if we can mutate path + let vfs_path = get_vfs_path(&self.file_resolver, &PathBuf::from(filename)); + if vfs_path.is_none() { + let import_paths: Vec = self + .file_resolver + .get_import_paths() + .iter() + .map(|p| p.1.to_str().unwrap().to_string()) + .collect(); + print_error("File Not In Import Paths", format!("Could not mutate file {}:\nFile could not be resolved against any provided import paths.\nImport Paths: {:?}", filename, import_paths).as_str()); + std::process::exit(1); } - let result = ast.traverse(self, source).into_iter().flatten().collect(); - if !solc.output_directory().exists() { - log::debug!( - "[Post traverse] Output directory {} doesn't exist!", - solc.output_directory().display() - ); + log::info!("Parsing file {}", filename); + let os_filename = OsStr::new(filename); + let ns = Rc::new(parse_and_resolve( + os_filename, + &mut self.file_resolver, + solang::Target::EVM, + )); + log::info!("Parsed namespace with:"); + log::info!(" {} files", ns.files.len()); + log::info!(" {} contracts", ns.contracts.len()); + log::info!(" {} functions", ns.functions.len()); + + if ns.diagnostics.any_errors() { + ns.print_diagnostics(&self.file_resolver, false); + return Err("error".into()); } - Ok(result) - } - /// Check if a node in the AST is an assert. - pub fn is_assert_call(node: &SolAST) -> bool { - node.name().map_or_else(|| false, |n| n == "assert") + self.namespace = Some(ns.clone()); + + let resolved = match self.file_resolver.resolve_file(None, os_filename) { + Ok(resolved) => resolved, + Err(e) => { + print_error( + format!("Unable to resolve filename {}", filename).as_str(), + format!("Found error {}", e).as_str(), + ); + std::process::exit(1) + } + }; + + let file_path = resolved.full_path.clone(); + // mutate functions + for function in ns.functions.iter() { + let start_no_mutants = self.mutants.len(); + let file = ns.files.get(function.loc.file_no()); + match file { + Some(file) => { + if file.path != file_path { + continue; + } + } + None => { + continue; + } + } + if function.is_accessor || !function.has_body { + continue; + } + let contract = if let Some(contract_no) = function.contract_no { + let contract = ns.contracts.get(contract_no).unwrap(); + Some(contract.name.to_string()) + } else { + None + }; + + let contract_name = contract.unwrap_or_default(); + let function_name = function.name.clone(); + if let Some(ref funcs_to_mutate) = self.conf.funcs_to_mutate { + if !funcs_to_mutate.contains(&function_name) { + continue; + } + } + if let Some(ref contract_to_mutate) = self.conf.contract { + if &contract_name != contract_to_mutate { + continue; + } + } + + log::info!( + "Processing function body for {}::{}...", + contract_name, + &function.signature + ); + for statement in function.body.iter() { + statement.recurse(self, mutate_statement); + } + let end_no_mutants = self.mutants.len(); + log::info!( + " ...generated {} mutants", + end_no_mutants - start_no_mutants + ); + } + self.namespace = None; + Ok(self.mutants.clone()) } /// Get a slice of the mutants produced by this mutator @@ -197,85 +331,158 @@ impl Mutator { &self.mutants } - pub fn sources(&self) -> &Vec> { - &self.sources - } - - pub fn solc(&self) -> &Solc { - &self.solc + /// Apply all regular mutation operators to an expression, and add those + /// mutants to self.mutants. Return the slice of new mutants + pub fn apply_operators_to_expression(&mut self, expr: &Expression) -> &[Mutant] { + let num_mutants_at_start = self.mutants.len(); + if expr.loc().try_file_no().is_some() { + let mut mutants = vec![]; + for op in self.mutation_operators() { + if op.is_fallback_mutation(self) { + continue; + } + mutants.append(&mut op.mutate_expression(self, expr)); + } + self.mutants.append(&mut mutants); + } + &self.mutants[num_mutants_at_start..self.mutants.len()] } - /// validate a mutant by writing it to disk and compiling it. If compilation - /// fails then this is an invalid mutant. - pub fn validate_mutant(&self, mutant: &Mutant) -> Result> { - let source_filename = mutant.source.filename(); - let source_parent_dir = source_filename.parent().unwrap(); - let mutant_file = NamedTempFile::new_in(source_parent_dir)?; - let mutant_file_path = mutant_file.path(); - log::debug!( - "Validating mutant of {}: copying mutated code to {}", - source_filename.display(), - mutant_file_path.display() - ); - let dir = tempdir()?; - MutantWriter::write_mutant_to_file(mutant_file_path, mutant)?; - let code = match self.solc().compile(mutant_file_path, dir.path()) { - Ok((code, _, _)) => code == 0, - Err(_) => false, - }; - Ok(code) + /// Apply all fallback mutation operators to an expression, and add those + /// mutants to self.mutants. Return the slice of new mutants + pub fn apply_fallback_operators_to_expression(&mut self, expr: &Expression) -> &[Mutant] { + let num_mutants_at_start = self.mutants.len(); + if expr.loc().try_file_no().is_some() { + let mut mutants = vec![]; + for op in self.fallback_mutation_operators() { + mutants.append(&mut op.mutate_expression_fallback(self, expr)); + } + self.mutants.append(&mut mutants); + } + &self.mutants[num_mutants_at_start..self.mutants.len()] } - pub fn get_valid_mutants(&self, mutants: &[Mutant]) -> Vec { - log::info!("Validating mutants..."); - let mut valid_mutants = vec![]; - for m in mutants.iter() { - if let Ok(true) = self.validate_mutant(m) { - valid_mutants.push(m.clone()) + /// Apply all regular mutation operators to a statement, and add those + /// mutants to self.mutants. Return the slice of new mutants + pub fn apply_operators_to_statement(&mut self, stmt: &Statement) -> &[Mutant] { + let num_mutants_at_start = self.mutants.len(); + if stmt.loc().try_file_no().is_some() { + let mut mutants = vec![]; + for op in self.mutation_operators() { + mutants.append(&mut op.mutate_statement(self, stmt)); } + self.mutants.append(&mut mutants); } - valid_mutants + &self.mutants[num_mutants_at_start..self.mutants.len()] } } -impl SolASTVisitor, Vec> for Mutator { - fn skip_node(&self, node: &SolAST, _source: &Rc) -> bool { - if let Some(e) = &node.element { - if let Some(e_obj) = e.as_object() { - if e_obj.contains_key("contractKind") { - let contract_name = e_obj.get("name").unwrap(); - if let Some(contract) = &self.conf.contract { - return contract != contract_name.as_str().unwrap(); - } else { - return false; +pub fn mutate_statement(statement: &Statement, mutator: &mut Mutator) -> bool { + mutator.apply_operators_to_statement(statement); + let num_mutants_before_expr_mutate = mutator.mutants.len(); + match statement { + Statement::Block { .. } => true, + Statement::VariableDecl(_, _, _, expr) => { + match expr { + Some(e) => { + e.recurse(mutator, mutate_expression); + if mutator.mutants.len() == num_mutants_before_expr_mutate { + perform_fallback_mutations(e, mutator); } - } else if node.node_kind() == Some("function".to_string()) { - match &self.conf.funcs_to_mutate { - Some(fns) => { - if let Some(name) = node.name() { - return !fns.contains(&name); - } - return true; - } - None => { - return false; + } + None => (), + } + + true + } + + Statement::If(_, _, c, _, _) => { + c.recurse(mutator, mutate_expression); + if mutator.mutants.len() == num_mutants_before_expr_mutate { + perform_fallback_mutations(c, mutator); + } + true + } + Statement::While(_, _, c, _) => { + c.recurse(mutator, mutate_expression); + if mutator.mutants.len() == num_mutants_before_expr_mutate { + perform_fallback_mutations(c, mutator); + } + true + } + Statement::For { cond, .. } => { + if let Some(cond) = cond { + cond.recurse(mutator, mutate_expression); + if mutator.mutants.len() == num_mutants_before_expr_mutate { + perform_fallback_mutations(cond, mutator); + } + } + true + } + Statement::DoWhile(_, _, _, c) => { + c.recurse(mutator, mutate_expression); + if mutator.mutants.len() == num_mutants_before_expr_mutate { + perform_fallback_mutations(c, mutator); + } + true + } + Statement::Expression(_, _, e) => { + e.recurse(mutator, mutate_expression); + if mutator.mutants.len() == num_mutants_before_expr_mutate { + match e { + Expression::PreIncrement { .. } + | Expression::PreDecrement { .. } + | Expression::PostIncrement { .. } + | Expression::PostDecrement { .. } => (), + + Expression::Assign { right, .. } => perform_fallback_mutations(right, mutator), + + Expression::Constructor { args, .. } + | Expression::Builtin { args, .. } + | Expression::InternalFunctionCall { args, .. } + | Expression::ExternalFunctionCall { args, .. } => { + for arg in args { + perform_fallback_mutations(arg, mutator); } } + Expression::ExternalFunctionCallRaw { .. } => (), + _ => (), } + perform_fallback_mutations(e, mutator); } + true } - false + Statement::Delete(_, _, e) | Statement::Destructure(_, _, e) => { + e.recurse(mutator, mutate_expression); + if mutator.mutants.len() == num_mutants_before_expr_mutate { + perform_fallback_mutations(e, mutator); + } + true + } + Statement::Continue(_) => true, + Statement::Break(_) => true, + Statement::Return(_, rv) => { + if let Some(rv) = rv { + rv.recurse(mutator, mutate_expression); + if mutator.mutants.len() == num_mutants_before_expr_mutate { + perform_fallback_mutations(rv, mutator); + } + } + true + } + Statement::Revert { .. } => true, + Statement::Emit { .. } => true, + Statement::TryCatch(_, _, _) => true, + Statement::Underscore(_) => false, + Statement::Assembly(_, _) => false, } +} - fn visit_node(&self, node: &SolAST, arg: &Rc) -> Option> { - let op_node_pairs: Vec = self - .conf - .mutation_operators - .iter() - .filter(|m| m.applies_to(node)) - .flat_map(|m| m.mutate(node, arg.clone())) - .collect(); +pub fn mutate_expression(expr: &Expression, mutator: &mut Mutator) -> bool { + mutator.apply_operators_to_expression(expr); + true +} - Some(op_node_pairs) - } +pub fn perform_fallback_mutations(expr: &Expression, mutator: &mut Mutator) { + mutator.apply_fallback_operators_to_expression(expr); } diff --git a/src/source.rs b/src/source.rs deleted file mode 100644 index 2826f57..0000000 --- a/src/source.rs +++ /dev/null @@ -1,113 +0,0 @@ -use crate::{read_source, simplify_path, util}; -use std::{ - error, fmt, - path::{Path, PathBuf}, -}; - -#[derive(Debug)] -pub enum SourceError { - /// Indicate an out of bound position in a source file - PositionOutOfBoundsError(usize, String), - /// Indicate that we couldn't find a line/column number at a given position for a source file - LineColumnLookupError(usize, String), -} - -impl fmt::Display for SourceError { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - write!(f, "SourceError") - } -} - -impl error::Error for SourceError {} - -/// A source file, including its name, contents, and source root, to be mutated. -pub struct Source { - filename: PathBuf, - sourceroot: PathBuf, - contents: Vec, - newlines: Vec, -} - -impl std::fmt::Debug for Source { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { - f.debug_struct("Source") - .field("filename", &self.filename) - .field("sourceroot", &self.sourceroot) - .field("contents", &String::from("[...]")) - .field("newlines", &String::from("[...]")) - .finish() - } -} - -impl Source { - pub fn new(filename: PathBuf, sourceroot: PathBuf) -> Result> { - let filename = simplify_path(&filename)?; - let contents = read_source(&filename)?; - let newlines: Vec = contents - .iter() - .enumerate() - .filter(|(_, c)| **c == b'\n') - .map(|(i, _)| i + 2) - .collect(); - - Ok(Source { - filename, - sourceroot, - contents, - newlines, - }) - } - - /// Get the filename of this source - pub fn filename(&self) -> &Path { - self.filename.as_path() - } - - /// Get the filename of this source as a string - pub fn filename_as_str(&self) -> String { - self.filename.to_str().unwrap().into() - } - - pub fn relative_filename(&self) -> Result> { - util::rel_path_from_base(self.filename.as_path(), self.sourceroot.as_path()) - } - - /// Get the contents of this source, computing from `filename` if necessary - pub fn contents(&self) -> &[u8] { - &self.contents - } - - /// Get the sourceroot for this source file - pub fn sourceroot(&self) -> &Path { - self.sourceroot.as_path() - } - - /// Get a (line, column) pair that represents which line and column this - /// mutant occurs at. Lines and columns are both 1-indexed. - pub fn get_line_column(&self, pos: usize) -> Result<(usize, usize), Box> { - if pos >= self.contents.len() { - return Err(Box::new(SourceError::PositionOutOfBoundsError( - pos, - self.filename_as_str(), - ))); - } - - let newlines = &self.newlines; - if let Some((lineno, nlpos)) = newlines - .iter() - .enumerate() - .rev() - .find(|(_, nlpos)| nlpos < &&pos) - { - let columnno = pos - nlpos + 2; - Ok((lineno + 2, columnno)) - } else if &pos < newlines.first().unwrap() { - Ok((1, pos + 1)) - } else { - Err(Box::new(SourceError::LineColumnLookupError( - pos, - self.filename_as_str(), - ))) - } - } -} diff --git a/src/summary.rs b/src/summary.rs index acf32a7..f387298 100644 --- a/src/summary.rs +++ b/src/summary.rs @@ -1,22 +1,57 @@ -use std::{collections::HashSet, error, path::PathBuf}; +use std::{ + collections::{HashMap, HashSet}, + error, + path::PathBuf, +}; use serde_json::Value; -use crate::SummaryParams; +use crate::{print_experimental_feature_warning, SummaryParams}; + +struct MutantSummaryEntry { + mid: String, + mutant_export_location: String, + diff: String, + op_long: String, + op_short: String, + line: String, + col: String, + orig: String, + repl: String, +} + +/// How should summary operate? +pub enum SummaryMode { + /// Print high level stats and exit + PrintStatistics, + /// Print MIDs specified by `--mids` flag + PrintSomeMids(Vec), + /// Print All MIDs + PrintAllMids, +} /// Summarize an existing mutation run (see the [SummaryParams][SummaryParams] /// struct for detailed documentation) /// /// [SummaryParams]:crate::cli::SummaryParams pub fn summarize(params: SummaryParams) -> Result<(), Box> { + print_experimental_feature_warning("gambit summary", "1.0.0"); let mutation_dir = PathBuf::from(params.mutation_directory); let gambit_results_json_path = mutation_dir.join("gambit_results.json"); + let short = params.short; + let summary_mode = if let Some(mids) = params.mids { + SummaryMode::PrintSomeMids(mids.clone()) + } else if params.print_all_mids { + SummaryMode::PrintAllMids + } else { + SummaryMode::PrintStatistics + }; if !&mutation_dir.is_dir() { - log::error!("Missing mutation directory: `{}`", mutation_dir.display()); - log::error!("Suggestions:"); - log::error!(" [+] Run `gambit mutate` to generate mutants"); - log::error!(" [+] Use the `--mutation-directory` flag to specify a different location"); + println!("Missing mutation directory: `{}`", mutation_dir.display()); + println!("Suggestions:"); + println!(" [+] Run `gambit mutate` to generate mutants"); + println!(" [+] Use the `--mutation-directory` flag to specify a different location"); std::process::exit(1); } else if !&gambit_results_json_path.is_file() { log::error!( @@ -51,27 +86,28 @@ pub fn summarize(params: SummaryParams) -> Result<(), Box> { std::process::exit(1); } let v = v.as_array().unwrap(); - match params.mids { - Some(mids) => { + let mutant_summary_entries = v + .iter() + .enumerate() + .map(|(i, m)| get_mutant_summary(i, m)) + .collect::>>(); + match summary_mode { + SummaryMode::PrintStatistics => print_statistics(&mutant_summary_entries), + SummaryMode::PrintSomeMids(mids) => { + // Make as a set for fast lookup let mids: HashSet = HashSet::from_iter(mids.iter().cloned()); - for (i, value) in v.iter().enumerate() { - let mid = value - .as_object() - .expect("Expected an object") - .get("id") - .expect("Expected mutant to have `id` field") - .as_str() - .expect("Expected `id` field to be a string") - .to_string(); - if mids.contains(&mid) { - print_mutant_summary(i, value); + for (_, m) in mutant_summary_entries.iter().enumerate() { + if let Some(e) = m { + if mids.contains(&e.mid) { + print_mutant_summary(m, short); + } } } } - None => { - v.iter().enumerate().for_each(|(i, m)| { - print_mutant_summary(i, m); - }); + SummaryMode::PrintAllMids => { + for m in mutant_summary_entries { + print_mutant_summary(&m, short) + } } } } @@ -80,19 +116,8 @@ pub fn summarize(params: SummaryParams) -> Result<(), Box> { Ok(()) } -/// Print a mutant summary, or a warning if a value is poorly formed. -/// -/// # Arguments -/// -/// * `i` - the index of the mutated JSON in the `gambit_results.json`. This is -/// used for debug purposes -/// * `mutant_json` - the JSON object from `gambit_results.json` that we are -/// going to summarize. This must have the following keys: -/// - `"id"`: this must map to an integer value -/// - `"diff"`: this must map to a string value -/// - `"name"`: this must map to a string value -/// - `"description"`: this must map to a string value -fn print_mutant_summary(i: usize, mutant_json: &Value) { +/// Get the `MutantSummary` associated with id `i` +fn get_mutant_summary(i: usize, mutant_json: &Value) -> Option { let missing_field_msg = |field_name: &str, i: usize, json: &Value| { format!( "Missing `\"{}\"` field in entry {} of JSON: {}", @@ -115,29 +140,126 @@ fn print_mutant_summary(i: usize, mutant_json: &Value) { .unwrap_or_else(|| panic!("{}", missing_field_msg("name", i, mutant_json))) .as_str() .expect("`name` field should be a string"); - let desc = m + let op_long = m .get("description") .unwrap_or_else(|| panic!("{}", missing_field_msg("description", i, mutant_json))) .as_str() .expect("`description` field should be as string"); + let op_short = m + .get("op") + .unwrap_or_else(|| panic!("{}", missing_field_msg("op", i, mutant_json))) + .as_str() + .expect("`op` field should be as string"); + let orig = m + .get("orig") + .unwrap_or_else(|| panic!("{}", missing_field_msg("orig", i, mutant_json))) + .as_str() + .expect("`orig` field should be as string"); + let repl = m + .get("repl") + .unwrap_or_else(|| panic!("{}", missing_field_msg("repl", i, mutant_json))) + .as_str() + .expect("`repl` field should be as string"); + let line = m + .get("line") + .unwrap_or_else(|| panic!("{}", missing_field_msg("line", i, mutant_json))) + .as_i64() + .expect("`line` field should be an int"); + let col = m + .get("col") + .unwrap_or_else(|| panic!("{}", missing_field_msg("col", i, mutant_json))) + .as_i64() + .expect("`col` field should be an int"); + return Some(MutantSummaryEntry { + mid: mid.to_string(), + mutant_export_location: name.to_string(), + diff: diff.to_string(), + op_long: op_long.to_string(), + op_short: op_short.to_string(), + line: line.to_string(), + col: col.to_string(), + orig: orig.to_string(), + repl: repl.to_string(), + }); + } else { + log::warn!( + "Expected an object at entry {} but found {}", + i, + mutant_json + ); + } + None +} +/// Print a mutant summary, or a warning if a value is poorly formed. +/// +/// # Arguments +/// +/// * `i` - the index of the mutated JSON in the `gambit_results.json`. This is +/// used for debug purposes +/// * `mutant_json` - the JSON object from `gambit_results.json` that we are +/// going to summarize. This must have the following keys: +/// - `"id"`: this must map to an integer value +/// - `"diff"`: this must map to a string value +/// - `"name"`: this must map to a string value +/// - `"description"`: this must map to a string value +fn print_mutant_summary(mutant_summary: &Option, short: bool) { + if short { + print_short_mutant_summary(mutant_summary); + } else { + print_long_mutant_summary(mutant_summary); + } +} + +fn print_short_mutant_summary(mutant_summary: &Option) { + if let Some(summary) = mutant_summary { + println!( + "({}) {} [{}@{}:{}] {} -> {}", + ansi_term::Style::new().bold().paint(&summary.mid), + ansi_term::Color::Blue.bold().paint(&summary.op_short), + ansi_term::Style::new() + .italic() + .paint(&summary.mutant_export_location), + &summary.line, + &summary.col, + ansi_term::Color::Green.paint(&summary.orig), + ansi_term::Color::Red.bold().paint(&summary.repl), + ) + } +} + +fn print_long_mutant_summary(mutant_summary: &Option) { + if let Some(s) = mutant_summary { println!( "\n\n === {}: {} [{}] ===\n", ansi_term::Color::Blue.bold().paint("Mutant ID"), - ansi_term::Style::new().bold().paint(mid.to_string()), - ansi_term::Style::new().paint(desc) + ansi_term::Style::new().bold().paint(&s.mid), + ansi_term::Style::new().paint(&s.op_long) ); - crate::util::print_colorized_unified_diff(diff.to_string()); + crate::util::print_colorized_unified_diff(s.diff.clone()); println!( "\n{}: {}", ansi_term::Style::new().bold().paint("Path"), - name + s.mutant_export_location ); - } else { - log::warn!( - "Expected an object at entry {} but found {}", - i, - mutant_json + } +} + +fn print_statistics(summaries: &[Option]) { + let mut op_freq: HashMap = HashMap::new(); + let total_mutants = summaries.iter().filter(|s| s.is_some()).count(); + for summary in summaries.iter().flatten() { + let op = summary.op_short.clone(); + op_freq.insert(op.clone(), op_freq.get(&op).unwrap_or(&0) + 1); + } + for (op, freq) in op_freq.iter() { + println!( + "{}: {:6} ({:>6.2}%)", + op, + freq, + 100.0 * (*freq as f64) / (total_mutants as f64) ); } + println!("---------------------"); + println!("TOT: {:6} (100.00%)", total_mutants,); } diff --git a/src/test_util.rs b/src/test_util.rs index acbea09..a0c50ed 100644 --- a/src/test_util.rs +++ b/src/test_util.rs @@ -1,4 +1,3 @@ -use crate::{SolAST, SolASTVisitor}; use std::{io::prelude::*, path::PathBuf}; use tempfile::Builder; @@ -6,10 +5,11 @@ use tempfile::Builder; /// optionally providing a return type pub fn wrap_and_write_solidity_to_temp_file( statements: &[&str], + params: &[&str], returns: Option<&str>, ) -> std::io::Result { // Wrap statements in a Solidity function and contract - let solidity_code = wrap_solidity(statements, returns); + let solidity_code = wrap_solidity(statements, returns, params); write_solidity_to_temp_file(solidity_code) } @@ -36,7 +36,7 @@ pub fn write_solidity_to_temp_file(sol: String) -> std::io::Result { } /// Wrap solidity code in a contract/function -pub fn wrap_solidity(statements: &[&str], returns: Option<&str>) -> String { +pub fn wrap_solidity(statements: &[&str], returns: Option<&str>, params: &[&str]) -> String { let returns = if let Some(returns) = returns { format!("({})", returns) } else { @@ -48,26 +48,14 @@ pub fn wrap_solidity(statements: &[&str], returns: Option<&str>) -> String { pragma solidity ^0.8.0; contract Wrapper {{ - function wrapped() public {} {{ + function wrapped({}) public {} {{ {} }} }} ", + params.join(", "), returns, statements.join("\n ") ); solidity_code } - -#[derive(Default)] -struct ExprParserHelper {} - -impl SolASTVisitor<(), SolAST> for ExprParserHelper { - fn visit_node(&self, node: &SolAST, _: &()) -> Option { - if node.node_type() == Some("Assignment".into()) { - Some(node.right_hand_side()) - } else { - None - } - } -} diff --git a/src/util.rs b/src/util.rs index c65db93..487e4ef 100644 --- a/src/util.rs +++ b/src/util.rs @@ -6,8 +6,8 @@ use std::{ }; use ansi_term::{ANSIGenericString, Color, Style}; +use solang::{file_resolver::FileResolver, sema::ast::Statement}; -static EQUAL: &str = "="; pub static DEFAULT_GAMBIT_OUTPUT_DIRECTORY: &str = "gambit_out"; pub fn default_gambit_output_directory() -> String { @@ -50,50 +50,6 @@ pub fn get_indent(line: &str) -> String { res } -/// Resolve a remapping path. -/// -/// A remapping string is of the form `@aave=path/to/aave-gho/node_modules/@aave`. -/// This is of the form `@NAME=PATH`. This function separates `PATH` from the -/// remapping string, resolves `PATH` with respect to the optional -/// `resolve_against` (defaults to '.' if `None` is provided), canonicalizes the -/// resolved path, and repackages a new canonical remapping string. -/// -/// # Arguments -/// -/// * `remap_str` - the remapping string whose path needs to be resolved -/// * `resolve_against` - an optional path that `remap_str`'s PATH will be -/// resolved against---by default (i.e., if `None` is provided), this is -/// treated as `"."` -pub fn repair_remapping(remap_str: &str, resolve_against: Option<&str>) -> String { - log::debug!( - "Repairing remap {} against path {:?}", - remap_str, - &resolve_against - ); - let against_path_str = if let Some(p) = resolve_against { - p - } else { - "." - }; - let parts: Vec<&str> = remap_str.split(EQUAL).collect(); - assert_eq!( - parts.len(), - 2, - "repair_remappings: remapping must have the shape @foo=bar/baz/blip, please check {}.", - remap_str - ); - let lhs = parts[0]; - let rhs = parts[1]; - let resolved_path = PathBuf::from(against_path_str) - .join(rhs) - .canonicalize() - .unwrap(); - let resolved = resolved_path.to_str().unwrap(); - let result = lhs.to_owned() + EQUAL + resolved; - log::debug!("Repaired to {}", result); - result -} - type CommandOutput = (Option, Vec, Vec); /// Utility for invoking any command `cmd` with `args`. @@ -272,36 +228,18 @@ mod tests { ) } - // Note: I'm ignoring the following two tests. I've updated - // `repair_remapping` to use `fs::canonicalize()` which requires a path to - // exist. This makes writing these tests a bit trickier. - #[ignore] - #[test] - fn test_remapping1() { - let aave = "@aave=../../../Test/aave-gho/node_modules/@aave"; - let base = "."; - let res = "@aave=../../../Test/aave-gho/node_modules/@aave"; - assert_eq!(repair_remapping(aave, Some(base)), res) - } - - #[ignore] - #[test] - fn test_remapping2() { - let aave = "@aave=/Test/aave-gho/node_modules/@aave"; - let base = "/foo/bar"; - let res = "@aave=/Test/aave-gho/node_modules/@aave"; - assert_eq!(repair_remapping(aave, Some(base)), res) - } - use crate::simplify_path; use std::path::PathBuf; #[test] pub fn test_simplify_path() { - assert_simplifed_path("benchmarks/10Power", "benchmarks/10Power"); - assert_simplifed_path("benchmarks/10Power", "benchmarks/../benchmarks/10Power"); - assert_simplifed_path("benchmarks", "benchmarks/../benchmarks/10Power/.."); - assert_simplifed_path("", "benchmarks/../benchmarks/10Power/../.."); + assert_simplifed_path("benchmarks/Ops/AOR", "benchmarks/Ops/AOR"); + assert_simplifed_path( + "benchmarks/Ops/BOR", + "benchmarks/Ops/../.././benchmarks/Ops/BOR", + ); + assert_simplifed_path("benchmarks", "benchmarks/../benchmarks/Ops/.."); + assert_simplifed_path("", "benchmarks/../benchmarks/Ops/../.."); } /// Helper function to assert simplified paths @@ -347,3 +285,140 @@ pub fn normalize_path(path: &Path) -> PathBuf { } ret } + +pub fn normalize_mutation_operator_name(op_name: &str) -> String { + let tmp = op_name.to_lowercase(); + let tmp = tmp.replace('_', "-"); + let op_name_lower = tmp.as_str(); + match op_name_lower { + "aor" | "arithmetic-operator-replacement" => "arithmetic-operator-replacement", + "bor" | "bitwise-operator-replacement" => "bitwise-operator-replacement", + "evr" | "expression-value-replacement" => "expression-value-replacement", + "edc" | "elim-delegate-call" => "elim-delegate-call", + "lor" | "logical-operator-replacement" => "logical-operator-replacement", + "lvr" | "literal-value-replacement" => "literal-value-replacement", + "ror" | "relational-operator-replacement" => "relational-operator-replacement", + "sor" | "shift-operator-replacement" => "shift-operator-replacement", + "std" | "statement-deletion" => "statement-deletion", + "uor" | "unary-operator-replacement" => "unary-operator-replacement", + _ => op_name_lower, + } + .to_string() +} + +/// Return a simple string representation of the type of statement +pub fn statement_type(stmt: &Statement) -> &str { + match stmt { + Statement::Block { .. } => "Block", + Statement::VariableDecl(..) => "VariableDecl", + Statement::If(..) => "If", + Statement::While(..) => "While", + Statement::For { .. } => "For", + Statement::DoWhile(..) => "DoWhile", + Statement::Expression(..) => "Expression", + Statement::Delete(..) => "Delete", + Statement::Destructure(..) => "Destructure", + Statement::Continue(..) => "Continue", + Statement::Break(_) => "Break", + Statement::Return(_, _) => "Return", + Statement::Revert { .. } => "Revert", + Statement::Emit { .. } => "Emit", + Statement::TryCatch(_, _, _) => "TryCatch", + Statement::Underscore(_) => "Underscore", + Statement::Assembly(_, _) => "Assembly", + } +} + +/// Get the import path, if available, from resolver for the import_no +pub fn get_vfs_path(resolver: &FileResolver, filepath: &Path) -> Option { + let import_paths = resolver.get_import_paths(); + for import_path in import_paths.iter().filter_map(|p| match p { + (None, ip) => Some(ip), + _ => None, + }) { + if let Ok(rel_path) = filepath.strip_prefix(import_path) { + return Some(rel_path.to_path_buf()); + } + } + None +} + +/// Print a deprecation warning to stderr +pub fn print_deprecation_warning(argument: &str, version: &str, message: &str) { + let yellow = ansi_term::Color::Yellow; + let bold = ansi_term::Style::new().bold(); + let italic = ansi_term::Style::new().italic(); + + eprintln!( + "{}: {}", + yellow.paint("Deprecation Warning"), + bold.paint(argument) + ); + + eprintln!( + " `{}` was deprecated in Gambit v{}.\n {}\n", + bold.paint(argument), + bold.paint(version), + italic.paint(message) + ); +} + +pub fn print_experimental_feature_warning(feature: &str, version: &str) { + let yellow = ansi_term::Color::Yellow; + let bold = ansi_term::Style::new().bold(); + let italic = ansi_term::Style::new().italic(); + + eprintln!( + "{}: {}", + yellow.paint("Experimental Feature Warning"), + bold.paint(feature) + ); + eprintln!( + " `{}` is an experimental feature introduced in Gambit v{}.", + bold.paint(feature), + bold.paint(version) + ); + eprintln!("{}\n", italic.paint( " Future updates may alter this feature's behavior, or remove this feature entirely, without warning.")); +} + +pub fn print_warning(warn: &str, message: &str) { + let yellow = ansi_term::Color::Yellow; + let bold = ansi_term::Style::new().bold(); + let message_lines = message.split('\n'); + eprintln!("{}: {}", yellow.paint("Warning"), bold.paint(warn)); + for line in message_lines { + eprintln!(" {}", line,); + } +} + +pub fn print_error(err: &str, message: &str) { + let red = ansi_term::Color::Red; + let bold = ansi_term::Style::new().bold(); + eprintln!("{}: {}", red.paint("Error"), bold.paint(err)); + if !message.trim().is_empty() { + let message_lines = message.split('\n'); + for line in message_lines { + eprintln!(" {}", line,); + } + } +} + +pub fn print_file_not_found_error(filename: &str) { + let italic = ansi_term::Style::new().italic(); + print_error( + format!("File not found: `{}`", italic.paint(filename)).as_str(), + "", + ) +} + +pub fn print_invalid_conf_missing_field_error(field: &str) { + let italic = ansi_term::Style::new().italic(); + print_invalid_conf_error( + format!("missing field `{}`", italic.paint(field)).as_str(), + format!("All configurations must specify field `{}`", field).as_str(), + ) +} + +pub fn print_invalid_conf_error(reason: &str, msg: &str) { + print_error(format!("Invalid Configuration: {}", reason).as_str(), msg) +} diff --git a/tests/integration_tests.rs b/tests/integration_tests.rs deleted file mode 100644 index 75510e7..0000000 --- a/tests/integration_tests.rs +++ /dev/null @@ -1,372 +0,0 @@ -use ansi_term::{Color, Style}; -use gambit::MutateParams; -use project_root::get_project_root; -use serde_json; -use std::{collections::HashSet, env, error, path::PathBuf}; - -/// All test cases are generated by running Gambit on the individual files -/// listed in `all.json` and then using `scripts/mutants_log_to_regression.py` -/// to print `gambit_out/mutants.log` as regression test cases -#[test] -fn test_all() { - assert_exact_mutants_from_json( - "all.json", - &vec![ - ("BinaryOpMutation", "+", "-", (7, 10)), - ("BinaryOpMutation", "+", "*", (7, 10)), - ("BinaryOpMutation", "+", "/", (7, 10)), - ("BinaryOpMutation", "+", "%", (7, 10)), - ("BinaryOpMutation", "+", "**", (7, 10)), - ("BinaryOpMutation", "-", "+", (11, 10)), - ("BinaryOpMutation", "-", "*", (11, 10)), - ("BinaryOpMutation", "-", "/", (11, 10)), - ("BinaryOpMutation", "-", "%", (11, 10)), - ("BinaryOpMutation", "-", "**", (11, 10)), - ("BinaryOpMutation", "*", "+", (15, 10)), - ("BinaryOpMutation", "*", "-", (15, 10)), - ("BinaryOpMutation", "*", "/", (15, 10)), - ("BinaryOpMutation", "*", "%", (15, 10)), - ("BinaryOpMutation", "*", "**", (15, 10)), - ("BinaryOpMutation", "/", "+", (19, 10)), - ("BinaryOpMutation", "/", "-", (19, 10)), - ("BinaryOpMutation", "/", "*", (19, 10)), - ("BinaryOpMutation", "/", "%", (19, 10)), - ("BinaryOpMutation", "/", "**", (19, 10)), - ("BinaryOpMutation", "%", "+", (23, 10)), - ("BinaryOpMutation", "%", "-", (23, 10)), - ("BinaryOpMutation", "%", "*", (23, 10)), - ("BinaryOpMutation", "%", "/", (23, 10)), - ("BinaryOpMutation", "%", "**", (23, 10)), - ("BinaryOpMutation", "**", "+", (27, 10)), - ("BinaryOpMutation", "**", "-", (27, 10)), - ("BinaryOpMutation", "**", "*", (27, 10)), - ("BinaryOpMutation", "**", "/", (27, 10)), - ("BinaryOpMutation", "**", "%", (27, 10)), - ("RequireMutation", "cond1", "true", (7, 10)), - ("RequireMutation", "cond1", "false", (7, 10)), - ("RequireMutation", "cond2", "true", (8, 10)), - ("RequireMutation", "cond2", "false", (8, 10)), - ("RequireMutation", "cond3", "true", (9, 10)), - ("RequireMutation", "cond3", "false", (9, 10)), - ("AssignmentMutation", "42", "0", (13, 6)), - ("AssignmentMutation", "42", "1", (13, 6)), - ("AssignmentMutation", "13", "0", (14, 6)), - ("AssignmentMutation", "13", "1", (14, 6)), - ("AssignmentMutation", "3110", "0", (15, 6)), - ("AssignmentMutation", "3110", "1", (15, 6)), - ("AssignmentMutation", "true", "false", (16, 6)), - ("AssignmentMutation", "false", "true", (17, 6)), - ( - "DeleteExpressionMutation", - "result ++", - "assert(true)", - (10, 6), - ), - ("DeleteExpressionMutation", "i++", "assert(true)", (9, 29)), - ("IfStatementMutation", "a", "true", (7, 6)), - ("IfStatementMutation", "a", "false", (7, 6)), - ("SwapArgumentsOperatorMutation", "x - y", "y - x", (7, 9)), - ("SwapArgumentsOperatorMutation", "x / y", "y / x", (11, 9)), - ("SwapArgumentsOperatorMutation", "x % y", "y % x", (15, 9)), - ("SwapArgumentsOperatorMutation", "x ** y", "y ** x", (19, 9)), - ("SwapArgumentsOperatorMutation", "x > y", "y > x", (23, 9)), - ("SwapArgumentsOperatorMutation", "x < y", "y < x", (27, 9)), - ("SwapArgumentsOperatorMutation", "x >= y", "y >= x", (31, 9)), - ("SwapArgumentsOperatorMutation", "x <= y", "y <= x", (35, 9)), - ("SwapArgumentsOperatorMutation", "x << y", "y << x", (39, 9)), - ("SwapArgumentsOperatorMutation", "x >> y", "y >> x", (43, 9)), - ("UnaryOperatorMutation", "~", "++", (7, 9)), - ("UnaryOperatorMutation", "~", "--", (7, 9)), - ("UnaryOperatorMutation", "++", "--", (11, 9)), - ("UnaryOperatorMutation", "++", "~", (11, 9)), - ("UnaryOperatorMutation", "--", "++", (15, 9)), - ("UnaryOperatorMutation", "--", "~", (15, 9)), - ("UnaryOperatorMutation", "++", "--", (19, 3)), - ("UnaryOperatorMutation", "--", "++", (24, 3)), - ("ElimDelegateMutation", "delegatecall", "call", (25, 55)), - ], - ); -} - -#[test] -fn multiple_contracts_1() { - assert_exact_mutants_from_json( - "multiple-contracts-1.json", - &vec![ - //C.get10PowerDecimals - ( - "DeleteExpressionMutation", - "assert(c[0] == e)", - "assert(true)", - (7, 9), - ), - ("BinaryOpMutation", "**", "+", (24, 24)), - ("BinaryOpMutation", "**", "-", (24, 24)), - ("BinaryOpMutation", "**", "*", (24, 24)), - ("BinaryOpMutation", "**", "/", (24, 24)), - ("BinaryOpMutation", "**", "%", (24, 24)), - ( - "SwapArgumentsOperatorMutation", - "a ** decimals", - "decimals ** a", - (24, 23), - ), - ( - "DeleteExpressionMutation", - "assert(c[0] == e)", - "assert(true)", - (29, 9), - ), - ], - ) -} - -#[test] -fn multiple_contracts_2() { - assert_exact_mutants_from_json( - "multiple-contracts-2.json", - &vec![ - /* Utils.add */ - ("BinaryOpMutation", "+", "-", (11, 17)), - ("BinaryOpMutation", "+", "*", (11, 17)), - ("BinaryOpMutation", "+", "/", (11, 17)), - ("BinaryOpMutation", "+", "%", (11, 17)), - /* C.get10PowerDecimals */ - ("BinaryOpMutation", "**", "+", (24, 24)), - ("BinaryOpMutation", "**", "-", (24, 24)), - ("BinaryOpMutation", "**", "*", (24, 24)), - ("BinaryOpMutation", "**", "/", (24, 24)), - ("BinaryOpMutation", "**", "%", (24, 24)), - ( - "SwapArgumentsOperatorMutation", - "a ** decimals", - "decimals ** a", - (24, 23), - ), - ], - ) -} - -#[test] -fn multiple_contracts_3() { - assert_exact_mutants_from_json( - "multiple-contracts-3.json", - &vec![ - /* Utils.getarray */ - /* Utils.add */ - ( - "DeleteExpressionMutation", - "assert(c[0] == e)", - "assert(true)", - (7, 9), - ), - ("BinaryOpMutation", "+", "-", (11, 17)), - ("BinaryOpMutation", "+", "*", (11, 17)), - ("BinaryOpMutation", "+", "/", (11, 17)), - ("BinaryOpMutation", "+", "%", (11, 17)), - ( - "DeleteExpressionMutation", - "a[0] = msg.sender", - "assert(true)", - (18, 9), - ), - /* C.get10PowerDecimals */ - ("BinaryOpMutation", "**", "+", (24, 24)), - ("BinaryOpMutation", "**", "-", (24, 24)), - ("BinaryOpMutation", "**", "*", (24, 24)), - ("BinaryOpMutation", "**", "/", (24, 24)), - ("BinaryOpMutation", "**", "%", (24, 24)), - ( - "SwapArgumentsOperatorMutation", - "a ** decimals", - "decimals ** a", - (24, 23), - ), - ( - "DeleteExpressionMutation", - "assert(c[0] == e)", - "assert(true)", - (29, 9), - ), - ( - "DeleteExpressionMutation", - "Utils.getarray(b, address(this))", - "assert(true)", - (34, 9), - ), - /* C.getarray */ - /* C.callmyself */ - /* C.add */ - ("BinaryOpMutation", "+", "-", (38, 17)), - ("BinaryOpMutation", "+", "*", (38, 17)), - ("BinaryOpMutation", "+", "/", (38, 17)), - ("BinaryOpMutation", "+", "%", (38, 17)), - ], - ) -} - -#[test] -fn multiple_contracts_4() { - assert_exact_mutants_from_json( - "multiple-contracts-4.json", - &vec![ - /* Utils.getarray */ - /* Utils.add */ - ("BinaryOpMutation", "+", "-", (11, 17)), - ("BinaryOpMutation", "+", "*", (11, 17)), - ("BinaryOpMutation", "+", "/", (11, 17)), - ("BinaryOpMutation", "+", "%", (11, 17)), - /* C.get10PowerDecimals */ - /* C.getarray */ - /* C.callmyself */ - /* C.add */ - ("BinaryOpMutation", "+", "-", (38, 17)), - ("BinaryOpMutation", "+", "*", (38, 17)), - ("BinaryOpMutation", "+", "/", (38, 17)), - ("BinaryOpMutation", "+", "%", (38, 17)), - ], - ) -} - -/// Assert the expected mutations of JSON configuration file located in -/// `benchmarks/config-jsons`. -/// -/// The expected mutants can be order independent: we check that the actual and -/// expected mutants have the same number and are the same when put into a set -/// -/// _(note: the length check on actuals and expected is maybe a little redundant, -/// but this checks against the same mutant being generated multiple times, -/// which will not show up when the mutants are stored in sets for equality -/// checking)_ -/// -/// # Arguments -/// -/// * `json` - name of the json file located in `Gambit/benchmarks/config-jsons` -/// * `expected` - a tuple describing the expected mutants. These tuples have -/// the form `(op, orig, repl, (linenum, colnum))`, -/// where -/// - `op` is the name of mutation operator derived from -/// `MutationType::toString()` -/// - `orig` is the source text of the node being replaced (corresponding to -/// `Mutant.orig`) -/// - `repl` is the source text replacing `orig` during mutation -/// (corresponding to `Mutant.repl`) -/// - `(linenum, colnum)` are the line and column numbers where the mutation -/// took place (corresponding to `Mutant.get_line_column`); we use this -/// information to disambiguate different mutations of similar nodes -fn assert_exact_mutants_from_json(json: &str, expected: &Vec<(&str, &str, &str, (usize, usize))>) { - if let Ok(mutate_params) = get_config_json(json) { - let results = gambit::run_mutate(mutate_params); - assert!(results.is_ok()); - let dir_to_mutants = results.unwrap(); - assert_eq!( - dir_to_mutants.keys().len(), - 1, - "Expected a single output directory" - ); - let mutants = dir_to_mutants.values().next().unwrap(); - let actuals: Vec<(String, &str, &str, (usize, usize))> = mutants - .iter() - .map(|m| { - ( - m.op.to_string(), - m.orig.trim(), - m.repl.trim(), - m.source.get_line_column(m.start).unwrap(), - ) - }) - .collect(); - let actuals: Vec<(&str, &str, &str, (usize, usize))> = actuals - .iter() - .map(|(a, b, c, d)| (a.as_str(), *b, *c, *d)) - .collect(); - assert_eq!( - expected.len(), - actuals.len(), - "\n{} Error: {}: expected {} mutants but found {}.\n {} {}\n {} {}\n", - Color::Red.bold().paint("[ ! ]"), - Style::new().bold().underline().italic().paint(json), - Color::Green.bold().paint(expected.len().to_string()), - Color::Red.bold().paint(actuals.len().to_string()), - Color::Green.bold().paint("Expected Mutants:"), - expected - .iter() - .map(|(op, orig, repl, (line, col))| format!( - "[{}: `{}` -> `{}` ({}:{})]", - op, orig, repl, line, col - )) - .collect::>() - .join(", "), - Color::Red.bold().paint("Actual Mutants:"), - actuals - .iter() - .map(|(op, orig, repl, (line, col))| format!( - "[{}: `{}` -> `{}` ({}:{})]", - op, orig, repl, line, col - )) - .collect::>() - .join(", ") - ); - - let actuals: HashSet<(&str, &str, &str, (usize, usize))> = - actuals.iter().cloned().collect(); - let expected: HashSet<(&str, &str, &str, (usize, usize))> = - expected.iter().cloned().collect(); - assert_eq!( - expected, - actuals, - "\n{} Error: {}\n", - Color::Red.bold().paint("[ ! ]"), - Style::new().bold().underline().italic().paint(json), - ); - } else { - assert!(false, "Couldn't read {}", json); - } -} - -fn get_config_json(config_json: &str) -> Result, Box> { - let cwd = env::current_dir()?; - let project_root = get_project_root()?; - let path_to_config_json = project_root - .join("benchmarks") - .join("config-jsons") - .join(config_json); - let p = path_to_config_json.strip_prefix(&cwd).unwrap(); - let json_contents = std::fs::read_to_string(&p)?; - let json: serde_json::Value = serde_json::from_reader(json_contents.as_bytes())?; - - let mut mutate_params: Vec = if json.is_array() { - serde_json::from_str(&json_contents)? - } else if json.is_object() { - let single_param: MutateParams = serde_json::from_str(&json_contents)?; - vec![single_param] - } else { - panic!("Invalid configuration file: must be an array or an object") - }; - // We also have to include some path update logic: a config file - // uses paths relative to the parent directory of the config file. - // This may be different than the current working directory, so we - // need to compute paths as offsets from the config's parent - // directory. - let pb = PathBuf::from(&p); - let json_parent_directory = pb.parent().unwrap(); - let base_outdir = PathBuf::from("gambit_tests_out"); - let base_outdir = base_outdir.join(format!("test_{}", config_json)); - - for params in mutate_params.iter_mut() { - // Update outdir - let outdir = base_outdir.join(¶ms.outdir.clone().unwrap_or("gambit_out".to_string())); - params.outdir = Some(outdir.to_str().unwrap().to_string()); - params.filename = params.filename.clone().map(|fnm| { - json_parent_directory - .join(fnm) - .to_str() - .unwrap() - .to_string() - }); - // Update overwrite - params.no_overwrite = false; - } - - Ok(mutate_params) -}