[Bug-Candidate]: `--solc-ast` flag does nothing and all
- Dominant language
- Python
- Stars
- 6.4k
- Forks
- 1.1k
- PR merge metrics
- No merged PRs in 30d
Description
### Describe the issue:
The `--help` command claims you can use the flag `--solc-ast` to provide a contract as a json AST, however it does not do anything at all.
### Code example to reproduce the issue:
https://github.com/DanielForTests/foundry_without_packages
### Version:
0.10.3
### Relevant log output:
```shell
(slither_venv) root@16f58c7174fd:/script/workspace/app# slither --solc-ast father-ast.json 'forge config --json' running Traceback (most recent call last): File "/slither_venv/lib/python3.10/site-packages/slither/slither.py", line 135, in __init__ crytic_compile = CryticCompile(target, **kwargs) File "/slither_venv/lib/python3.10/site-packages/crytic_compile/crytic_compile.py", line 211, in __init__ self._compile(**kwargs) File "/slither_venv/lib/python3.10/site-packages/crytic_compile/crytic_compile.py", line 633, in _compile self._platform.compile(self, **kwargs) File "/slither_venv/lib/python3.10/site-packages/crytic_compile/platform/solc.py", line 151, in compile targets_json = _get_targets_json(compilation_unit, self._target, **kwargs) File "/slither_venv/lib/python3.10/site-packages/crytic_compile/platform/solc.py", line 280, in _get_targets_json return _run_solc( File "/slither_venv/lib/python3.10/site-packages/crytic_compile/platform/solc.py", line 494, in _run_solc raise InvalidCompilation(f"{filename} is not the expected format '.sol'") crytic_compile.platform.exceptions.InvalidCompilation: father-ast.json is not the expected format '.sol' During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/slither_venv/lib/python3.10/site-packages/slither/__main__.py", line 875, in main_impl ) = process_single(filename, args, detector_classes, printer_classes) File "/slither_venv/lib/python3.10/site-packages/slither/__main__.py", line 80, in process_single slither = Slither(target, ast_format=ast, **vars(args)) File "/slither_venv/lib/python3.10/site-packages/slither/slither.py", line 139, in __init__ raise SlitherError(f"Invalid compilation: \n{str(e)}") slither.exceptions.SlitherError: Invalid compilation: father-ast.json is not the expected format '.sol' ERROR:root:Error: ERROR:root:Invalid compilation: father-ast.json is not the expected format '.sol' ERROR:root:Please report an issue to https://github.com/crytic/slither/issues (slither_venv) root@16f58c7174fd:/script/workspace/app# slither src/Father.sol --solc-ast father-ast.json usage: slither target [flag] target can be: - file.sol // a Solidity file - project_directory // a project directory. See https://github.com/crytic/crytic-compile/#crytic-compile for the supported platforms - 0x.. // a contract on mainnet - NETWORK:0x.. // a contract on a different network. Supported networks: mainet,optim,goerli,sepolia,tobalaba,bsc,testnet.bsc,arbi,testnet.arbi,poly,mumbai,avax,testnet.avax,ftm,goerli.base,base,gno,polyzk,blast slither: error: unrecognized arguments: father-ast.json
```
Contributor guide
Assessment
This issue has not been assessed yet.