Foundry
Foundry ZKsync is a specialized fork of Foundry, adapted for use with Sophon and other ZK Stack-based chains. It extends Foundry's robust Ethereum development capabilities to support ZK Stack technology, enabling compilation, deployment, testing, and interaction with smart contracts on Sophon's Validium network.
⚠️ Alpha Stage: The project its alpha stage, indicating ongoing development and potential for future improvements.
For detailed information, including installation instructions, usage examples, and advanced guides, please refer to the Foundry ZKsync Book.
Key Differences
Compilation:
Contracts are compiled using both
solc
andzksolc
. Foundry ZKsync manages this automatically, but ensure correct compiler versions are specified in yourfoundry.toml
.
Reserved Addresses:
Sophon, like other ZK Stack chains, reserves addresses below
65536
for internal use. Ensure any hardcoded addresses in tests are above this range.Configure fuzz testing to avoid generating reserved addresses using the
no_zksync_reserved_addresses
option.
Fuzz Testing:
Use
no_zksync_reserved_addresses = true
in your test configuration to respect Sophon's reserved address range.
Running Tests on Sophon:
Enable Sophon-specific behaviors by adding
-zksync
to yourforge
commands or usingvm.zkVm(true)
in your test setup.
For more detailed instructions and advanced usage, please refer to https://docs.zksync.io/build/tooling/foundry/overview
Last updated