snapshot
Create or compare gas snapshots for Foundry zkSync projects. Use diff to see differences, check to enforce unchanged gas values.
Instructions
Create or compare gas snapshots (forge snapshot --zksync). Use diff=true to compare against existing .gas-snapshot, check=true to fail on changes.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| projectPath | Yes | Absolute path to the foundry project directory | |
| profile | No | Foundry profile to use (maps to FOUNDRY_PROFILE env var). Selects a [profile.<name>] section from foundry.toml, e.g. 'zksync', 'ci', 'production'. | |
| filter | No | Regex passed to --match-test to filter which test functions run | |
| contractFilter | No | Regex passed to --match-contract to filter which test contracts run | |
| diff | No | If true, compare against the existing .gas-snapshot file and show differences | |
| check | No | If true, compare against existing snapshot and fail if any gas values changed |