Skip to content

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

@zerosnacks

Description

@zerosnacks

Component

Forge

Have you ensured that all of these are up to date?

  • Foundry
  • Foundryup

What version of Foundry are you on?

tested v1.2.3 - forge 1.3.6-nightly (f7563cf 2025-09-19T12:35:10.245500379Z)

What version of Foundryup are you on?

foundryup: 1.3.0

What command(s) is the bug in?

forge script

Operating System

Linux

Describe the bug

This is apparently a longer standing edge case.

Minimal repro

$ forge init counter
$ forge script script/Counter.s.sol --rpc-url <RPC_URL> --verify --keystore <KEYSTORE>

where --keystore can be any wallet type

Results in

forge script script/Counter.s.sol --rpc-url <SEPOLIA_RPC_URL> --verify --keystore <KEYSTORE>
[⠊] Compiling...
[⠆] Compiling 17 files with Solc 0.8.30
[⠰] Solc 0.8.30 finished in 248.23ms
Compiler run successful!
Error: Deployment not found for chain `11155111`.

Context:
- failed to read from "/home/zerosnacks/Projects/work/counter/broadcast/Counter.s.sol/11155111/dry-run/run-latest.json": No such file or directory (os error 2)

When passing --broadcast this works fine.

It also throws when not passing --keystore <KEYSTORE> with the same error.

I think instead of erroring we should make --verify contingent on --broadcast being specified as --verify without broadcasting is, to my understanding, a meaningless statement.

Note: must be a clean repo as in forge build must not have ran yet

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Status

    Backlog

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions