Repository navigation
Replies: 1 comment
|
The issue is that When you pass only Fix: add slither = Slither(
contract_path,
solc=os.environ["SOLC_BINARY"],
solc_remaps=["@chainlink/=node_modules/@chainlink/"],
solc_working_directory="/path/to/project/root"
)Slither passes If you have multiple import roots (e.g. slither = Slither(
contract_path,
solc_remaps=["@chainlink/=node_modules/@chainlink/"],
solc_working_directory="/path/to/project",
solc_args="--include-path node_modules --include-path lib"
) |
Uh oh!
There was an error while loading. Please reload this page.
I'm trying to analyze a Solidity contract using Slither's Python API, but I'm getting compilation errors when the contract imports Chainlink dependencies. The imports can't be resolved even though I have the dependencies installed and remappings configured.
Error:
My setup:
import {OwnerIsCreator} from "@chainlink/contracts-ccip/src/v0.8/shared/access/OwnerIsCreator.sol";npm install @chainlink/contracts-ccip✓Python code:
What I've tried:
solc_remapsparameter:slither = Slither(path, solc_remaps=["@chainlink/=node_modules/@chainlink/"])solc_argswith various formats:--remap,--include-path,--base-pathnode_modules/@chainlink/contracts-ccip/src/v0.8/shared/access/OwnerIsCreator.sol✓solccommand (works fine)Environment:
Any help would be greatly appreciated!
All reactions