Skip to content

[Bug-Candidate]: Slither errors out on latest version of foundry  #581

Open
@chad-js

Description

@chad-js

Describe the issue:

On the latest nightly version of Foundry at time of writing, Slither errors out for me (see attached log snippet).

Using a previous version of Foundry (e.g. the most recent one before the latest), slither works fine.

I wonder if the error is related to this fix included in the most recent release of Foundry? foundry-rs/foundry#9673.

As a side note: This issue is more relevant to / compounded for me because I'm also using slither-action in my ci, which currently only supports using the latest nightly version AFAIK.

Apologies if this is the wrong repo to open this issue in. Not sure if this is something Foundry needs to fix or slither

Code example to reproduce the issue:

My foundry.toml configuration:

[profile.default]
solc = "0.8.26"
via_ir = true
evm_version = "cancun"
src = "src"
out = "out"
libs = ["lib"]

Version:

0.10.4

Relevant log output:

$ slither .
'forge clean' running (wd: /Users/cf/Development/project)
'forge config --json' running
'forge build --build-info --skip */test/** */script/** --force' running (wd: /Users/cf/Development/project)
Traceback (most recent call last):
  File "/Users/cf/Library/Python/3.8/bin/slither", line 8, in <module>
    sys.exit(main())
  File "/Users/cf/Library/Python/3.8/lib/python/site-packages/slither/__main__.py", line 776, in main
    main_impl(all_detector_classes=detectors, all_printer_classes=printers)
  File "/Users/cf/Library/Python/3.8/lib/python/site-packages/slither/__main__.py", line 882, in main_impl
    ) = process_all(filename, args, detector_classes, printer_classes)
  File "/Users/cf/Library/Python/3.8/lib/python/site-packages/slither/__main__.py", line 96, in process_all
    compilations = compile_all(target, **vars(args))
  File "/Users/cf/Library/Python/3.8/lib/python/site-packages/crytic_compile/crytic_compile.py", line 722, in compile_all
    compilations.append(CryticCompile(target, **kwargs))
  File "/Users/cf/Library/Python/3.8/lib/python/site-packages/crytic_compile/crytic_compile.py", line 211, in __init__
    self._compile(**kwargs)
  File "/Users/cf/Library/Python/3.8/lib/python/site-packages/crytic_compile/crytic_compile.py", line 633, in _compile
    self._platform.compile(self, **kwargs)
  File "/Users/cf/Library/Python/3.8/lib/python/site-packages/crytic_compile/platform/foundry.py", line 86, in compile
    hardhat_like_parsing(crytic_compile, self._target, build_directory, self._target)
  File "/Users/cf/Library/Python/3.8/lib/python/site-packages/crytic_compile/platform/hardhat.py", line 77, in hardhat_like_parsing
    optimized = input_json["settings"]["optimizer"]["enabled"]
KeyError: 'enabled'

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions