Skip to content

Add record-deployment tool#476

Open
jonaprieto wants to merge 4 commits intodeployment-trackingfrom
add-record-deployment
Open

Add record-deployment tool#476
jonaprieto wants to merge 4 commits intodeployment-trackingfrom
add-record-deployment

Conversation

@jonaprieto
Copy link
Collaborator

Add a record-deployment Rust binary that reads Foundry broadcast artifacts
(e.g. contracts/broadcast/DeployProtocolAdapter.s.sol/<chainId>/run-latest.json)
and auto-updates deployments.json with the deployed contract address and tx hash.

This eliminates the need to manually copy addresses after running just contracts-deploy.

New just recipes:

  • just record-deployment <chain> <version> — extract address from broadcast artifact, update JSON, validate via bindings-build + bindings-test
  • just deploy-and-record <deployer> <chain> <version> — deploy and record in one step

The binary follows the example-tx-generation crate pattern: publish = false, workspace metadata, minimal deps (alloy-chains, serde, serde_json). Five integration tests cover new entry creation, replacement, append, sorting, and missing artifact error handling.

@jonaprieto jonaprieto marked this pull request as ready for review February 22, 2026 00:45
@jonaprieto jonaprieto requested a review from agureev February 24, 2026 14:55
@jonaprieto jonaprieto added the enhancement New feature or request label Feb 24, 2026
@jonaprieto jonaprieto force-pushed the add-record-deployment branch from a10d2b5 to ef1bcd0 Compare February 25, 2026 20:27
Add a small Rust binary that reads Foundry broadcast artifacts and
updates `deployments.json` automatically. This eliminates the need to
manually copy contract addresses after deployment.

Refs #474
@jonaprieto jonaprieto force-pushed the add-record-deployment branch from ef1bcd0 to b065750 Compare February 25, 2026 20:42
Five tests covering: new entry creation, entry replacement for same
chain, appending without clobbering, sort-by-chain-id ordering, and
graceful failure on missing broadcast artifacts.
`just record-deployment <chain> <version>` reads the Foundry broadcast
artifact and updates deployments.json, then validates via bindings-build
and bindings-test.

`just deploy-and-record` combines deploy + record in a single step.
Replace manual JSON editing instructions with `just record-deployment`
and `just deploy-and-record` commands in both the "new version" and
"existing version" deployment sections.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant