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

Uploaded Source

Built Distribution

crytic_compile-0.3.7-py3-none-any.whl (97.7 kB view details)

Uploaded Python 3

File details

Details for the file crytic-compile-0.3.7.tar.gz.

File metadata

  • Download URL: crytic-compile-0.3.7.tar.gz
  • Upload date:
  • Size: 77.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.0.0 CPython/3.12.2

File hashes

Hashes for crytic-compile-0.3.7.tar.gz
Algorithm Hash digest
SHA256 c7713d924544934d063e68313da8d588a3ad82cd4f40eae30d99f2dd6e640d4b
MD5 1a208cd5eb414201a43e88da24c1bbb0
BLAKE2b-256 54f86833fb37702900711e5617e0594e2eeccbb0b716993e84b00ee186907e1c

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for crytic_compile-0.3.7-py3-none-any.whl
Algorithm Hash digest
SHA256 bd8fc87f89afea5db714df13e302dcbaf50dd7c806fa424ace661384aa60634b
MD5 ad3ca49831cd8d3f3becec5a799b0a3f
BLAKE2b-256 9da72493208d3ecb057255a909a803fbd77770b76cc391ecfce947c3dd957ba7

See more details on using hashes here.

Provenance

Supported by

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