Skip to content

docs(cheatcodes): document getBroadcast, getBroadcasts, getDeployment, getDeployments and getDeploymentByLabel - #2276

Open
yash251 wants to merge 1 commit into
foundry-rs:masterfrom
yash251:yash/cheatcodes-broadcast-lookup
Open

yash251 wants to merge 1 commit into
foundry-rs:masterfrom
yash251:yash/cheatcodes-broadcast-lookup

Conversation

@yash251

@yash251 yash251 commented Nov 30, 2026

Copy link
Copy Markdown
Contributor

This adds reference pages for the broadcast lookup cheatcodes: getDeployment, getDeployments, getBroadcast, getBroadcasts and getDeploymentByLabel. They sit in the External sidebar group after deployCode, and broadcast-files.mdx now links to them.

The first four were in knownMissing in scripts/cheatcode-coverage.json, so this removes 4 entries. getDeploymentByLabel is not in v1.10.1. It was added in foundry-rs/foundry#18790 (merged Nov 28), so its page has a nightly note like the transient storage pages from #2220 had. It is not in the manifest yet, but the next weekly refresh would list it as new undocumented. With --refresh against Foundry master d5b3494, it counts as documented.

Signatures come from crates/cheatcodes/spec/src/vm.rs on master. Behaviour comes from crates/cheatcodes/src/fs.rs and crates/script-sequence/src/reader.rs. The examples come from a new src/snippets/projects/broadcast_lookup project. Its script deploys two Counter contracts with labels and calls one. The committed broadcast/Deploy.s.sol/31337/run-*.json is the file that script wrote against a local Anvil node, so the tests run without a node. -latest and dry-run files are gitignored.

Two gotchas on the pages were checked by running them:

  • A newer dry-run file for the same contract makes getDeployment and getBroadcast revert with no deployment found for Counter on chain 31337. getDeployments and getDeploymentByLabel still return the confirmed deployments.
  • With no match, getDeployment and getBroadcast revert with No broadcasts found, and the plurals return an empty array.

Checks:

  • forge test --root src/snippets/projects/broadcast_lookup: 4 passed and the label suite skipped on forge 1.10.1 (7c15a1d). 6 passed on nightly e57b04c. The label suite skips itself below 1.10.2 with foundryVersionAtLeast.
  • forge fmt --check on the project: clean
  • vp run check:cheatcodes: passes, 268/333 mentioned, 65 known gaps, 178 pages and 178 sidebar routes
  • vp run check:commands and vp check sidebar: pass
  • vp exec vocs build: passes
  • git diff --check: clean

This edits nearby lines of knownMissing as #2272, #2273 and #2274, so whichever merges later needs a one-line rebase.

@vercel

vercel Bot commented Nov 30, 2026

Copy link
Copy Markdown

@yash251 is attempting to deploy a commit to the Tempo Team on Vercel.

A member of the Team first needs to authorize it.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant