我正在尝试在来自
basescan
的地址上使用 slither,例如:
https://basescan.org/address/0x92E20C3534535db17D4c7c622538eB0930544230
通常,考虑到我刚刚运行的
etherscan
地址:
slither <address>
但是,考虑到
basescan
、polygonscan
、bscscan
等,我收到以下错误:
Source code not available, try to fetch the bytecode only
Traceback (most recent call last):
File "/home/box/.local/bin/slither", line 8, in <module>
sys.exit(main())
^^^^^^
File "/home/box/.local/lib/python3.12/site-packages/slither/__main__.py", line 753, in main
main_impl(all_detector_classes=detectors, all_printer_classes=printers)
File "/home/box/.local/lib/python3.12/site-packages/slither/__main__.py", line 859, in main_impl
) = process_all(filename, args, detector_classes, printer_classes)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/box/.local/lib/python3.12/site-packages/slither/__main__.py", line 107, in process_all
) = process_single(compilation, args, detector_classes, printer_classes)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/box/.local/lib/python3.12/site-packages/slither/__main__.py", line 80, in process_single
slither = Slither(target, ast_format=ast, **vars(args))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/box/.local/lib/python3.12/site-packages/slither/slither.py", line 141, in __init__
compilation_unit_slither = SlitherCompilationUnit(self, compilation_unit)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/box/.local/lib/python3.12/site-packages/slither/core/compilation_unit.py", line 55, in __init__
self._language = Language.from_str(crytic_compilation_unit.compiler_version.compiler)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/box/.local/lib/python3.12/site-packages/slither/core/compilation_unit.py", line 45, in from_str
raise ValueError(f"Unknown language: {label}")
ValueError: Unknown language: unknown
但是这些区块链浏览器中提供了源代码。
Slither 支持扫描仅托管在 Etherscan 上的合约 - https://github.com/crytic/slither/wiki/Usage#etherscan。