Skip to content

Commit

Permalink
Merge pull request #582 from crytic/dev-fix-foundry
Browse files Browse the repository at this point in the history
Fix foundry optimizer key
  • Loading branch information
smonicas authored Jan 16, 2025
2 parents b569435 + fa12661 commit 2d02b9d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion crytic_compile/platform/hardhat.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,8 @@ def hardhat_like_parsing(
version_from_config = loaded_json["solcVersion"] # TODO supper vyper
input_json = loaded_json["input"]
compiler = "solc" if input_json["language"] == "Solidity" else "vyper"
optimized = input_json["settings"]["optimizer"]["enabled"]
# Foundry has the optimizer dict empty when the "optimizer" key is not set in foundry.toml
optimized = input_json["settings"]["optimizer"].get("enabled", False)

compilation_unit.compiler_version = CompilerVersion(
compiler=compiler, version=version_from_config, optimized=optimized
Expand Down

0 comments on commit 2d02b9d

Please sign in to comment.