Skip to main content

Util to facilitate smart contracts compilation.

Project description

Crytic-compile

Build Status Slack Status PyPI version

Library to help smart contract compilation. It includes support for:

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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

crytic_compile-0.4.2.tar.gz (69.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

crytic_compile-0.4.2-py3-none-any.whl (97.0 kB view details)

Uploaded Python 3

File details

Details for the file crytic_compile-0.4.2.tar.gz.

File metadata

  • Download URL: crytic_compile-0.4.2.tar.gz
  • Upload date:
  • Size: 69.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.13

File hashes

Hashes for crytic_compile-0.4.2.tar.gz
Algorithm Hash digest
SHA256 161325e40785d8e42cdd8846b98d4f82c291ca5bcd07b5feae1a84d5a18c59fb
MD5 3df61ce0fee8701b0d2c769408051622
BLAKE2b-256 d3c1ba7f089fbf73cef1f1684d8fb5ec7c47d6f81870ca3e21b32aed88196774

See more details on using hashes here.

Provenance

The following attestation bundles were made for crytic_compile-0.4.2.tar.gz:

Publisher: publish.yml on crytic/crytic-compile

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file crytic_compile-0.4.2-py3-none-any.whl.

File metadata

  • Download URL: crytic_compile-0.4.2-py3-none-any.whl
  • Upload date:
  • Size: 97.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.13

File hashes

Hashes for crytic_compile-0.4.2-py3-none-any.whl
Algorithm Hash digest
SHA256 18025359f0f615fac0ff10c706933860fdac12b5edd534ff6a47346a44ff9024
MD5 0aca8402f91f768e756e8a08484b9907
BLAKE2b-256 0f969be415870edb52acc5cc1fd04593196759d41c6ecf54b28d3032b35be4eb

See more details on using hashes here.

Provenance

The following attestation bundles were made for crytic_compile-0.4.2-py3-none-any.whl:

Publisher: publish.yml on crytic/crytic-compile

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page