0

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 ?*

1

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.

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

From Your Root Directory:

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

#Special Thanks to @Mauricio Perdomo

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.