Skip to content

Latest commit

 

History

History
68 lines (44 loc) · 2.21 KB

README.md

File metadata and controls

68 lines (44 loc) · 2.21 KB

ZKsync 101

This project was scaffolded with ZKsync CLI.

ZKsync 101 is a quick start template to help you learn how to be a super developer using ZKsync CLI to build projects in the ZKsync ecosystem!

This project is a Nodejs project that uses hardhat, viem, and solidity. You will learn how to build, deploy and test smart contracts with hardhat onto the ZKsync in memory node and use ZKsync CLI to interact with the contracts.

Project Layout

  • /contracts: Contains solidity smart contracts.
  • /deploy: Scripts for contract deployment and interaction.
  • /test: Test files.
  • hardhat.config.ts: Configuration settings, the default network is set to "inMemoryNode".

How to Use

  1. Install dependencies with npm install --force.

  2. Configure your ZKsync CLI to use the In memory node settings for dev.

    zksync-cli dev config
  3. Start up a local in-memory node with ZKsync CLI with the following command:

    zksync-cli dev start
  4. Follow along on ZKsync Docs in our ZKsync 101!

Environment Settings

This project pulls in environment variables from .env files.

Rename .env.example to .env, the provided private key is a local rich wallet that is available in the local in-memory node.

WALLET_PRIVATE_KEY=your_private_key_here...

Local Tests

Running npm run test by default runs the ZKsync In-memory Node provided by the @matterlabs/hardhat-zksync-node tool.

Important: ZKsync In-memory Node currently supports only the L2 node. If contracts also need L1, use another testing environment like Dockerized Node. Refer to test documentation for details.

Useful Links

Contract Address - 0x491475742259B5998330A820648c0F5b4E3570b7

License

This project is under the MIT license.