-
Notifications
You must be signed in to change notification settings - Fork 84
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TypeError: sequence item 0: expected str instance, dict found when running Slither #579
Comments
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.
TypeError: sequence item 0: expected str instance, dict found
(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 sys.exit(main()) ^^^^^^ File "/mnt/c/Users/XXXX/Desktop/my-arbitrage-project/slither/slither-env-3.11/lib/python3.11/site-packages/slither/main.py", line 776, in main main_impl(all_detector_classes=detectors, all_printer_classes=printers) File "/mnt/c/Users/XXXX/Desktop/my-arbitrage-project/slither/slither-env-3.11/lib/python3.11/site-packages/slither/main.py", line 882, in main_impl ) = process_all(filename, args, detector_classes, printer_classes) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/mnt/c/Users/XXXX/Desktop/my-arbitrage-project/slither/slither-env-3.11/lib/python3.11/site-packages/slither/main.py", line 96, in process_all compilations = compile_all(target, **vars(args)) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/mnt/c/Users/XXXX/Desktop/my-arbitrage-project/slither/slither-env-3.11/lib/python3.11/site-packages/crytic_compile/crytic_compile.py", line 722, in compile_all compilations.append(CryticCompile(target, **kwargs)) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/mnt/c/Users/XXXX/Desktop/my-arbitrage-project/slither/slither-env-3.11/lib/python3.11/site-packages/crytic_compile/crytic_compile.py", line 211, in init self._compile(**kwargs) File "/mnt/c/Users/XXXX/Desktop/my-arbitrage-project/slither/slither-env-3.11/lib/python3.11/site-packages/crytic_compile/crytic_compile.py", line 633, in _compile self._platform.compile(self, **kwargs) File "/mnt/c/Users/XXXX/Desktop/my-arbitrage-project/slither/slither-env-3.11/lib/python3.11/site-packages/crytic_compile/platform/solc.py", line 151, in compile targets_json = _get_targets_json(compilation_unit, self._target, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/mnt/c/Users/XXXX/Desktop/my-arbitrage-project/slither/slither-env-3.11/lib/python3.11/site-packages/crytic_compile/platform/solc.py", line 280, in _get_targets_json return _run_solc( ^^^^^^^^^^ File "/mnt/c/Users/XXXX/Desktop/my-arbitrage-project/slither/slither-env-3.11/lib/python3.11/site-packages/crytic_compile/platform/solc.py", line 497, in _run_solc compiler="solc", version=get_version(solc, env), optimized=is_optimized(solc_arguments) ^^^^^^^^^^^^^^^^^^^^^^ File "/mnt/c/Users/XXXX/Desktop/my-arbitrage-project/slither/slither-env-3.11/lib/python3.11/site-packages/crytic_compile/platform/solc.py", line 378, in get_version " ".join(cmd), ^^^^^^^^^^^^^ TypeError: sequence item 0: expected str instance, dict found
(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.
|
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"]
}
}
The text was updated successfully, but these errors were encountered: