Validium Docs
  • Overview
  • Connect to Validium
  • Start Coding 🚀
    • Quickstart
      • Overview
      • Deploy using Validium CLI
      • Deploy using Quickstart Repository
      • Deploy your first contract
      • Create an ERC20 token
  • Tooling
    • Block Explorers
    • Hardhat-Validium
      • Overview
      • Installation
      • Guides
        • Getting started
        • Migrating Hardhat project to Validium
        • Compiling non-inlinable libraries
      • Plugins
        • hardhat-zksync
        • hardhat-zksync-solc
        • hardhat-zksync-vyper
        • hardhat-zksync-deploy
        • hardhat-zksync-upgradable
        • hardhat-zksync-verify
        • hardhat-zksync-verify-vyper
        • hardhat-zksync-ethers
        • hardhat-zksync-node
        • Hardhat Community Plugins
    • Foundary
      • Overview
      • Installation
      • Getting Started
      • Migration Guide
        • Overview
        • Compilation
        • Deployment
        • Testing
  • Test and Debug
    • Getting Started
    • Docker L1 - L2 Nodes
    • In-Memory Node
    • Continuous Integration
    • Hardhat
    • Foundry
  • API Reference
    • Overview
    • Conventions
    • ZKs JSON-RPC API
    • Debug JSON-RPC API
    • Ethereum JSON-RPC API
    • PubSub JSON-RPC API
  • Concepts
    • Transaction Lifecycle
    • Blocks and Batches
    • Validium Network Fee Mechanism
    • Finality
    • System Upgrades
    • ZK Chains
    • Data Availability
      • Overview
      • Recreating L2 state from L1 pubdata
      • Validiums
    • Account Abstraction
    • L1 <-> L2 Communication
  • Components
    • Overview
    • Smart & System Contracts
      • Smart Contracts
      • System Contracts
    • Shared Bridges
    • Sequencer / Server
    • Validium Network EVM
      • Overview
      • Bootloader
      • Precompiles
      • Virtual Machine Specification
        • ZKsync Virtual Machine primer
        • VM Formal Specification
    • Prover
      • Overview
      • ZK Terminology
      • Running the Prover
      • Circuits
        • Overview
        • Circuit Testing
        • CodeDecommitter
        • DemuxLogQueue
        • ECRecover
        • KeccakRoundFunction
        • L1MessagesHasher
        • LogSorter
        • Main VM
        • RAMPermutation
        • Sha256RoundFunction
        • StorageApplication
        • Sorting and Deduplicating
          • Overview
          • SortDecommitments
          • StorageSorter
          • LogSorter
      • Boojum Gadgets
      • Boojum Function - `check_if_satisfied`
    • Compiler
      • Compiler Toolchain Overview
        • Compiler Toolchain Overview
        • Solidity Compiler
        • Vyper Compiler
        • LLVM Framework
      • Specification
        • Overview
        • Code Separation
        • System Contracts
        • Exception Handling
        • EVM Legacy Assembly Translator
        • Instructions
          • Instruction Reference
          • EVM
            • Native EVM Instructions
            • Arithmetic
            • Bitwise
            • Block
            • Call
            • Create
            • Environment
            • Logging
            • Logical
            • Memory
            • Return
            • Sha3
            • Stack
          • Extensions
            • Overview
            • Validium Network Extension Simulation (call)
            • Validium Network Extension Simulation (verbatim)
          • EVM Legacy Assembly
          • Yul
        • EraVM Binary Layout
    • Fee Withdrawer
    • Portal - Wallet + Bridge
    • Block Explorer
    • Transaction filtering
Powered by GitBook
On this page
  1. Tooling
  2. Foundary

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.

PreviousFoundaryNextInstallation

Last updated 7 months ago


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

Status and Contribution

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 .

Using Foundry with ZKsync

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.

Differences

  1. 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).

  2. 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.

  3. 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.

  4. 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.

Foundry ZKsync
Foundry
Foundry ZKsync book on zksync.io
Installation
Getting Started
Migration Guide
Testing
GitHub repository
Installation Guide
Getting Started