Overview
Validium Network is adopting zkSync Foundry as its development framework, leveraging its scalability and security to enhance decentralized operations and provide a seamless environment for developers.
Last updated
Validium Network is adopting zkSync Foundry as its development framework, leveraging its scalability and security to enhance decentralized operations and provide a seamless environment for developers.
Last updated
is a specialized fork of , tailored for ZKsync.
It extends Foundry's capabilities for Ethereum app development to support ZKsync, allowing for the compilation, deployment, testing, and interaction with smart contracts on ZKsync.
This section covers everything from installation to migration, ensuring that you’re equipped to begin using Foundry ZKsync effectively and efficiently. For a more in-depth review of Foundry ZKsync please refer to the .
Set up your development environment with Foundry and ZKsync, ensuring you're ready to start building and testing your projects.
Dive into the basics with a simple project setup, including running tests and deploying contracts on ZKsync.
Step-by-step guide to migrating your existing projects to ZKsync using Foundry.
Learn best practices for testing your contracts with Foundry ZKsync
Foundry ZKsync is currently in its alpha stage, indicating ongoing development and potential for future enhancements. It is open-sourced, and contributions from the developer community are welcome. For more details and contributions, visit the .
To work with ZKsync, you only need to make a few minor adjustments to your existing Foundry workflow. These changes ensure your smart contracts are fully compatible with ZKsync's zkEVM and reserved address space.
Compilation:
Contracts are compiled using both solc
and zksolc
. Foundry ZKsync manages this automatically, but you should ensure the correct compiler versions are specified in your configuration (foundry.toml
).
Reserved Addresses:
ZKsync reserves addresses below 65536
for internal use. Ensure that any addresses you hardcode or use in tests are above this range.
You can configure fuzz testing to avoid generating reserved addresses using the no_zksync_reserved_addresses
option.
Fuzz Testing:
Fuzz tests can be configured to respect ZKsync's reserved address range. You can use the no_zksync_reserved_addresses = true
option in your test configuration to avoid manual filtering of invalid addresses.
Running Tests on ZKsync:
To target ZKsync in your tests, you can enable ZKsync-specific behaviors by adding --zksync
to your forge
commands or using vm.zkVm(true)
in your test setup.
Foundry ZKsync simplifies developing and testing smart contracts on ZKsync with minimal changes to your workflow. With the installation and migration guides, you’ll be able to start building quickly while benefiting from ZKsync's scalability.
For more details or to get started, check out the or dive into the section.