Skip to main content
Foundry-zksync is a fork of the Foundry toolchain built for the ZKsync VM that Abstract uses.

Foundry-zksync Book

View the full documentation for foundry-zksync.
Get started with Foundry-zksync by following the steps below.
1

Install foundry-zksync

Install the foundryup-zksync fork:
curl -L https://raw.githubusercontent.com/matter-labs/foundry-zksync/main/install-foundry-zksync | bash
Run foundryup-zksync to install forge, cast, and anvil:
foundryup-zksync
You may need to restart your terminal session after installation to continue.
Restart your terminal session.
To add the foundry binary to your PATH, run the following command:
export PATH="$PATH:/Users/<your-username-here>/.foundry/bin"
Replace <your-username-here> with the correct path to your home directory.
The libusb library may need to be installed manually on macOS. Run the following command to install the library:
brew install libusb
2

Verify installation

A helpful command to check if the installation was successful is:
forge build --help | grep -A 20 "ZKSync configuration:"
If installed successfully, 20 lines of --zksync options will be displayed.
3

Create a new project

Create a new project with forge and change directory into the project.
forge init my-abstract-project && cd my-abstract-project
I