Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add support for binary_mappings and network_family configs #9505

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

popzxc
Copy link

@popzxc popzxc commented Dec 6, 2024

Motivation

Fixes #9227

This PR makes it possible to use foundry profiles to redirect execution to alternative foundry implementations (e.g. forge to forge-zksync or anvil to anvil-zksync) in an extendible way.

Solution

We introduce two new configuration options:

  • binary_mappings: this setting allows you to specify where the execution should be redirected to. In essense, it's a map from enum with keys ["anvil", "cast", "chisel", "forge"] to arbitrary paths.
  • network_family: an enum which currently has two options (ethereum and zksync) that allows overriding default configuration. Right now the only thing it does is override binary_mappings to ZKsync-specific values.

In combination, it makes it possible to define a profile for zksync, e.g.:

[profile.zksync]
network_family = "zksync"

and it would redirect commands to the foundry-zksync.

This way there is no need for foundry-zksync to override foundry binaries, as well as there is no need for users to change their scripts if they work with both upstream foundry and zksync foundry (which they would have to if we named binaries differently).

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.

proposal: implement unified interface for invoking different foundry implementations
1 participant