README.md remappings FAQ

pull/2236/head
Alex 1 year ago
parent 5ac7d0a7e7
commit abf518dcb3
  1. 8
      README.md

@ -274,7 +274,7 @@ If you have a `node_modules/` folder, it must be in the same directory as `contr
run the compilation command for the framework you are using e.g `npx hardhat compile`. That must work successfully;
otherwise, slither's compilation engine, crytic-compile, cannot generate the AST.
* If `node_modules/` is not in the `contracts/` directory of your project, you may need to use **remappings**. If a project has dependencies such as OpenZeppelin and you want to run Slither on a single `.sol` file or use a [slither tool](https://github.com/crytic/slither#tools) like `slither-check-erc`, add the remapping on the command line e.g. `--solc-remaps @=node_modules/@` or to the `slither.config.json` in your project's root. Note, this should not be required for Foundry projects as it is handled automatically.
* If `node_modules/` is not in the `contracts/` directory of your project, you may need to use **remappings**. If a project has dependencies such as OpenZeppelin and you want to run Slither on a single `.sol` file, add the remapping on the command line e.g. `--solc-remaps @=node_modules/@` or to the `slither.config.json` in your project's root. Note, this should not be required for Foundry projects as it is handled automatically.
slither.config.json:
@ -284,16 +284,12 @@ slither.config.json:
}
```
Explicit examples using hardhat:
Explicit example using hardhat:
```bash
slither contracts/MemeCoin.sol --solc-remaps @=node_modules/@
```
```bash
slither-check-erc contracts/MemeCoin.sol MemeCoin --solc-remaps @=node_modules/@
```
## License
Slither is licensed and distributed under the AGPLv3 license. [Contact us](mailto:opensource@trailofbits.com) if you're looking for an exception to the terms.

Loading…
Cancel
Save