Learn how to test your smart contracts using Foundry.
Write test definitions
/test
directory, for example, test/HelloWorld.t.sol
.Run tests
Cheatcode | Description |
---|---|
zkVm | Enables/disables ZKsync context for transactions. Switches between EVM and zkEVM execution environments. |
zkVmSkip | When running in zkEVM context, skips the next CREATE or CALL , executing it on the EVM instead. |
zkRegisterContract | Registers bytecodes for ZK-VM for transact/call and create instructions. Useful for testing with contracts already deployed on-chain. |
zkUsePaymaster | Configures a paymaster for the next transaction. Enables testing paymasters for gasless transactions. |
zkUseFactoryDep | Registers a factory dependency for the next transaction. Useful for testing complex contract deployments. |