Util to facilitate smart contracts compilation.
Project description
Crytic-compile
Library to help smart contract compilation. It includes support for:
- Direct solc compilation
- Foundry
- Hardhat
- Brownie
- Buidler
- Dapp
- Embark
- Etherlime
- Etherscan (including several alt-chain explorers and testnets)
- Truffle
- Waffle
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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for crytic_compile-0.3.4-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5ae0ac789d5aff22d13b7ec564ab81f5b97991f702c5d8b78af538b6306d08b1 |
|
MD5 | de13eebc9531fd1d0d2656f5472d1207 |
|
BLAKE2b-256 | fe53ac68e8f65aec155cae8d0654c220661fbd15db6da95ebd0fa292422cf859 |