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

refactor: make Contract generic for Compiler and add metadata to CompilerOutput #224

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

elfedy
Copy link

@elfedy elfedy commented Nov 19, 2024

Right now the compiler abstraction has two couplings that force foundry-zksync to implement it's own fork of compilers:

  1. Contract is specific to solc/EVM contracts. Era VM contracts, while requiring different fields, still could use most of the functionality of the compilers pipeline.
  2. CompilerOutput has solc specific fields. zksolc compilation has relevant information that is useful to have later on, for example when storing BuildInfo

This PR implements changes to address this. If implemented, it would allow foundry-zksync (and potentially other non EVM implementations of foundry) to get rid of all overrides and only maintain ZKsync specific data structures/trait implementations. See sample PR. Changes include:

  1. Make Compiler generic over Contract (using CompilerContract as a trait type).
  2. Add metadata field to CompilerOutput in order to add arbitrary data to compilation output.

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