---
description: "Create a gas snapshot of each test's gas usage Examples: - forge snapshot - forge snapshot --diff (compare against the existing .gas-snapshot file) - forge snapshot --check (fail if gas usage does not match .gas-snapshot)"
---

_Generated from `forge snapshot --help`; see [CLI reference versions](/reference/versions). Regenerate this page instead of editing it directly._

## forge snapshot

Create a gas snapshot of each test's gas usage

Examples:
- forge snapshot
- forge snapshot --diff (compare against the existing .gas-snapshot file)
- forge snapshot --check (fail if gas usage does not match .gas-snapshot)

:::terminal

```bash
$ forge snapshot --help
```

```txt
Usage: forge snapshot [OPTIONS] [PATH]

Options:
      --diff [<SNAPSHOT_FILE>]
          Output a diff against a pre-existing gas snapshot.
          
          By default, the comparison is done with .gas-snapshot.

      --check [<SNAPSHOT_FILE>]
          Compare against a pre-existing gas snapshot, exiting with code 1 if
          they do not match.
          
          Outputs a diff if the gas snapshots do not match.
          
          By default, the comparison is done with .gas-snapshot.

      --snap <FILE>
          Output file for the gas snapshot
          
          [default: .gas-snapshot]

      --tolerance <SNAPSHOT_THRESHOLD>
          Tolerates gas deviations up to the specified percentage

      --diff-sort <ORDER>
          How to sort diff results

          Possible values:
          - percentage:      Sort by percentage change (smallest to largest) -
            default behavior
          - percentage-desc: Sort by percentage change (largest to smallest)
          - absolute:        Sort by absolute gas change (smallest to largest)
          - absolute-desc:   Sort by absolute gas change (largest to smallest)

  -h, --help
          Print help (see a summary with '-h')

Display options:
  -v, --verbosity...
          Verbosity level of the log messages.
          
          Pass multiple times to increase the verbosity (e.g. -v, -vv, -vvv).
          
          Depending on the context the verbosity levels have different meanings.
          
          For example, the verbosity levels of the EVM are:
          - 2 (-vv): Print logs for all tests.
          - 3 (-vvv): Print execution traces for failing tests.
          - 4 (-vvvv): Print execution traces for all tests, and setup traces
          for failing tests.
          - 5 (-vvvvv): Print execution and setup traces for all tests,
          including storage changes and
            backtraces with line numbers.

  -q, --quiet
          Do not print log messages

      --json
          Format log messages as JSON

      --md
          Format log messages as Markdown

      --color <COLOR>
          The color of the log messages

          Possible values:
          - auto:   Intelligently guess whether to use color output (default)
          - always: Force color output
          - never:  Force disable color output

      --junit
          Output test results as JUnit XML report

  -l, --list
          List tests instead of running them

      --show-progress
          Show test execution progress

      --summary
          Print test summary table

      --detailed
          Print detailed test summary table

Test options:
  -j, --threads <THREADS>
          Number of threads to use. Specifying 0 defaults to the number of
          logical cores
          
          [alias: --jobs]

      --profile <PROFILE>
          The configuration profile to use

      --debug
          Run a single test in the debugger.
          
          The matching test will be opened in the debugger regardless of the
          outcome of the test.
          
          If the matching test is a fuzz test, then it will open the debugger on
          the first failure case. If the fuzz test does not fail, it will open
          the debugger on the last fuzz case.

      --debug-layout <DEBUG_LAYOUT>
          Debugger layout to use

          Possible values:
          - auto:       Select horizontal or vertical layout from the terminal
            size
          - horizontal: Force the two-column debugger layout
          - vertical:   Force the single-column debugger layout

      --flamegraph
          Generate a flamegraph for a single test. Implies `--decode-internal`.
          
          A flame graph is used to visualize which functions or operations
          within the smart contract are consuming the most gas overall in a
          sorted manner.

      --flamechart
          Generate a flamechart for a single test. Implies `--decode-internal`.
          
          A flame chart shows the gas usage over time, illustrating when each
          function is called (execution order) and how much gas it consumes at
          each point in the timeline.

      --evm-profile [<FORMAT>]
          Generate an execution profile for a single test.
          
          Creates a profile where each EVM call is recorded with gas
          consumption. Opens the profile in speedscope.app unless `--no-open` is
          passed. Implies `--decode-internal`.

          Possible values:
          - speedscope: Speedscope format, opens in speedscope.app

      --no-open
          Don't open the profile in the browser (for `--evm-profile`).
          
          The profile is saved to disk without starting the local viewer server.

      --dump <PATH>
          Dumps all debugger steps to file

      --gas-report
          Print a gas report
          
          [env: FORGE_GAS_REPORT=]

      --gas-snapshot-check <GAS_SNAPSHOT_CHECK>
          Check gas snapshots against previous runs
          
          [env: FORGE_SNAPSHOT_CHECK=]
          [possible values: true, false]

      --gas-snapshot-emit <GAS_SNAPSHOT_EMIT>
          Enable/disable recording of gas snapshot results
          
          [env: FORGE_SNAPSHOT_EMIT=]
          [possible values: true, false]

      --allow-failure
          Exit with code 0 even if a test fails
          
          [env: FORGE_ALLOW_FAILURE=]

      --fail-fast
          Stop running tests after the first failure

      --etherscan-api-key <KEY>
          The Etherscan (or equivalent) API key
          
          [env: ETHERSCAN_API_KEY=]

      --fuzz-seed <FUZZ_SEED>
          Set seed used to generate randomness during your fuzz runs

      --fuzz-runs <RUNS>
          [env: FOUNDRY_FUZZ_RUNS=]

      --invariant-workers <WORKERS>
          Number of workers to use for invariant test campaigns, or `auto` to
          derive from `--jobs`
          
          [env: FOUNDRY_INVARIANT_WORKERS=]

      --fuzz-run <RUN>
          Run only the fuzz case at the given 1-based run index
          
          [env: FOUNDRY_FUZZ_RUN=]

      --fuzz-worker <WORKER>
          Run the fuzz case from the given worker. Requires `--fuzz-run`
          
          [env: FOUNDRY_FUZZ_WORKER=]

      --fuzz-timeout <TIMEOUT>
          Timeout for each fuzz run in seconds
          
          [env: FOUNDRY_FUZZ_TIMEOUT=]

      --fuzz-dictionary-weight <PERCENT>
          Percent of fuzz calldata generated from the dictionary
          
          [env: FOUNDRY_FUZZ_DICTIONARY_WEIGHT=]

      --fuzz-dictionary-addresses <N|max>
          Maximum fuzz dictionary addresses, or `max`
          
          [env: FOUNDRY_FUZZ_MAX_FUZZ_DICTIONARY_ADDRESSES=]

      --fuzz-dictionary-values <N|max>
          Maximum fuzz dictionary values, or `max`
          
          [env: FOUNDRY_FUZZ_MAX_FUZZ_DICTIONARY_VALUES=]

      --fuzz-dictionary-literals <N|max>
          Maximum fuzz dictionary literals, or `max`
          
          [env: FOUNDRY_FUZZ_MAX_FUZZ_DICTIONARY_LITERALS=]

      --fuzz-corpus-random-sequence-weight <PERCENT>
          Percent chance that coverage-guided fuzzing generates fresh input
          instead of mutating corpus input
          
          [env: FOUNDRY_FUZZ_CORPUS_RANDOM_SEQUENCE_WEIGHT=]

      --fuzz-corpus-dir <PATH>
          Directory for fuzz corpus persistence
          
          [env: FOUNDRY_FUZZ_CORPUS_DIR=]

      --fuzz-frontier-dir <PATH>
          Directory for fuzz branch frontier artifacts
          
          [env: FOUNDRY_FUZZ_FRONTIER_DIR=]

      --fuzz-frontier-limit <COUNT>
          Maximum number of fuzz branch frontier records to write per test
          
          [env: FOUNDRY_FUZZ_FRONTIER_LIMIT=]

      --fuzz-payable-value-weight <PERCENT>
          Percent chance that fuzzed payable calls carry non-zero msg.value
          
          [env: FOUNDRY_FUZZ_PAYABLE_VALUE_WEIGHT=]

      --fuzz-mutation-weight-splice <WEIGHT>
          Corpus mutation weight for splice
          
          [env: FOUNDRY_FUZZ_MUTATION_WEIGHT_SPLICE=]

      --fuzz-mutation-weight-repeat <WEIGHT>
          Corpus mutation weight for repeat
          
          [env: FOUNDRY_FUZZ_MUTATION_WEIGHT_REPEAT=]

      --fuzz-mutation-weight-interleave <WEIGHT>
          Corpus mutation weight for interleave
          
          [env: FOUNDRY_FUZZ_MUTATION_WEIGHT_INTERLEAVE=]

      --fuzz-mutation-weight-prefix <WEIGHT>
          Corpus mutation weight for prefix replacement
          
          [env: FOUNDRY_FUZZ_MUTATION_WEIGHT_PREFIX=]

      --fuzz-mutation-weight-suffix <WEIGHT>
          Corpus mutation weight for suffix replacement
          
          [env: FOUNDRY_FUZZ_MUTATION_WEIGHT_SUFFIX=]

      --fuzz-mutation-weight-abi <WEIGHT>
          Corpus mutation weight for ABI argument mutation
          
          [env: FOUNDRY_FUZZ_MUTATION_WEIGHT_ABI=]

      --fuzz-mutation-weight-cmp <WEIGHT>
          Corpus mutation weight for comparison-operand mutation
          
          [env: FOUNDRY_FUZZ_MUTATION_WEIGHT_CMP=]

      --fuzz-input-file <FUZZ_INPUT_FILE>
          File to rerun fuzz failures from

      --invariant-depth <DEPTH>
          Number of calls executed to try to break invariants in one run
          
          [env: FOUNDRY_INVARIANT_DEPTH=]

      --invariant-min-depth <DEPTH>
          Minimum sampled invariant depth when `--invariant-depth-mode random`
          is active
          
          [env: FOUNDRY_INVARIANT_MIN_DEPTH=]

      --invariant-depth-mode <fixed|random>
          How invariant run depth is selected
          
          [env: FOUNDRY_INVARIANT_DEPTH_MODE=]

      --invariant-dictionary-weight <PERCENT>
          Percent of invariant calldata/senders generated from the dictionary
          
          [env: FOUNDRY_INVARIANT_DICTIONARY_WEIGHT=]

      --invariant-dictionary-addresses <N|max>
          Maximum invariant dictionary addresses, or `max`
          
          [env: FOUNDRY_INVARIANT_MAX_FUZZ_DICTIONARY_ADDRESSES=]

      --invariant-dictionary-values <N|max>
          Maximum invariant dictionary values, or `max`
          
          [env: FOUNDRY_INVARIANT_MAX_FUZZ_DICTIONARY_VALUES=]

      --invariant-dictionary-literals <N|max>
          Maximum invariant dictionary literals, or `max`
          
          [env: FOUNDRY_INVARIANT_MAX_FUZZ_DICTIONARY_LITERALS=]

      --invariant-corpus-random-sequence-weight <PERCENT>
          Percent chance that coverage-guided invariant fuzzing injects fresh
          calls while extending corpus sequences
          
          [env: FOUNDRY_INVARIANT_CORPUS_RANDOM_SEQUENCE_WEIGHT=]

      --invariant-corpus-dir <PATH>
          Directory for invariant corpus persistence
          
          [env: FOUNDRY_INVARIANT_CORPUS_DIR=]

      --invariant-payable-value-weight <PERCENT>
          Percent chance that fuzzed payable invariant calls carry non-zero
          msg.value
          
          [env: FOUNDRY_INVARIANT_PAYABLE_VALUE_WEIGHT=]

      --invariant-mutation-weight-splice <WEIGHT>
          Corpus mutation weight for splice
          
          [env: FOUNDRY_INVARIANT_MUTATION_WEIGHT_SPLICE=]

      --invariant-mutation-weight-repeat <WEIGHT>
          Corpus mutation weight for repeat
          
          [env: FOUNDRY_INVARIANT_MUTATION_WEIGHT_REPEAT=]

      --invariant-mutation-weight-interleave <WEIGHT>
          Corpus mutation weight for interleave
          
          [env: FOUNDRY_INVARIANT_MUTATION_WEIGHT_INTERLEAVE=]

      --invariant-mutation-weight-prefix <WEIGHT>
          Corpus mutation weight for prefix replacement
          
          [env: FOUNDRY_INVARIANT_MUTATION_WEIGHT_PREFIX=]

      --invariant-mutation-weight-suffix <WEIGHT>
          Corpus mutation weight for suffix replacement
          
          [env: FOUNDRY_INVARIANT_MUTATION_WEIGHT_SUFFIX=]

      --invariant-mutation-weight-abi <WEIGHT>
          Corpus mutation weight for ABI argument mutation
          
          [env: FOUNDRY_INVARIANT_MUTATION_WEIGHT_ABI=]

      --invariant-mutation-weight-cmp <WEIGHT>
          Corpus mutation weight for comparison-operand mutation
          
          [env: FOUNDRY_INVARIANT_MUTATION_WEIGHT_CMP=]

      --symbolic
          Run symbolic check*/prove*/invariant*/statefulFuzz* tests
          
          [env: FOUNDRY_SYMBOLIC=]

      --replay-symbolic-artifact <PATH>
          Replay a durable symbolic counterexample artifact emitted by `forge
          test --symbolic`

      --emit-regression
          Emit Solidity regression tests for confirmed symbolic counterexamples
          
          [env: FOUNDRY_SYMBOLIC_EMIT_REGRESSION=]

      --regression-out <PATH>
          File or directory for generated symbolic regression tests
          
          [env: FOUNDRY_SYMBOLIC_REGRESSION_OUT=]

      --regression-overwrite
          Overwrite existing generated symbolic regression tests
          
          [env: FOUNDRY_SYMBOLIC_REGRESSION_OVERWRITE=]

      --symbolic-seed-corpus
          Run fuzz tests symbolically and persist non-failing concrete inputs to
          the fuzz corpus
          
          [env: FOUNDRY_SYMBOLIC_SEED_CORPUS=]

      --symbolic-use-fuzz-corpus
          Run fuzz tests symbolically using existing fuzz corpus entries as
          path-priority hints
          
          [env: FOUNDRY_SYMBOLIC_USE_FUZZ_CORPUS=]

      --symbolic-corpus-seed-limit <COUNT>
          Maximum number of fuzz corpus entries to import for one symbolic test
          
          [env: FOUNDRY_SYMBOLIC_CORPUS_SEED_LIMIT=]

      --symbolic-use-fuzz-frontiers
          Run targeted symbolic solving from existing fuzz branch frontier
          artifacts
          
          [env: FOUNDRY_SYMBOLIC_USE_FUZZ_FRONTIERS=]

      --symbolic-frontier-limit <COUNT>
          Maximum number of fuzz branch frontiers to try for one symbolic test
          
          [env: FOUNDRY_SYMBOLIC_FRONTIER_LIMIT=]

      --symbolic-frontier-ids <IDS>
          Comma-separated fuzz branch frontier artifact IDs to try
          
          [env: FOUNDRY_SYMBOLIC_FRONTIER_IDS=]

      --symbolic-frontier-pcs <PCS>
          Comma-separated fuzz branch frontier comparison PCs to try
          
          [env: FOUNDRY_SYMBOLIC_FRONTIER_PCS=]

      --symbolic-frontier-selectors <SELECTORS>
          Comma-separated fuzz branch frontier calldata selectors to try
          
          [env: FOUNDRY_SYMBOLIC_FRONTIER_SELECTORS=]

      --symbolic-solver <PATH_OR_NAME>
          Solver executable used for symbolic tests
          
          [env: FOUNDRY_SYMBOLIC_SOLVER=]

      --symbolic-solver-command <COMMAND>
          Exact solver command used for symbolic tests
          
          [env: FOUNDRY_SYMBOLIC_SOLVER_COMMAND=]

      --symbolic-solver-portfolio <SOLVER_OR_COMMAND,...>
          Comma-separated SMT solver names or commands to race in parallel for
          symbolic tests
          
          [env: FOUNDRY_SYMBOLIC_SOLVER_PORTFOLIO=]

      --symbolic-timeout <SECONDS>
          SMT solver timeout in seconds; also bounds symbolic invariant
          exploration
          
          [env: FOUNDRY_SYMBOLIC_TIMEOUT=]

      --symbolic-loop <N>
          Halmos-compatible symbolic loop bound
          
          [env: FOUNDRY_SYMBOLIC_LOOP=]

      --symbolic-depth <N>
          Halmos-compatible symbolic execution depth alias
          
          [env: FOUNDRY_SYMBOLIC_DEPTH=]

      --symbolic-width <N>
          Halmos-compatible symbolic path width alias
          
          [env: FOUNDRY_SYMBOLIC_WIDTH=]

      --symbolic-max-depth <N>
          Maximum number of opcodes executed along a symbolic path
          
          [env: FOUNDRY_SYMBOLIC_MAX_DEPTH=]

      --symbolic-max-paths <N>
          Maximum number of symbolic paths to explore per test
          
          [env: FOUNDRY_SYMBOLIC_MAX_PATHS=]

      --symbolic-invariant-depth <N>
          Maximum number of calls in a bounded symbolic invariant sequence
          
          [env: FOUNDRY_SYMBOLIC_INVARIANT_DEPTH=]

      --symbolic-max-solver-queries <N>
          Maximum number of solver queries per symbolic test
          
          [env: FOUNDRY_SYMBOLIC_MAX_SOLVER_QUERIES=]

      --symbolic-default-dynamic-length <N>
          Default bounded length for symbolic dynamic ABI inputs
          
          [env: FOUNDRY_SYMBOLIC_DEFAULT_DYNAMIC_LENGTH=]

      --symbolic-max-dynamic-length <N>
          Maximum permitted bounded length for symbolic dynamic ABI inputs
          
          [env: FOUNDRY_SYMBOLIC_MAX_DYNAMIC_LENGTH=]

      --symbolic-array-lengths <N,...>
          Per-dynamic-input symbolic lengths, applied in ABI traversal order
          
          [env: FOUNDRY_SYMBOLIC_ARRAY_LENGTHS=]

      --symbolic-max-calldata-bytes <N>
          Maximum symbolic calldata size in bytes
          
          [env: FOUNDRY_SYMBOLIC_MAX_CALLDATA_BYTES=]

      --symbolic-call-targets
          Expand symbolic external call targets over known deployed contracts
          
          [env: FOUNDRY_SYMBOLIC_CALL_TARGETS=]

      --symbolic-dump-smt
          Dump SMT-LIB queries issued by symbolic tests
          
          [env: FOUNDRY_SYMBOLIC_DUMP_SMT=]

      --symbolic-storage-layout <solidity|generic>
          Symbolic storage modelling mode
          
          [env: FOUNDRY_SYMBOLIC_STORAGE_LAYOUT=]
          [possible values: solidity, generic]

      --rerun
          Re-run recorded test failures from last run. If no failure recorded
          then regular test run is performed

      --opcodes <OPCODES>
          Print the given opcodes in trace output, with their gas cost and the
          storage slot and value, if available.
          
          Accepts a comma-separated list of opcode names, e.g. `--opcodes
          SLOAD,MLOAD,SSTORE`. Names are in uppercase. Requires `-vvvvv` to
          render.

  [PATH]
          The contract file you want to test, it's a shortcut for --match-path

Trace options:
      --decode-internal
          Identify internal functions in traces.
          
          This will trace internal functions and decode stack parameters.
          
          Parameters stored in memory (such as bytes or arrays) are currently
          decoded only when a single function is matched, similarly to
          `--debug`, for performance reasons.

      --trace-depth <DEPTH>
          Maximum depth of rendered traces

      --disable-labels
          Disable labels in traces

      --compact-labels
          Hide addresses in trace parameters when a label is available

      --labels <ADDRESS:LABEL>
          Label addresses in traces.
          
          Example: 0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045:vitalik.eth
          
          [alias: --label]

      --disable-external-identification
          Disable external trace identification using Sourcify, Etherscan, or
          OpenChain

  -s, --suppress-successful-traces
          Suppress successful test traces and show only traces for failures
          
          [env: FORGE_SUPPRESS_SUCCESSFUL_TRACES=]

Showmap replay:
      --showmap-out <DIR>
          Replay the persisted corpus and emit AFL-`afl-showmap`-style coverage
          files at the given output directory. Disables the regular
          fuzz/invariant campaign and skips unit tests

      --showmap-per-input
          Emit one showmap file per corpus entry (default: one aggregated file
          per test)

      --showmap-domain <SHOWMAP_DOMAIN>
          Coverage domain(s) to dump
          
          [default: evm]
          [possible values: evm, sancov, both]

      --showmap-approach <SHOWMAP_APPROACH>
          Approach name (used as a subdirectory of `--showmap-out`)
          
          [default: replay]

      --showmap-trial <SHOWMAP_TRIAL>
          Trial identifier embedded in each showmap filename. Defaults to a
          unique `trial-<unix_nanos>` so reruns don't overwrite previous trials

      --showmap-corpus-dir <PATH>
          Override the corpus directory to replay (defaults to the per-test
          `corpus_dir` resolved from config)

Test filtering:
      --match-test <REGEX>
          Only run test functions matching the specified regex pattern
          
          [alias: --mt]

      --no-match-test <REGEX>
          Only run test functions that do not match the specified regex pattern
          
          [alias: --nmt]

      --match-contract <REGEX>
          Only run tests in contracts matching the specified regex pattern
          
          [alias: --mc]

      --no-match-contract <REGEX>
          Only run tests in contracts that do not match the specified regex
          pattern
          
          [alias: --nmc]

      --match-path <GLOB>
          Only run tests in source files matching the specified glob pattern
          
          [alias: --mp]

      --no-match-path <GLOB>
          Only run tests in source files that do not match the specified glob
          pattern
          
          [alias: --nmp]

      --no-match-coverage <REGEX>
          Only show coverage for files that do not match the specified regex
          pattern
          
          [alias: --nmco]

EVM options:
  -r, --rpc-url <URL>
          The RPC endpoint
          
          [alias: --fork-url]

  -k, --insecure
          Allow insecure RPC connections (accept invalid HTTPS certificates).
          
          When the provider's inner runtime transport variant is HTTP, this
          configures the reqwest client to accept invalid certificates.

      --rpc-timeout <RPC_TIMEOUT>
          Timeout for the RPC request in seconds.
          
          The specified timeout will be used to override the default timeout for
          RPC requests.
          
          Default value: 45
          
          [env: ETH_RPC_TIMEOUT=]

      --no-proxy
          Disable automatic proxy detection.
          
          Use this in sandboxed environments (e.g., Cursor IDE sandbox, macOS
          App Sandbox) where system proxy detection causes crashes. When
          enabled, HTTP_PROXY/HTTPS_PROXY environment variables and system proxy
          settings will be ignored.

      --compute-units-per-second <CUPS>
          Sets the number of assumed available compute units per second for this
          provider.
          
          default value: 330
          
          See also
          [https://docs.alchemy.com/reference/compute-units#what-are-cups-compute-units-per-second](https://docs.alchemy.com/reference/compute-units#what-are-cups-compute-units-per-second)

      --no-rpc-rate-limit
          Disables rate limiting for this node's provider.
          
          See also
          [https://docs.alchemy.com/reference/compute-units#what-are-cups-compute-units-per-second](https://docs.alchemy.com/reference/compute-units#what-are-cups-compute-units-per-second)
          
          [alias: --no-rate-limit]

      --fork-block-number <BLOCK>
          Fetch state from a specific block number over a remote endpoint.
          
          See --rpc-url.

      --fork-retries <RETRIES>
          Number of retries.
          
          See --rpc-url.

      --fork-retry-backoff <BACKOFF>
          Initial retry backoff on encountering errors.
          
          See --rpc-url.

      --no-storage-caching
          Explicitly disables the use of RPC caching.
          
          All storage slots are read entirely from the endpoint.
          
          This flag overrides the project's configuration file.
          
          See --rpc-url.

      --initial-balance <BALANCE>
          The initial balance of deployed test contracts

      --sender <ADDRESS>
          The address which will be executing tests/scripts

      --ffi
          Enable the FFI cheatcode

      --live-logs
          Whether to show `console.log` outputs in realtime during script/test
          execution

      --always-use-create-2-factory
          Use the create 2 factory in all cases including tests and
          non-broadcasting scripts

      --create2-deployer <ADDRESS>
          The CREATE2 deployer address to use, this will override the one in the
          config

Executor environment config:
      --code-size-limit <CODE_SIZE>
          EIP-170: Contract code size limit in bytes. Useful to increase this
          because of tests. By default, it is 0x6000 (~25kb)

      --chain <CHAIN>
          The chain name or EIP-155 chain ID
          
          [alias: --chain-id]

      --gas-price <GAS_PRICE>
          The gas price

      --block-base-fee-per-gas <FEE>
          The base fee in a block
          
          [alias: --base-fee]

      --tx-origin <ADDRESS>
          The transaction origin

      --block-coinbase <ADDRESS>
          The coinbase of the block

      --block-timestamp <TIMESTAMP>
          The timestamp of the block

      --block-number <BLOCK>
          The block number

      --block-difficulty <DIFFICULTY>
          The block difficulty

      --block-prevrandao <PREVRANDAO>
          The block prevrandao value. NOTE: Before merge this field was mix_hash

      --block-gas-limit <BLOCK_GAS_LIMIT>
          The block gas limit
          
          [alias: --gas-limit]

      --memory-limit <MEMORY_LIMIT>
          The memory limit per EVM execution in bytes. If this limit is
          exceeded, a `MemoryLimitOOG` result is thrown.
          
          The default is 128MiB.

      --disable-block-gas-limit
          Whether to disable the block gas limit checks
          
          [aliases: --no-block-gas-limit, --no-gas-limit]

      --enable-tx-gas-limit
          Whether to enable tx gas limit checks as imposed by Osaka (EIP-7825)
          
          [alias: --tx-gas-limit]

      --isolate
          Whether to enable isolation of calls. In isolation mode all top-level
          calls are executed as a separate transaction in a separate EVM
          context, enabling more precise gas accounting and transaction state
          changes

      --no-isolate
          Whether to disable isolation of calls

Networks:
  -n, --network <NETWORK>
          Enable a specific network family
          
          [possible values: ethereum, tempo]

      --celo
          Enable Celo network features

Cache options:
      --force
          Clear the cache and artifacts folder and recompile

Build options:
      --no-cache
          Disable the cache

      --no-dynamic-test-linking
          Disable dynamic test linking

      --skip <SKIP>...
          Skip building files whose names contain the given filter.
          
          `test` and `script` are aliases for `.t.sol` and `.s.sol`.

Linker options:
      --libraries <LIBRARIES>
          Set pre-linked libraries
          
          [env: DAPP_LIBRARIES=]

Compiler options:
      --ignored-error-codes <ERROR_CODES>
          Ignore solc warnings by error code

  -D, --deny <LEVEL>
          A compiler error will be triggered at the specified diagnostic level.
          
          Replaces the deprecated `--deny-warnings` flag.
          
          Possible values: - `never`: Do not treat any diagnostics as errors. -
          `warnings`: Treat warnings as errors. - `notes`: Treat both, warnings
          and notes, as errors.

          Possible values:
          - never:    Always exit with zero code
          - warnings: Exit with a non-zero code if any warnings are found
          - notes:    Exit with a non-zero code if any notes or warnings are
            found

      --no-auto-detect
          Do not auto-detect the `solc` version

      --use <SOLC_VERSION>
          Specify the solc version, or a path to a local solc, to build with.
          
          Valid values are in the format `x.y.z`, `solc:x.y.z` or
          `path/to/solc`.

      --offline
          Do not access the network.
          
          Missing solc versions will not be installed.

      --use-literal-content
          Changes compilation to only use literal content and not URLs

      --no-metadata
          Do not append any metadata to the bytecode.
          
          This is equivalent to setting `bytecode_hash` to `none` and
          `cbor_metadata` to `false`.

      --ast
          Includes the AST as JSON in the compiler output

      --evm-version <VERSION>
          The target EVM version

      --optimize [<OPTIMIZE>]
          Activate the Solidity optimizer
          
          [possible values: true, false]

      --optimizer-runs <RUNS>
          The number of runs specifies roughly how often each opcode of the
          deployed code will be executed across the life-time of the contract.
          This means it is a trade-off parameter between code size (deploy cost)
          and code execution cost (cost after deployment). An `optimizer_runs`
          parameter of `1` will produce short but expensive code. In contrast, a
          larger `optimizer_runs` parameter will produce longer but more gas
          efficient code

      --via-ir
          Use the Yul intermediate representation compilation pipeline

      --via-ssa-cfg
          Turn on SSA CFG-based code generation via the IR (experimental).
          
          This passes `--via-ssa-cfg` to solc. Implies `--via-ir`. Requires
          `--experimental` to be set (as of Solidity 0.8.35+). This is false by
          default.

      --experimental
          Enable Solidity's experimental mode.
          
          This passes `--experimental` to solc, which is required by Solidity
          0.8.35+ for experimental features.

      --extra-output <SELECTOR>...
          Extra output to include in the contract's artifact.
          
          Example keys: evm.assembly, ewasm, ir, irOptimized, metadata
          
          For a full description, see
          [https://docs.soliditylang.org/en/v0.8.13/using-the-compiler.html#input-description](https://docs.soliditylang.org/en/v0.8.13/using-the-compiler.html#input-description)

      --extra-output-files <SELECTOR>...
          Extra output to write to separate files.
          
          Valid values: metadata, ir, irOptimized, ewasm, evm.assembly

Project options:
  -o, --out <PATH>
          The path to the contract artifacts folder

      --revert-strings <REVERT>
          Revert string configuration.
          
          Possible values are "default", "strip" (remove), "debug"
          (Solidity-generated revert strings) and "verboseDebug"

      --build-info
          Generate build info files

      --build-info-path <PATH>
          Output path to directory that build info files will be written to

      --root <PATH>
          The project's root path.
          
          By default root of the Git repository, if in one, or the current
          working directory.

  -C, --contracts <PATH>
          The contracts source directory

  -R, --remappings <REMAPPINGS>
          The project's remappings

      --remappings-env <ENV>
          The project's remappings from the environment

      --cache-path <PATH>
          The path to the compiler cache

      --lib-paths <PATH>
          The path to the library folder

      --hardhat
          Use the Hardhat-style project layout.
          
          This is the same as using: `--contracts contracts --lib-paths
          node_modules`.
          
          [alias: --hh]

      --config-path <FILE>
          Path to the config file

Watch options:
  -w, --watch [<PATH>...]
          Watch the given files or directories for changes.
          
          If no paths are provided, the source and test directories of the
          project are watched.

      --no-restart
          Do not restart the command while it's still running

      --run-all
          Explicitly re-run all tests when a change is made.
          
          By default, only the tests of the last modified test file are
          executed.

      --rerun-failed
          Re-run only previously failed tests first when a change is made.
          
          If all previously failed tests pass, the full test suite will be run
          automatically. This is particularly useful for TDD workflows where you
          want fast feedback on failures.

      --watch-delay <DELAY>
          File update debounce delay.
          
          During the delay, incoming change events are accumulated and only once
          the delay has passed, is an action taken. Note that this does not mean
          a command will be started: if --no-restart is given and a command is
          already running, the outcome of the action will be to do nothing.
          
          Defaults to 50ms. Parses as decimal seconds by default, but using an
          integer with the `ms` suffix may be more convenient.
          
          When using --poll mode, you'll want a larger duration, or risk
          overloading disk I/O.

      --mutate [<PATH>...]
          Enable mutation testing. If passed with file paths, only those files
          will be tested

      --mutate-path <PATTERN>
          Specify which files to mutate with glob pattern matching.
          
          Mutually exclusive with passing explicit paths to `--mutate`; either
          supply paths to `--mutate` or use this glob filter, not both.

      --mutate-contract <REGEX>
          Only mutate contracts whose name matches the specified regex pattern.
          
          Mutually exclusive with `--mutate-path`.

      --mutation-jobs <JOBS>
          Number of parallel workers for mutation testing. Defaults to the
          number of CPU cores

      --mutation-timeout <TIMEOUT>
          Best-effort per-mutant wall-clock timeout in seconds. Mutants that
          exceed it are recorded as "timed out" and cleanup continues in the
          background with bounded pending workers.
          
          Analogous to `--invariant-timeout` for invariant campaigns.

      --mutation-optimizer-runs <RUNS>
          Override optimizer runs for mutation testing compile-and-test runs

      --mutation-via-ir [<MUTATION_VIA_IR>]
          Override via-ir for mutation testing compile-and-test runs
          
          [possible values: true, false]

      --brutalize
          Enable brutalization mode.
          
          Catches latent bugs that normal tests miss because the EVM initializes
          memory to zero and registers to clean values. Applies source-level
          sanitizers before compiling:
          
          - Dirties unused bits in sub-256-bit type casts (address, uint8,
          bytes4, etc.) to catch assembly code that assumes clean upper bits
          when using legacy codegen. Via-IR may clean these bits before inline
          assembly observes them. - Fills scratch space (0x00-0x3f) and memory
          beyond the free memory pointer with junk to catch uninitialized memory
          reads - Misaligns the free memory pointer to catch word-alignment
          assumptions
          
          If `forge test` passes but `forge test --brutalize` fails, the code
          has a robustness issue that could manifest when called in a different
          context.

      --asc
          Sort results by gas used (ascending)

      --desc
          Sort results by gas used (descending)

      --min <MIN_GAS>
          Only include tests that used more gas that the given amount

      --max <MAX_GAS>
          Only include tests that used less gas that the given amount
```

:::