Skip to content

WIP: feat: support project-level network overrides#6

Draft
xavikh wants to merge 1 commit intomainfrom
feat/project-network-overrides
Draft

WIP: feat: support project-level network overrides#6
xavikh wants to merge 1 commit intomainfrom
feat/project-network-overrides

Conversation

@xavikh
Copy link
Copy Markdown

@xavikh xavikh commented Mar 31, 2026

Summary

  • switch recipe now checks both lib/just-foundry/networks/ and the project's networks/ directory
  • Project overlays are resolved at runtime by env_load_network() and env_show(), so edits take effect immediately without re-running switch
  • Three cases: library + project overlay, project-only, library-only (unchanged)

How it works

Projects can place networks/<name>.env files in their root to:

  • Override library networks (e.g., add project-specific addresses on top of mainnet base config)
  • Define custom networks (e.g., taiko-hoodi) not shipped with just-foundry

Priority chain (last wins):

  1. Library network file (lib/just-foundry/networks/<name>.env)
  2. Project overlay (networks/<name>.env)
  3. Root .env (secrets, deployment params)

The switch recipe now checks both lib/just-foundry/networks/ and the
project's networks/ directory. For project-only networks, the symlink
points directly to the project file. For library networks, the
standard symlink is used.

Project overlays are resolved at runtime by env_load_network() and
env_show(), so edits to network files take effect immediately without
re-running switch.

Three cases handled by switch:
- Both exist: symlink to library, overlay applied at runtime
- Project only: symlink to project file
- Library only: symlink as before (unchanged behavior)
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