Skip to content

Conversation

DeVikingMark
Copy link

Problem

forge script --verify without --broadcast fails with "Deployment not found for chain" error because it tries to load non-existent deployment files.

Solution

  • Remove problematic condition that attempts to resume when --verify is used without --broadcast
  • Add validation to require --broadcast when using --verify
  • Provide clear error message: "The --verify flag requires --broadcast to be specified"

Changes

  • crates/script/src/lib.rs: Fix logic and add validation
  • crates/forge/tests/cli/script.rs: Add test case

Fixes #11726

Comment on lines 252 to 256
if compiled.args.verify && !compiled.args.should_broadcast() {
eyre::bail!(
"The --verify flag requires --broadcast to be specified. Verification without broadcasting is not meaningful."
);
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you can do this with requires on verify: https://docs.rs/clap/latest/clap/struct.Arg.html#method.requires

@onbjerg onbjerg self-assigned this Sep 23, 2025
Copy link
Contributor

@onbjerg onbjerg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please look into the failing tests:)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: No status
Development

Successfully merging this pull request may close these issues.

bug(forge script): passing --verify without --broadcast results in: Deployment not found for chain <chain_id>
2 participants