Skip to content

Instantly share code, notes, and snippets.

@PaulRBerg
Created May 30, 2023 13:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save PaulRBerg/c101d685b90bcfe5b55b39495a1aa2b0 to your computer and use it in GitHub Desktop.
Save PaulRBerg/c101d685b90bcfe5b55b39495a1aa2b0 to your computer and use it in GitHub Desktop.
Explanation of `--via-ir` setup

Via IR Setup

The contracts will be deployed to the production chains with the --via-ir flag enabled.

Using the Via IR compilation pipeline enables a host of powerful optimizations, albeit at the expense of significantly slower compilation times, which can hinder local development efficiency. However, it is crucial to test our contracts against this optimized version, as this is what end users will ultimately interact with.

In order to strike a balance, we have come up with a setup that allows for efficient development and testing on local machines, while still ensuring compatibility with the IR-enabled version. Our approach involves building and testing the contracts normally on local machines, while leveraging the CI environment to build and test the IR-enabled contracts. This ensures rapid development and testing while providing confidence that the contracts function as intended when deployed (with tests passing both with and without IR enabled).

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