Skip to content

[General] How to deploy contracts under reproducible addresses? #824

Discussion options

You must be logged in to vote

Hopefully this min-example provides additional clarity when working with factory contracts.

In that min-example:

  1. Parent Deployment Without Child Bytecode:
    In the example, the ChildFactory contract (the parent) is deployed first, but we do not attach the child's bytecode to the factory at this stage. The factory constructor only stores the known bytecode hash, not the full bytecode itself.

  2. First Child Deployment (Providing Bytecode):
    When we run the DeployChild script, you see that only at the moment we call factory.deployChild(...) for the first time we use vmExt.zkUseFactoryDep("Child"). This command includes the child's bytecode in the transaction.

  3. Afterward, Only the Hash Is Needed:

Replies: 3 comments 11 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
10 replies
@CodeSandwich
Comment options

@dutterbutter
Comment options

@CodeSandwich
Comment options

@dutterbutter
Comment options

Answer selected by JackHamer09
@CodeSandwich
Comment options

Comment options

You must be logged in to vote
1 reply
@CodeSandwich
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
General
Labels
general General question
2 participants