L1 contracts interface
What's on the page
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-contractsnpm 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.solis the file where the zkSync L1 contract interfaceIZkSyncis located. Particular interest is in theIBridgefunctionality. Its implementation can be found here.@matterlabs/zksync-contracts/libraries/Operations.solis the file where theOperationslibrary 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:
Previous
Web3 API