[Deployment] Deploying from a Factory Contract #98
-
EnvironmentTestnet zkSolc Version0.4.0 zksync-web3 Version0.14.3 Hardhat.config.ts
Deployment Script (WITHOUT PRIVATE KEY)
Contract CodeThis is the relevant function in the deployed contract (i.e. the function that will deploy other contracts)
Does this work on other EVMs? (If yes, please list at least 1 of them)Yes, Ethereum goerli Description of What Your Contract DoesContract is a Factory contract that deploys instances of the Event contract. Repo Link (Optional)No response Additional DetailsFrom reading the zksync docs, I understand that contract deployment is a bit different from what I am used to on Ethereum L1. I am wondering if there are any examples/tutorials on how to implement a factory contract that can deploy other contracts? I am not sure what the best way to store contract bytecode hashes is and deploying these contracts by interacting with the ContractDeployer contract? Is this all managed by the zksync-hardhat-deploy library when I deploy the factory contract? Any advice is very much appreciated. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
I'll answer my own question here: While the inner machinations of contract deployment is different between L1 and zksync era, this is not something the standard dev has to worry about. My factory contract that I deployed to an L1 testnet and was working also works on zksync era (well the era_test_node) without any modifications. You do not have to worry about passing the bytecode/hashes to transactions. I am far from an expert yet on this platform but that is what I have learnt so far. Any further advice is welcome in this thread. |
Beta Was this translation helpful? Give feedback.
I'll answer my own question here:
While the inner machinations of contract deployment is different between L1 and zksync era, this is not something the standard dev has to worry about. My factory contract that I deployed to an L1 testnet and was working also works on zksync era (well the era_test_node) without any modifications. You do not have to worry about passing the bytecode/hashes to transactions.
I am far from an expert yet on this platform but that is what I have learnt so far. Any further advice is welcome in this thread.