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.6.tar.gz (77.3 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.3.6-py3-none-any.whl (97.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: crytic-compile-0.3.6.tar.gz
  • Upload date:
  • Size: 77.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/4.0.2 CPython/3.11.7

File hashes

Hashes for crytic-compile-0.3.6.tar.gz
Algorithm Hash digest
SHA256 9a53c8913daadfd0f67e288acbe9e74130fe52cc344849925e6e969abc1b8340
MD5 bf9bd277bcd5dc3ec84142d07c988905
BLAKE2b-256 7607b629a6bf2c56f63bb6cd1b2000e58395642dcd72ebae746282a58c0feb3f

See more details on using hashes here.

File details

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

File metadata

  • Download URL: crytic_compile-0.3.6-py3-none-any.whl
  • Upload date:
  • Size: 97.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/4.0.2 CPython/3.11.7

File hashes

Hashes for crytic_compile-0.3.6-py3-none-any.whl
Algorithm Hash digest
SHA256 0eb9c9f4584911ba93b435201f8ca301fccec0746866610da897372a77ea9058
MD5 98c0796cd9326837e24f0c11f9e5551d
BLAKE2b-256 42cd0c86a901662601c4a952f6c89a09b1f5a71e02e5e1ec70166f4864237c49

See more details on using hashes here.

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