Replies: 17 comments 13 replies
-
Do you have |
Beta Was this translation helpful? Give feedback.
-
There is a remappings.txt file in the directory.
This is currently in my foundry.toml
What is the correct slither command in this instance then ser? |
Beta Was this translation helpful? Give feedback.
-
The out directory has been modified to |
Beta Was this translation helpful? Give feedback.
-
I still get Compilation warnings/errors on ./ClaimFacet.sol: When running that command |
Beta Was this translation helpful? Give feedback.
-
I still get Compilation warnings/errors on ./ClaimFacet.sol: When running that command |
Beta Was this translation helpful? Give feedback.
-
This is an error from the compiler and not slither. If |
Beta Was this translation helpful? Give feedback.
-
I just checkout package.json
I tried NPM i, but the command still didn't work, not sure if the above is an indication of what i am missing? |
Beta Was this translation helpful? Give feedback.
-
did you run |
Beta Was this translation helpful? Give feedback.
-
I ran this command:
This was the execution output Traceback (most recent call last): During handling of the above exception, another exception occurred: Traceback (most recent call last): Error: Source "@openzeppelin/contracts/token/ERC20/IERC20.sol" not found: File not found. Searched the following locations: "". Error: Source "@openzeppelin/contracts/token/ERC721/IERC721.sol" not found: File not found. Searched the following locations: "". Error: Source "@openzeppelin/contracts/token/ERC20/IERC20.sol" not found: File not found. Searched the following locations: "". Error: Source "@openzeppelin/contracts/token/ERC721/IERC721.sol" not found: File not found. Searched the following locations: "". Error: Source "@openzeppelin/contracts/token/ERC20/IERC20.sol" not found: File not found. Searched the following locations: "". Error: Source "@openzeppelin/contracts/token/ERC20/IERC20.sol" not found: File not found. Searched the following locations: "". Error: Source "@openzeppelin/contracts/token/ERC721/IERC721Receiver.sol" not found: File not found. Searched the following locations: "". Error: Source "@openzeppelin/contracts/utils/Address.sol" not found: File not found. Searched the following locations: "". Error in . During handling of the above exception, another exception occurred: Traceback (most recent call last): Error: Source "@openzeppelin/contracts/token/ERC20/IERC20.sol" not found: File not found. Searched the following locations: "". Error: Source "@openzeppelin/contracts/token/ERC721/IERC721.sol" not found: File not found. Searched the following locations: "". Error: Source "@openzeppelin/contracts/token/ERC20/IERC20.sol" not found: File not found. Searched the following locations: "". Error: Source "@openzeppelin/contracts/token/ERC721/IERC721.sol" not found: File not found. Searched the following locations: "". Error: Source "@openzeppelin/contracts/token/ERC20/IERC20.sol" not found: File not found. Searched the following locations: "". Error: Source "@openzeppelin/contracts/token/ERC20/IERC20.sol" not found: File not found. Searched the following locations: "". Error: Source "@openzeppelin/contracts/token/ERC721/IERC721Receiver.sol" not found: File not found. Searched the following locations: "". Error: Source "@openzeppelin/contracts/utils/Address.sol" not found: File not found. Searched the following locations: "". |
Beta Was this translation helpful? Give feedback.
-
You need to run it from the |
Beta Was this translation helpful? Give feedback.
-
OK great this works thank you ser |
Beta Was this translation helpful? Give feedback.
-
I assume this works in a similar fashion to running Mythril? |
Beta Was this translation helpful? Give feedback.
-
I'm not familiar with how Mythril works, but slither (through crytic-compile) will detect that this is a Foundry project when it sees the |
Beta Was this translation helpful? Give feedback.
-
right i see, is there a separate command to run for specific sol files? Rather than running |
Beta Was this translation helpful? Give feedback.
-
you can run e.g. If you're looking to reduce the scope where detectors are run, look into the path filtering option. |
Beta Was this translation helpful? Give feedback.
-
I mean ultimately i'd like to avoid creating remappings files if i can. So ideally, i'd like to find, for example, high risk vulnerabilities, how would i do that?
Like this for example? |
Beta Was this translation helpful? Give feedback.
-
I mean ultimately i'd like to avoid creating remappings files if i can. So ideally, i'd like to find, for example, high risk vulnerabilities, how would i do that? slither . --exclude-optimization --exclude-informational --exclude-low --foundry-out-directory out/foundry Like this for example? |
Beta Was this translation helpful? Give feedback.
-
Describe the issue:
I have recently pulled down a repo from GH and i am trying to run basic slither commands from here.
I have currently ran
slither . slither . --solc-remaps '@openzeppelin/contracts/=node_modules/@openzeppelin/contracts/'
and had the below output.
'forge clean' running (wd: /home/joedakwa/joe/audits/2023-02-kairos-joedakwa/kairos-contracts)
'forge build --build-info --force' running
Compiling 112 files with 0.8.18
Solc 0.8.18 finished in 26.66s
Compiler run successful
Traceback (most recent call last):
File "/home/joedakwa/.local/lib/python3.10/site-packages/slither/main.py", line 834, in main_impl
) = process_all(filename, args, detector_classes, printer_classes)
File "/home/joedakwa/.local/lib/python3.10/site-packages/slither/main.py", line 87, in process_all
compilations = compile_all(target, **vars(args))
File "/home/joedakwa/.local/lib/python3.10/site-packages/crytic_compile/crytic_compile.py", line 620, in compile_all
compilations.append(CryticCompile(target, **kwargs))
File "/home/joedakwa/.local/lib/python3.10/site-packages/crytic_compile/crytic_compile.py", line 110, in init
self._compile(**kwargs)
File "/home/joedakwa/.local/lib/python3.10/site-packages/crytic_compile/crytic_compile.py", line 530, in _compile
self._platform.compile(self, **kwargs)
File "/home/joedakwa/.local/lib/python3.10/site-packages/crytic_compile/platform/foundry.py", line 90, in compile
hardhat_like_parsing(crytic_compile, self._target, build_directory, self._target)
File "/home/joedakwa/.local/lib/python3.10/site-packages/crytic_compile/platform/hardhat.py", line 49, in hardhat_like_parsing
os.listdir(build_directory), key=lambda x: os.path.getmtime(Path(build_directory, x))
FileNotFoundError: [Errno 2] No such file or directory: 'out/build-info'
Error in .
Traceback (most recent call last):
File "/home/joedakwa/.local/lib/python3.10/site-packages/slither/main.py", line 834, in main_impl
) = process_all(filename, args, detector_classes, printer_classes)
File "/home/joedakwa/.local/lib/python3.10/site-packages/slither/main.py", line 87, in process_all
compilations = compile_all(target, **vars(args))
File "/home/joedakwa/.local/lib/python3.10/site-packages/crytic_compile/crytic_compile.py", line 620, in compile_all
compilations.append(CryticCompile(target, **kwargs))
File "/home/joedakwa/.local/lib/python3.10/site-packages/crytic_compile/crytic_compile.py", line 110, in init
self._compile(**kwargs)
File "/home/joedakwa/.local/lib/python3.10/site-packages/crytic_compile/crytic_compile.py", line 530, in _compile
self._platform.compile(self, **kwargs)
File "/home/joedakwa/.local/lib/python3.10/site-packages/crytic_compile/platform/foundry.py", line 90, in compile
hardhat_like_parsing(crytic_compile, self._target, build_directory, self._target)
File "/home/joedakwa/.local/lib/python3.10/site-packages/crytic_compile/platform/hardhat.py", line 49, in hardhat_like_parsing
os.listdir(build_directory), key=lambda x: os.path.getmtime(Path(build_directory, x))
FileNotFoundError: [Errno 2] No such file or directory: 'out/build-info'
from the below directory. All the contracts are inside of src.
joe/audits/2023-02-kairos-joedakwa/kairos-contracts/
I tried also running this command:
slither . --solc-remaps '@openzeppelin/contracts/=node_modules/@openzeppelin/contracts/'
from joe/audits/2023-02-kairos-joedakwa/kairos-contracts/src
(src is where the contracts are)
and had the below output.
I have a remappings json file currently looking like this:
Error: Source "node_modules/@openzeppelin/contracts/token/ERC20/IERC20.sol" not found: File not found. Searched the following locations: "".
--> ClaimFacet.sol:4:1:
|
4 | import {IERC20} from "@openzeppelin/contracts/token/ERC20/IERC20.sol";
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Any advice here?
Code example to reproduce the issue:
N/A
Version:
0.9.2
Relevant log output:
No response
Beta Was this translation helpful? Give feedback.
All reactions