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

Feat: Introduce zkSync #10

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft

Feat: Introduce zkSync #10

wants to merge 2 commits into from

Conversation

juliopavila
Copy link
Contributor

Description

This pull request introduces support for zkSync Era into the project, enabling deployments and interactions with zkSync networks.

Added zkSync support: Installed and configured the following plugins:

  • @matterlabs/hardhat-zksync-solc for compiling contracts with zkSync’s Solidity compiler (zksolc).
  • @matterlabs/hardhat-zksync-deploy for deploying contracts to zkSync networks.
  • @matterlabs/hardhat-zksync-verify for verifying contracts on zkSync explorers.

Updated hardhat.config.ts to include zkSync Era mainnet and testnet configurations:

  • Added zkSyncMainnet and zkSyncSepoliaTestnet networks with appropriate URLs and settings.
  • Configured the zksolc compiler version and settings, including optimizer runs and library links.
  • Ensured that the etherscan configuration includes the ZKSYNC_EXPLORER_API_KEY for contract verification.

Updated deployment scripts:
- Modified deploy-mastercopies.ts to use Wallet from zksync-ethers instead of zksync-web3 for compatibility with the Deployer from @matterlabs/hardhat-zksync-deploy.
- Resolved type incompatibility issues between Wallet instances.
- Adjusted import statements to ensure correct versions of Wallet and Deployer are used.
- Implemented conditional logic to handle deployments on zkSync networks versus Ethereum networks.
- For zkSync networks, used Deployer and Wallet from zkSync tools.
- For Ethereum networks, maintained existing deployment flow using ethers and custom providers.

Compiled and deployed missing libraries:
- Addressed compilation warnings about missing libraries by running npx hardhat deploy-zksync:libraries.
- This step compiles and deploys any Solidity libraries that the contracts depend on, which is required by zkSync.
- Updated hardhat.config.ts with the addresses of deployed libraries under zksolc.settings.libraries to enable proper linking during contract compilation.

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