0

So I tried with all of the Slither Tool Error On Contract That Inherit From Openzeppeling solutions, but none of them worked for me.

I got all openzeppelin files downloaded locally with git clone, but it also didn't work.

enter image description here

enter image description here

I also tried installing same tool with Docker but also got the same problem.

When I change import to "./Ownable.sol" to search for files locally it finds the files but only the ones that I have in same directory, and then fails on searching for other dependecies. ( I moved all openzeppelin dependecies to the same folder ). I guess only way to work this one out would be to change paths on every dependecy file?

Any other ideas to try?

2 Answers 2

0

This depends on where you are located in folder tree when you run slither.

Is it a truffle project? Is your build directory standard or changed?

For a truffle project of standard structure, just call this from root of the project:

slither

If you redirected Solidity compiler output to another project, e.g. you have frontend in client subfolder and you use Ethereum and Optimism contracts there:

slither --truffle-build-directory client/contracts/ethereum-contracts

For better help, please describe how exactly you run Slither.

0

I found two ways:

  • If you are running slither from your terminal:

    • you can simply specify a remapping in a compiler_config.json in your main directory:

enter image description here


  • If you are using the VsCode extension:

    • you can simply specify it in a remappings.txt :

enter image description here


On a different note:

I also tend to add a "filter_paths" in a slither.config.json:

enter image description here

which will allow you to not have included the directories you do not want.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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