skillfed

crytic-compile

Util to facilitate smart contracts compilation.

crytic-compile v0.4.2 220.7K downloads/30d#9,294 on PyPI199
AGPL license AGPL-3.0-only Active released

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-compile

uv

uv add crytic-compile

poetry

poetry add crytic-compile

Installing 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

Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14

Tags

smart contract compilation abstractionsolidity compiler wrappermulti-framework contract buildethereum ast extractionhardhat foundry brownie compiler
smart-contractsethereumsolidity

More Build Tools packages