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

pip3 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.3.10.tar.gz (78.8 kB view details)

Uploaded Source

Built Distribution

crytic_compile-0.3.10-py3-none-any.whl (98.6 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for crytic_compile-0.3.10.tar.gz
Algorithm Hash digest
SHA256 0d7e03b4109709dd175a4550345369548f99fc1c96183c34ccc4dd21a7c41601
MD5 07e4577de5eddd2d1007264112465c66
BLAKE2b-256 789b6834afa2cc6fb3d958027e4c9c24c09735f9c6caeef4e205c22838f772bf

See more details on using hashes here.

Provenance

The following attestation bundles were made for crytic_compile-0.3.10.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.3.10-py3-none-any.whl.

File metadata

File hashes

Hashes for crytic_compile-0.3.10-py3-none-any.whl
Algorithm Hash digest
SHA256 52d8338850d7a90a757bc24bb29f72ff1553028d7417bed805fa5e176785c5ff
MD5 b26acebe9ed708ec4ebf3e8645c12d1b
BLAKE2b-256 b88ec0d4e5be2f58e8582a533a8cca69375ee5c0b78e506b658adc99ff3184d5

See more details on using hashes here.

Provenance

The following attestation bundles were made for crytic_compile-0.3.10-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 Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page