Crytic-compile
Library to help smart contract compilation. It includes support for:
- Direct solc compilation
- Foundry
- Hardhat
- Brownie
- Buidler
- Dapp
- Embark
- Etherlime
- Sourcify
- Etherscan (including several alt-chain explorers and testnets)
- Truffle
- Waffle
To force compilation with a specific framework, use the --compile-force-framework flag. For example, to force compilation with Hardhat:
crytic-compile . --compile-force-framework hardhat
See the Configuration documentation for advanced usages.
The plugin is used in Trail of Bits tools, including:
Installation
pip install crytic-compile
Or with uv:
uv pip install crytic-compile
Usage
In the root directory of your project e.g. same directory as hardhat.config.js or foundry.toml, run:
crytic-compile .
Crytic-compile will generate crytic-export/contracts.json containing the AST/ABI and bytecodes of the contracts.
Run crytic-compile --help for more options.
Library Linking
If your project uses libraries with external functions, they can be linked to their deployed address with the --compile-libraries flag. For example, if you have a library SafeMath deployed at 0xff, you can link it with:
crytic-compile . --compile-libraries "(SafeMath, 0xff)"
If you are fuzzing with Echidna or Medusa, follow this tutorial on linking libraries.
As a library
See the library documentation.
Metadata
Release files for crytic-compile 0.4.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| crytic_compile-0.4.2.tar.gz | 69.4 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| crytic_compile-0.4.2-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 166.4 kB
Release files / crytic_compile-0.4.2.tar.gz
| Download URL | crytic_compile-0.4.2.tar.gz |
|---|---|
| Size | 69.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
161325e40785d8e42cdd8846b98d4f82c291ca5bcd07b5feae1a84d5a18c59fb
|
|
BLAKE2b-256 checksum How to use checksums |
d3c1ba7f089fbf73cef1f1684d8fb5ec7c47d6f81870ca3e21b32aed88196774
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.13
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jul 28, 2026.
Transparency logRelease files / crytic_compile-0.4.2-py3-none-any.whl
| Download URL | crytic_compile-0.4.2-py3-none-any.whl |
|---|---|
| Size | 97.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
18025359f0f615fac0ff10c706933860fdac12b5edd534ff6a47346a44ff9024
|
|
BLAKE2b-256 checksum How to use checksums |
0f969be415870edb52acc5cc1fd04593196759d41c6ecf54b28d3032b35be4eb
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.13
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jul 28, 2026.
Transparency log