Skip to content
This repository was archived by the owner on Jun 23, 2026. It is now read-only.
matter-labs-archivePublic archive

About

Extension to forge-std for foundry-zksync

Resources

Stars

2 stars

Watchers

4 watching

Forks

Latest commit

 

History

4 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Forge ZKsync Standard Library

Forge ZKsync Standard Library is a collection of helpful contracts and libraries for use with Forge and Foundry ZKsync. It leverages Forge's cheatcodes to make writing tests easier and faster, while improving the UX of cheatcodes.

Learn how to use Forge-ZKsync-Std with the 📖 Foundry ZKsync Book.

Install

forge install matter-labs/forge-zksync-std

Usage

Test:

import {Test, console2 as console} from "forge-std/Test.sol";
import {TestExt} from "forge-zksync-std/TestExt.sol";

contract FooTest is Test, TestExt {
    function testZkTraceOutputDuringCreate() public {
        vm.startPrank(address(65536));  // normal foundry cheatcodes
        new Contract1();

        vmExt.zkVmSkip();               // additional foundry-zksync cheatcodes
        new Contract2();
    }
}

Script:

import {Test, console2 as console} from "forge-std/Test.sol";
import {ScriptExt} from "forge-zksync-std/ScriptExt.sol";

contract FooScript is Script, ScriptExt {
    function deployTwoUserMultisig() public {
        Factory factory = new Factory(multisigBytecodeHash);

        // Mark the bytecode as a factory dependency
        vmExt.zkUseFactoryDep("TwoUserMultisig");

        // Deploy the account using the factory
        factory.deployAccount(multisigBytecodeHash);
    }
}

About

Extension to forge-std for foundry-zksync

Resources

Stars

2 stars

Watchers

4 watching

Forks

Releases

Packages

Contributors

Languages