Skip to content

Latest commit

 

History

History
127 lines (89 loc) · 3.67 KB

04_zkSync_development_tools.md

File metadata and controls

127 lines (89 loc) · 3.67 KB

ETAAcademy-ZKMeme: 4. ZkSync Development Tools

title tags
04. ZkSync Development Tools
zk-meme basic quick_read zkSync_development_tools

GithubTwitterETA-ZK-Meme

Authors: Evta, looking forward to your joining

More Details for ZKSync Development Tools: English Chinese

  1. Blockchain Explorer: zkSync Era Block Explorer;

  2. zkSync Faucet Chainstack Faucet;

  3. zkSync CLI: zkSync CLI is a command line tool used to simplify zkSync development and interaction.

  4. Running with zksync-cli:

npx zksync-cli dev start;
  1. Configure custom chains
npx zksync-cli config chains;
  1. Used to operate contracts on the chain (read, write, etc.)
npx zksync-cli contract read
  1. Query on-chain transaction information (transaction status, transfer amount, gas fee, etc.);
npx zksync-cli transaction info [options]

options:
-full: query detailed information
-raw: display the original JSON response;
  1. Create projects (front-end, smart contracts and scripts).
npx zksync-cli create
  1. Wallet is used to manage wallet-related functions (transfers, balance inquiries, etc.). Balance query:
npx zksync-cli wallet balance [options]
options:
-address: The address where you want to query the balance;
-token: If you want to query ERC20 tokens, you can add this parameter and pass in the contract address; -chain: Specify which chain to query on;
-rpc: specify the RPC URL; used to handle cross-chain operations between Ethernet and zkSync.
  1. Use deposit to transfer assets from L1 to L2:
    npx zksync-cli bridge deposit;
  1. Use withdraw to transfer assets from L2 to L1:
npx zksync-cli bridge withdraw`
  1. Remix IDE also supports zkSync contract development(you need to start docker) by the zkSync Era Remix Plugin:
npx zksync-cli dev start
  1. Use zksync-cli to quickly create Hardhat projects:
npx zksync-cli create
  1. zksync-ethers extends the ethers library to support zkSync-specific features (such as account abstraction)

  2. foundry-zksync allows users to use foundry to develop smart contracts on zkSync, introducing zkforge and zkcast to extend the original forge and cast make it easier for developers to develop in zkSync.

  3. The command can create a template test project named test-demo Run the following two lines of commands to install the third-party libraries that the project depends on, and add an additional zkSync data test tool package

npx zksync-cli create test-demo

npm install
npm install -D @matterlabs/hardhat-zksync-chai-matchers @nomicfoundation/hardhat-chai-matchers @nomiclabs/hardhat-ethers

Finally, run npm test to start the test. All test files in the test directory will be run. (zksolc and solc will be downloaded when starting for the first time. )