crytic / crytic/crytic-compile
Implement auto compile
- Dominant language
- Python
- Stars
- 197
- Forks
- 97
- PR merge metrics
- No merged PRs in 30d
Description
We are having a lot of issues in Slither due to bugs in the underlying compilation platforms that lead to broken ASTs.
We could overcome these issues by running `solc` directly. The main pitfalls to use `solc` is to select what files are needed in the compilation units, and the configuration (solc version, optimization, etc). However, the underlying compilation platform might be able to give us the correct list of files, even if the ASTs are incorrect, or at least give us most of the files and the configuration.
As a result, we could have an "auto recompile" mode that we could trigger automatically in case of failure that would do:
- Collect the filenames from the underlying platform
- Allow the users to specify missing files (if there are some)
- Call `solc` with the input standard json, with all the files and the configuration
An alternative would be to implement the same heuristics as the compilation platforms to recover the set of files and their associated compilation units. But this will require more efforts, to support all the different format (`contracts`, `interfaces`, dependencies in nodejs/python-based frameworks, ...)
We can probably rely on the compilation unit in the short term, and move toward the full heuristic in the long term
Additionally, this mode would allow to significantly reduce the compilation time in case of re-runs.
(tagging @Xenomega for visibility)
Contributor guide
Assessment
This issue has not been assessed yet.