Home
zkSync API Reference Overview
Web3 API
L1 contracts interface
  • Home
  • /
  • L1 contracts interface

L1 contracts interface

What's on the page
  • @matterlabs/zksync-contracts reference

To interact with zkSync from L1, you need the interface of its canonical bridge. There are two main ways to import it to your codebase:

  • By importing it from the @matterlabs/zksync-contracts npm package. (preferred)
  • By downloading the contracts from the repo.

The guide on interacting with the zkSync canonical bridge with examples in both Solidity and zksync-web3 SDK can be found here.

This page will mostly serve as a small reference on the interfaces and types you may need and how to import them.

@matterlabs/zksync-contracts reference

  • @matterlabs/zksync-contracts/contracts/interfaces/IZkSync.sol is the file where the zkSync L1 contract interface IZkSync is located. Particular interest is in the IBridge functionality. Its implementation can be found here.
  • @matterlabs/zksync-contracts/libraries/Operations.sol is the file where the Operations library with all the user types in the bridge is stored. Its implementation can be found here.

The code in the repository may contain some of the configuration constants. These are placeholder values taken from the development environment. You should use the library only for the interfaces and types it provides.

Last updated: 7/5/2022, 1:42:16 PM
Previous
Web3 API
Edit on GitHub
  • @matterlabs/zksync-contracts reference