zksync

Deploy contracts, paymasters, and smart accounts on zkSync Era using zksolc and zksync-ethers.

6|20|Updated Mar 14, 2026
One-click install
npx skills add https://github.com/andresdefi/cryptoskills --skill zksync-andresdefi
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: zksync
Source: https://github.com/andresdefi/cryptoskills/tree/main/skills/zksync
Command: npx skills add https://github.com/andresdefi/cryptoskills --skill zksync-andresdefi

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Developing on zkSync Era differs fundamentally from Ethereum: bytecode must be compiled with zksolc, CREATE2 address derivation includes constructor input hashes, all accounts are smart accounts, gas includes L1 pubdata costs, and opcodes like SELFDESTRUCT and EXTCODECOPY behave differently. This Skill prevents costly deployment mistakes and hallucinated contract addresses by providing verified chain configurations, system contract addresses, and working code patterns. ## Core Features & Use Cases - ZK-Specific Deployment: Deploy contracts via hardhat-zksync or foundry-zksync with correct zksolc compilation, ContractDeployer system contract flows, and zkSync-specific CREATE2 address computation. - Native Account Abstraction & Paymasters: Implement IAccount smart accounts (e.g., multi-sig) and IPaymaster contracts for gasless or ERC-20-paid transactions using General and ApprovalBased flows. - Bridging & Gas Management: Handle L1-to-L2 deposits, L2-to-L1 withdrawals with finalization, L2-to-L1 messaging, and dual-component gas estimation with gas_per_pubdata_byte_limit. - Use Case: You need to deploy a contract on zkSync Era and sponsor user gas. Use this Skill to configure hardhat-zksync, deploy via the Deployer class, implement a GeneralPaymaster contract, and send sponsored transactions with utils.getPaymasterParams. ## Quick Start Ask the agent to deploy a Greeter contract to zkSync Sepolia testnet using hardhat-zksync and verify it on the explorer.

Frequently Asked Questions about zksync

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I deploy a smart contract to zkSync Era?

Compile with zksolc via hardhat-zksync or foundry-zksync, then deploy using the Deployer class or forge create with the --zksync flag. All deployments route through the ContractDeployer system contract, so raw EVM bytecode from standard solc will not work.

How do I implement a paymaster for gasless transactions on zkSync?

Implement the IPaymaster interface with validateAndPayForPaymasterTransaction returning PAYMASTER_VALIDATION_SUCCESS_MAGIC and paying the bootloader. Use the General flow for full sponsorship or ApprovalBased flow to let users pay gas in ERC-20 tokens via utils.getPaymasterParams.

Why does CREATE2 give a different address on zkSync than Ethereum?

zkSync CREATE2 derivation includes keccak256 of the constructor input as an extra parameter, unlike Ethereum's formula. Use utils.create2Address from zksync-ethers with deployer, bytecodeHash, salt, and constructorInput instead of ethers.getCreate2Address.

Does zkSync Era support standard Ethereum tooling like Hardhat and Foundry?

Yes, through forks: @matterlabs/hardhat-zksync for Hardhat and foundry-zksync for Foundry. Both compile with zksolc instead of solc, and zksync-ethers replaces standard ethers provider methods for zkSync-specific transaction fields.

Why does extcodesize return non-zero for EOAs on zkSync?

All zkSync accounts are smart accounts, so EOAs carry the default account implementation bytecode. Code using extcodesize > 0 to detect contracts produces false positives; avoid this check entirely on zkSync.

How long do zkSync Era withdrawals to Ethereum take?

Withdrawals require ZK proof generation and L1 verification, typically taking 1-3 hours. After proof verification, call wallet.finalizeWithdrawal with the L2 transaction hash to claim funds on L1; check readiness with isWithdrawalFinalized.