Open lawnmowerdeadman opened 2 weeks ago
Hi, thanks for the report! can you provide a sample contract/project that triggers this issue? The full error trace and message you get on the console would be useful as well to triage this problem.
I'm sorry if there are any parts that are difficult to understand because I don't have much knowledge. If there is anything missing in the submission, please let me know. I will provide it as much as I can with my skills.
## Describe the bug
Slither fails to compile contracts with the following error:
TypeError: sequence item 0: expected str instance, dict found
## Expected behavior
Slither should compile the contracts without errors.
## Environment
- **Slither version:** 0.10.4
- **crytic-compile version:** 0.3.7
- **solc version:** 0.8.28+commit.7893614a.Linux.g++
- **Python version:** 3.11.10
- **Operating system:** Ubuntu on WSL
## To Reproduce
Steps to reproduce the behavior:
1. Activate the virtual environment.
2. Install Slither and dependencies.
3. Run Slither on the sample contract.
## Sample Project
Attached is a sample project that triggers the issue. You can find the Solidity contract in `contracts/SampleContract.sol`.
## Error Trace
(slither-env-3.11) myuser@DESKTOP-XXXX:/mnt/c/Users/XXXX/Desktop/my-arbitrage-project/slither-sample$ slither contracts/SampleContract.sol Traceback (most recent call last): File "/mnt/c/Users/XXXX/Desktop/my-arbitrage-project/slither/slither-env-3.11/bin/slither", line 8, in
## Project Directory Structure
Attempted to retrieve directory structure using `tree -L 2`, but the command is not installed. Below is the output:
(slither-env-3.11) myuser@DESKTOP-XXXX:/mnt/c/Users/XXXX/Desktop/my-arbitrage-project/slither-sample$ tree -L 2 Command 'tree' not found, but can be installed with: sudo snap install tree # version 2.1.3+pkg-5852, or sudo apt install tree # version 2.1.1-2 See 'snap info tree' for additional versions.
## Additional Context
`slither.config.json` content:
```json
{
"solc": {
"version": "0.8.28",
"args": ["-I", "node_modules"]
}
}
Hi again! Your slither config file is invalid, the "solc" option only takes a string (a path to a solc binary). You probably want something more like the following instead:
{
"solc_solcs_select": "0.8.28",
"solc_remaps": [ "@openzeppelin/=node_modules/@openzeppelin/", "@uniswap/=node_modules/@uniswap/" ]
}
You'll see it doesn't work still even after correcting the config file; it seems there's issues on your code that you'll need to fix (e.g. your contract imports "@openzeppelin/contracts/security/ReentrancyGuard.sol" but that file doesn't exist, the file might have been moved?)
Thanks! I'll give it a try and let you know the results later!
Describe the bug
Slither fails to compile contracts with the following error: TypeError: sequence item 0: expected str instance, dict found
Expected behavior
Slither should compile the contracts without errors.
Environment
To Reproduce
Steps to reproduce the behavior:
Additional context
slither.config.json
content: { "solc": { "version": "0.8.28", "args": ["-I", "/path/to/project/node_modules"] } }