crytic-compile
Util to facilitate smart contracts compilation.
What it is and what it does
Crytic-compile is a compilation abstraction layer for Ethereum smart contracts. It detects and invokes the build system used in your project—whether that's Foundry, Hardhat, Brownie, Truffle, or direct Solc—and normalizes the output into a standard JSON format containing contract AST, ABI, and bytecode. This eliminates the need to write framework-specific build logic when you want to analyze or process contracts programmatically.
The package is primarily used as a dependency in security analysis tools like Slither and Echidna, but can also be invoked as a command-line utility or imported as a library. It handles library linking, supports forcing compilation with a specific framework, and integrates with Etherscan and Sourcify for retrieving already-compiled contracts. The three runtime dependencies (pycryptodome, cbor2, solc-select) provide cryptographic utilities, binary encoding support, and Solidity compiler version management.
Use it for:
- Analyze smart contracts with Slither or Echidna without manually configuring each project's build system.
- Extract contract AST and ABI from projects using different frameworks in a unified format for custom tooling.
- Retrieve and compile verified contracts from Etherscan or Sourcify as part of an automated audit pipeline.
- Link external libraries to their deployed addresses before fuzzing or formal verification.
- Build a CI/CD pipeline that compiles contracts regardless of the underlying framework used in the repository.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Crytic-compile abstracts smart contract compilation across multiple frameworks and toolchains, generating standardized AST, ABI, and bytecode output regardless of whether your project uses Solc, Foundry, Hardhat, Brownie, or other Ethereum development tools.
Yes, if you are building Ethereum development tooling, security analysis, or automation that needs to work across multiple smart contract frameworks. The low install friction, active maintenance, and zero known vulnerabilities make it a safe dependency. However, do not install if your project cannot comply with AGPL-3.0-only copyleft requirements—this license mandates open-source redistribution of any derivative work.
Install
crytic-compile on PyPI
pip
pip install crytic-compileuv
uv add crytic-compilepoetry
poetry add crytic-compileInstalling crytic-compile
Before you install
Low install friction with a pure Python wheel distribution. The package is actively maintained with a recent release and supports current Python versions (3.10–3.14). Three runtime dependencies (pycryptodome, cbor2, solc-select) are all standard and widely available.
License in practice
Licensed under AGPL-3.0-only, which requires that any derivative work or modification be distributed under the same license and that source code be made available. This is a copyleft license; use it only if your project can comply with open-source redistribution requirements.
Quickstart
pip install crytic-compile
crytic-compile . --compile-force-framework hardhat
# Generates crytic-export/contracts.json with AST/ABI and bytecodes
Requires Python >=3.10 and !=3.12.0. The underlying solc-select dependency will download compiler binaries on first use, which may take time depending on network and disk availability.
Verify before relying
- Whether solc-select automatically downloads required Solidity compiler versions or if manual setup is needed.
- Performance characteristics when compiling large projects with many contracts.
- Compatibility details with alt-chain explorers and testnets mentioned in the description.
Package facts
| License | AGPL-3.0-only (agpl) |
| Python support | supports the current Python release (!=3.12.0,>=3.10) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 3 — pycryptodome, cbor2, solc-select |
| Maintenance | actively maintained — 17 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 220,676/month — #9,294 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: crytic_compile-0.4.2-py3-none-any.whl
Tags
More Build Tools packages
Provides reusable utilities for Python…
permissive · top 100 on PyPI
tqdmWraps any iterable to display a real-time…
copyleft · top 100 on PyPI
pippip is the standard installer for Python…
permissive · top 100 on PyPI
hatchlingHatchling is a standards-compliant Python build…
permissive · top 100 on PyPI
grpcio-toolsGenerates Python gRPC service stubs and message…
permissive · top 1,000 on PyPI
pre-commitpre-commit is a framework for installing and…
permissive · top 1,000 on PyPI
eth-brownieBrownie is a Python framework for developing,…
permissive · top 15,000 on PyPI
py-solc-xManages installation and version control of the…
permissive · top 15,000 on PyPI
solc-selectManages installation and switching between…
agpl · top 15,000 on PyPI
slither-analyzerSlither is a static analysis framework for…
agpl · top 15,000 on PyPI
ethereum-dasmDisassembles Ethereum EVM bytecode into…
copyleft · top 15,000 on PyPI
vyperVyper is a Python-like programming language for…
permissive · top 15,000 on PyPI
faster-eth-abiEncodes and decodes Ethereum ABI data…
permissive · top 15,000 on PyPI
clvmA LISP-like virtual machine for writing and…
permissive · top 15,000 on PyPI
mythrilMythril analyzes EVM bytecode for security…
permissive · top 15,000 on PyPI
eth-typingProvides standardized type annotations for…
permissive · top 5,000 on PyPI