Feature: Support chained contract crunching with config file setup #26
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR introduces a new way to run
create2crunch
that allows chaining multiple contract crunching processes when they are interdependent. This feature is particularly useful for scenarios like deploying contracts under an ERC1967 proxy, where the proxy address depends on the initial logic address.Key Changes:
With this PR, there are now two ways to run
create2crunch
:CLI (Existing Method, Unchanged): The standard command-line arguments for running the crunching process remain unchanged.
Config File (New Method):
Example Use Case: ERC1967 Proxy
Consider a scenario where you have
bin/contract1.bin
representing the initial logic to be deployed, andbin/proxy.bin
containing the proxy logic. Theproxy.bin
file might include something like:The config file for this setup would look like:
Workflow:
contract1.bin
).contract1.bin
is found that meets the specified thresholds (e.g., 5 leading zeroes or 7 total zeroes), stop for this target.proxy.bin
), replacing placeholders in its binary content with the computed address fromcontract1.bin
.Benefits:
This feature enables a more flexible and powerful approach to crunching contracts with complex interdependencies, making it easier to achieve desirable addresses for deployments.