slither test/TestUtils.sol
Traceback (most recent call last):
File "/home/mente/.local/lib/python3.10/site-packages/slither/__main__.py", line 826, in main_impl
) = process_all(filename, args, detector_classes, printer_classes)
File "/home/mente/.local/lib/python3.10/site-packages/slither/__main__.py", line 86, in process_all
compilations = compile_all(target, **vars(args))
File "/home/mente/.local/lib/python3.10/site-packages/crytic_compile/crytic_compile.py", line 637, in compile_all
compilations.append(CryticCompile(target, **kwargs))
File "/home/mente/.local/lib/python3.10/site-packages/crytic_compile/crytic_compile.py", line 117, in init
self._compile(**kwargs)
File "/home/mente/.local/lib/python3.10/site-packages/crytic_compile/crytic_compile.py", line 548, in _compile
self._platform.compile(self, **kwargs)
File "/home/mente/.local/lib/python3.10/site-packages/crytic_compile/platform/solc.py", line 154, in compile
targets_json = _get_targets_json(compilation_unit, self._target, **kwargs)
File "/home/mente/.local/lib/python3.10/site-packages/crytic_compile/platform/solc.py", line 276, in _get_targets_json
return _run_solc(发布于 2022-12-02 18:24:13
造成此错误的一个可能原因是安装在系统上的低温编译库的版本与您正在使用的Python版本不兼容。错误消息提到正在使用Python3.10,但最新版本的低温编译只支持Python3.6、3.7和3.8。
要解决此问题,可以尝试卸载当前版本的低温编译并安装兼容版本。您可以在其GitHub页面:https://github.com/crytic/crytic-compile上查看支持的Python版本以获得最新版本的超低温编译。
一旦安装了兼容版本的低温编译,您应该能够使用Slither来分析您的合同,而不会遇到此错误。再次检查Slither的所有其他依赖项是否已经安装并更新,这也是一个好主意,因为这有时会导致类似的问题。
https://ethereum.stackexchange.com/questions/140419
复制相似问题