ethereumblockchainsoliditysmartcontractsslither

How to use Slither on addresses deployed outside Etherscan?


I'm trying to use slither on an address from basescan, for example:

https://basescan.org/address/0x92E20C3534535db17D4c7c622538eB0930544230

Normally, considering etherscan addresses i just run:

slither <address>

However, considering basescan, polygonscan, bscscan and others, i get the following error:

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

But the source code is available in these blockchain explorers.


Solution

  • This is an example on polygon: slither poly:0x6B15A0C1Fe536B5457ceA217B699b5Eb32F1d1ef replace poly with base. Other chains are as follows: mainet,optim,goerli,sepolia,tobalaba,bsc,testnet.bsc,arbi,testnet.arbi,poly,mumbai,avax,testnet.avax,ftm,goerli.base,base,gno,polyzk,blast