> **Can't find what you're looking for?** Use `search_docs` on the docs MCP server at `https://www.getfoundry.sh/api/mcp` to find what you need.
>
> **Have feedback?** Use `submit_feedback` on the same MCP server.

## Project

Configuration related to the project in general.

### `extends`

* Type: string or table
* Default: none

Base config file that the active profile inherits settings from.

The value is either a path or a table with a `path` and a merge `strategy`:

```toml
[profile.default]
extends = "../shared/base.toml"

[profile.ci]
extends = { path = "../shared/base.toml", strategy = "replace-arrays" }
```

The path is relative to the directory of the `foundry.toml` that declares it. Only the
active profile's `extends` is used: the whole base file, including standalone sections such
as `[fuzz]`, is loaded first and this file is merged on top of it. A profile without its
own `extends` does not inherit from the base file. Strategies:

* `extend-arrays` (the default): arrays from both files are concatenated, base entries
  first; other values in this file replace those in the base file.
* `replace-arrays`: arrays and all other values in this file replace those in the base
  file.
* `no-collision`: loading fails if the active profile sets a key that the same profile in
  the base file also sets.

The base file cannot use `extends` in the same profile, and a file cannot extend itself.
`extends` takes a file path, not a profile name: every profile already inherits from
`[profile.default]`.

See [Inheriting from a base file](/config/profiles#inheriting-from-a-base-file) for merge strategies, precedence rules, and examples.

### `src`

* Type: string (path)
* Default: `"src"`
* Environment: `FOUNDRY_SRC`, `DAPP_SRC`, or `DAPP_TEST_SRC`

Directory containing the project's contract sources, relative to the project root.

When `src` is not set and the `src` directory does not exist but `contracts` does, Foundry
uses `contracts` (the Hardhat layout). Foundry also adds a `src/=src/` style remapping for
this directory, so imports such as `import "src/Counter.sol";` resolve. The `--contracts`
(`-C`) flag overrides this setting, and `--hardhat` sets it to `contracts`.

### `test`

* Type: string (path)
* Default: `"test"`
* Environment: `FOUNDRY_TEST`, `DAPP_TEST`, or `DAPP_TEST_TEST`

Directory containing the project's test contracts, relative to the project root.

Test files are compiled together with the sources. When the directory exists, Foundry adds
a `test/=test/` style remapping for it, so imports such as `import "test/Utils.sol";`
resolve.

### `script`

* Type: string (path)
* Default: `"script"`
* Environment: `FOUNDRY_SCRIPT`, `DAPP_SCRIPT`, or `DAPP_TEST_SCRIPT`

Directory containing the project's Solidity scripts, relative to the project root.

Script files are compiled together with the sources. When the directory exists, Foundry
adds a `script/=script/` style remapping for it, so imports such as
`import "script/Base.s.sol";` resolve.

### `out`

* Type: string (path)
* Default: `"out"`
* Environment: `FOUNDRY_OUT`, `DAPP_OUT`, or `DAPP_TEST_OUT`

Directory where compiled contract artifacts are written, relative to the project root.

Each contract gets a JSON artifact such as `out/Counter.sol/Counter.json`, and build info
files go to `<out>/build-info` unless `build_info_path` is set. When `out` is not set and
the `out` directory does not exist but `artifacts` does, Foundry uses `artifacts`. The
`--out` (`-o`) flag overrides this setting.

### `libs`

* Type: array of string (path)
* Default: `["lib"]`
* Environment: `FOUNDRY_LIBS`, `DAPP_LIBS`, or `DAPP_TEST_LIBS`

Directories containing dependency libraries, relative to the project root.

When `auto_detect_remappings` is enabled, these directories are scanned for remappings, and
solc is always allowed to read files from them. `forge install` installs into the first
entry that is not `node_modules` (or `lib` when there is none). When `libs` is not set,
Foundry uses `lib`, `node_modules`, or both, depending on which of them exist. The
`--lib-paths` flag overrides this setting, and `--hardhat` uses `node_modules`.

### `cache`

* Type: boolean
* Default: `true`
* Environment: `FOUNDRY_CACHE` or `DAPP_CACHE`

Whether to cache compiler output so that unchanged sources are not recompiled.

The cache is stored in `cache_path`. When disabled, every build compiles all sources. The
`--no-cache` flag disables the cache for one run, and `force` (or `--force`) clears it
before building. The cache is also bypassed while `deny` is `warnings` or `notes`, so that
warnings are reported on every build.

### `cache_path`

* Type: string (path)
* Default: `"cache"`
* Environment: `FOUNDRY_CACHE_PATH`, `DAPP_CACHE_PATH`, or `DAPP_TEST_CACHE_PATH`

Directory for the compiler cache and other project caches, relative to the project root.

It holds the compiler cache file (`solidity-files-cache.json`), the `forge coverage` and
external compiler caches, and the sensitive parts of `forge script` broadcast logs, such as
RPC URLs, which are kept out of `broadcast`. `test_failures_file` and `mutation_dir`
default to paths under `cache` but are set separately, so changing `cache_path` does not
move them. The `--cache-path` flag overrides this setting.

### `broadcast`

* Type: string (path)
* Default: `"broadcast"`
* Environment: `FOUNDRY_BROADCAST`, `DAPP_BROADCAST`, or `DAPP_TEST_BROADCAST`

Directory where `forge script` writes broadcast transaction logs, relative to the project
root.

Each run is written to `<broadcast>/<script file>/<chain id>/<function>-latest.json`, with
a timestamped `run-<timestamp>.json` copy, under an extra `dry-run` directory when the
script is only simulated. Sensitive values such as RPC URLs are written to the same
relative path under `cache_path` instead. Cheatcodes such as `vm.getBroadcast` and
`vm.getDeployment` read the logs from this directory.

### `force`

* Type: boolean
* Default: `false`
* Environment: `FOUNDRY_FORCE`, `DAPP_FORCE`, or `DAPP_TEST_FORCE`

Whether to delete all build artifacts and caches before compiling.

This has the same effect as passing `--force` to every command. Before building, Forge
removes the artifacts in `out`, the compiler cache, the coverage and external compiler
caches, `test_failures_file`, `mutation_dir`, and the fuzz and invariant failure and corpus
directories, then compiles everything from scratch.

**Warning:** this also discards persisted fuzz failures and corpora on every run.
