Skip to content

Commit 6f9e817

Browse files
committed
docs: add useful info like linking and forcing framework to README
1 parent 7d6d7aa commit 6f9e817

File tree

1 file changed

+23
-5
lines changed

1 file changed

+23
-5
lines changed

README.md

Lines changed: 23 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,23 @@
55

66
Library to help smart contract compilation. It includes support for:
77
- Direct solc compilation
8+
- [Foundry](https://github.com/foundry-rs/foundry/)
9+
- [Hardhat](https://github.com/nomiclabs/hardhat)
810
- [Brownie](https://github.com/iamdefinitelyahuman/brownie)
911
- [Buidler](https://github.com/nomiclabs/buidler)
1012
- [Dapp](https://dapp.tools/dapp/)
1113
- [Embark](https://embark.status.im/)
1214
- [Etherlime](https://github.com/LimeChain/etherlime)
1315
- [Etherscan](https://etherscan.io/) (including several alt-chain explorers and testnets)
14-
- [Foundry](https://github.com/foundry-rs/foundry/)
15-
- [Hardhat](https://github.com/nomiclabs/hardhat)
1616
- [Truffle](https://truffleframework.com/)
1717
- [Waffle](https://github.com/EthWorks/Waffle)
1818

19+
To force compilation with a specific framework, use the `--compile-force-framework` flag. For example, to force compilation with Hardhat:
20+
21+
```shell
22+
crytic-compile . --compile-force-framework hardhat
23+
```
24+
1925
See the [Configuration](https://github.com/crytic/crytic-compile/wiki/Configuration) documentation for advanced usages.
2026

2127
The plugin is used in Trail of Bits tools, including:
@@ -27,21 +33,33 @@ The plugin is used in Trail of Bits tools, including:
2733

2834
## Installation
2935

30-
```bash
36+
```shell
3137
pip3 install crytic-compile
3238
```
3339

3440
## Usage
3541

36-
### Standalone
37-
```bash
42+
In the root directory of your project e.g. same directory as `hardhat.config.js` or `foundry.toml`, run:
43+
44+
```shell
3845
crytic-compile .
3946
```
4047

4148
Crytic-compile will generate `crytic-export/contracts.json` containing the AST/ABI and bytecodes of the contracts.
4249

4350
Run `crytic-compile --help` for more options.
4451

52+
## Library Linking
53+
54+
If your project uses [libraries](https://docs.soliditylang.org/en/latest/contracts.html#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:
55+
56+
57+
```shell
58+
crytic-compile . --compile-libraries --compile-libraries "(SafeMath, 0xff)"
59+
```
60+
61+
If you are fuzzing with Echidna or Medusa, follow this [tutorial on linking libraries](https://secure-contracts.com/program-analysis/echidna/advanced/working-with-libraries.html?highlight=library#linking-libraries).
62+
4563
### As a library
4664

4765
See the [library documentation](https://github.com/crytic/crytic-compile/wiki/Library-Documentation).

0 commit comments

Comments
 (0)