Skip to content

Abstraction layer for smart contract build systems

License

Notifications You must be signed in to change notification settings

vovikhangcdv/crytic-compile

 
 

Repository files navigation

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.

About

Abstraction layer for smart contract build systems

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 91.3%
  • Shell 2.8%
  • Solidity 2.3%
  • Vyper 1.6%
  • JavaScript 1.4%
  • Makefile 0.6%