Hey Guys Hi ALl !
*I'm trying to use SLITHER (analizy tool ) but when i try to use it on a contract what inherit from Openzeppelin it give me this error(photo)
Error: Source "@openzeppelin/contracts/token/ERC20/extensions/ERC20Pausable.sol" not found: File not found."
Error: Source "@openzeppelin/contracts/access/Ownable.sol" not found: File not found.

This is My Contract :

contract WeakToken is ERC20Pausable, Ownable{ etc....... }

enter image description here

Some of you used SLITHER Tool ?
And you try with contract what inherit from Openzeppeling ?*

4 Answers 4


Slither use crytic-compile for compiling your contracts. If you specify the path to your contract crytic-compile will try to compile it using your installed solc version. solc can't resolve your "@openzeppelin" imports. I am going to guess you are using some tooling like Hardhat or Truffle, if you are I would recommend using slither . instead of specifying the path to the contract; in this way, crytic can realize you are using a framework like Hardhat and compile with it.

Another solution could be using the --solc-remaps from crytici-compile, your command would be something like:

slither <path_to_your_contract> --solc-remaps @openzeppelin=node_modules/@openzeppelin

Answering your last questions: Yes, I have used slither with contracts that inherit from openzeppelin contracts. IMO The easiest way would be using Hardhat or Truffle.

  • Thanks A lot For Your Reply Dear ! I resolve use this : slither contracts/WeakToken.sol --solc-remaps @openzeppelin/=$(pwd)/node_modules/@openzeppelin/ Aug 23, 2021 at 8:12

For brownie

I was able to run slither scan directly on my .sol contract file (not on brownie project folder)

  • (Optional) I had to import dependencies in the project folder (as in my case brownie was installed globally).
  • I ran the following command for my contract
slither contracts/MyToken.sol --solc-remaps "@openzeppelin=dependencies/OpenZeppelin/openzeppelin-contracts@4.6.0 @chainlink=dependencies/smartcontractkit/chainlink-brownie-contracts@0.4.1"

Here is my directory structure

├── brownie-config.yaml
├── contracts
│   ├── MyToken.sol
├── dependencies
│   ├── OpenZeppelin
│   └── smartcontractkit

From Your Root Directory:

slither contracts/WeakToken.sol --solc-remaps @openzeppelin/=$(pwd)/node_modules/@openzeppelin/

#Special Thanks to @Mauricio Perdomo


If you're using a lot of libraries, i found this answer that seems to do the trick:

From root directory

slither contracts/WeakToken.sol --solc-remaps @=node_modules/@

source: https://github.com/crytic/slither/issues/1121#issuecomment-1083342599

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.