<!--
Sitemap:
- [Foundry - Ethereum Development Framework](/index)
- [Anvil](/anvil/): Anvil is Foundry's local Ethereum node for development and testing.
- [Benchmarks](/benchmarks)
- [Best Practices](/best-practices): Best practices for writing contracts, tests, scripts, and managing security in Foundry projects.
- [Cast](/cast/): Cast is Foundry's command-line tool for interacting with Ethereum.
- [Changelog](/changelog/)
- [Chisel](/chisel/): Chisel is Foundry's interactive Solidity REPL for rapid prototyping and debugging.
- [Configuration](/config/): Configure Foundry with foundry.toml, profiles, and environment variables.
- [Forge](/forge/): Forge is Foundry's build, test, and deploy tool for Solidity smart contracts.
- [Guides](/guides/): Practical guides for common Foundry workflows and advanced patterns.
- [Project Setup](/projects/): Create and configure Foundry projects for smart contract development.
- [Custom methods](/anvil/custom-methods): Anvil's custom RPC methods for impersonation, mining control, and state manipulation.
- [Forking](/anvil/forking): Fork mainnet or any EVM-compatible chain with Anvil.
- [State management](/anvil/state-management): Dump and load Anvil chain state for reproducible testing.
- [ABI encoding](/cast/abi-encoding): Encode and decode ABI data, calldata, and function signatures with Cast.
- [Reading chain data](/cast/reading-chain-data): Query blockchain data with Cast — blocks, transactions, logs, and account state.
- [Sending transactions](/cast/sending-transactions): Send transactions and interact with contracts using Cast.
- [Wallet operations](/cast/wallet-operations): Manage wallets, sign messages, and verify signatures with Cast.
- [Commands](/chisel/commands): All available commands in the Chisel REPL.
- [Forking](/chisel/forking): Fork live chains in Chisel to interact with deployed contracts.
- [Session management](/chisel/session-management): Save, load, and export Chisel REPL sessions.
- [CI Integration](/config/ci): Set up Foundry in GitHub Actions and other CI systems.
- [Compiler](/config/compiler): Configure the Solidity compiler settings for your Foundry project.
- [Editor Setup](/config/editors): Configure VS Code, Vim, and other editors for Foundry projects.
- [MESC](/config/mesc): Use MESC to manage RPC endpoints across all your crypto tools from a single configuration file.
- [Profiles](/config/profiles): Use profiles to switch between configurations for development, CI, and production.
- [Testing](/config/testing): Configure testing behavior including fuzz testing and invariant testing.
- [Building contracts](/forge/build): Compile Solidity contracts with Forge.
- [Debugging](/forge/debugging): Debug Solidity contracts with Forge traces and the interactive debugger.
- [Formatting](/forge/formatting): Format Solidity code with Forge.
- [Gas tracking](/forge/gas-tracking): Track and compare gas usage with Forge snapshots and reports.
- [Linting](/forge/linting): Lint Solidity code with Forge.
- [Scripting](/forge/scripting): Deploy and interact with contracts using Forge scripts.
- [Testing](/forge/testing): Write and run tests for Solidity contracts with Forge.
- [Debugging Transactions](/guides/debugging-transactions): Replay and debug failed mainnet transactions with trace analysis.
- [Deploying Contracts](/guides/deploying-contracts): Deploy contracts from local development to testnet and mainnet with verification and deterministic addresses.
- [Deterministic Deployments with CREATE2](/guides/deterministic-deployments-using-create2): Deploy smart contracts to predictable addresses across multiple networks using CREATE2 opcode for counterfactual interactions.
- [Docker & Containers](/guides/docker): Run Foundry in Docker for reproducible builds and CI environments.
- [Fork Testing](/guides/fork-testing): Test against live chain state, impersonate accounts, and handle time-sensitive logic.
- [Gas Optimization](/guides/gas-optimization): Profile gas usage and optimize with snapshots and the IR pipeline.
- [Invariant Testing](/guides/invariant-testing): Write effective invariant tests with handler patterns and ghost variables.
- [MPP-backed RPC endpoints](/guides/mpp): Use Foundry with HTTP 402 payment-gated RPC endpoints through the Machine Payments Protocol (MPP).
- [Multi-Chain Deployments](/guides/multi-chain-deployments): Deploy the same contracts across multiple networks with per-chain configuration.
- [Stack Too Deep](/guides/stack-too-deep): Understanding and resolving the "Stack too deep" compilation error in Solidity.
- [Foundry on Tempo](/guides/tempo): Use Foundry's upstream Tempo support to initialize projects, configure foundry.toml, and work with Tempo transactions.
- [Upgrading Contracts](/guides/upgrading-contracts): Implement proxy patterns with Forge scripts and verify storage layout compatibility.
- [FAQ](/help/faq): Frequently asked questions about Foundry and its tools.
- [Troubleshooting](/help/troubleshooting): Solutions to common Foundry errors and issues.
- [Getting Started](/introduction/getting-started): Get started with Foundry's four core tools - Forge, Cast, Anvil, and Chisel.
- [Installation](/introduction/installation): Install Foundry using foundryup, precompiled binaries, or build from source.
- [Prompting](/introduction/prompting): Use structured prompts to get better results from AI coding assistants.
- [Dependencies](/projects/dependencies): Manage dependencies using git submodules and remappings.
- [Project Layout](/projects/layout): Understand Foundry's project structure and directory conventions.
- [Soldeer](/projects/soldeer): Use Soldeer as an alternative package manager for Foundry projects.
- [cast index](/reference/cast/)
- [DSTest Reference](/reference/ds-test)
- [References](/reference/README)
- [Default foundry configuration](/config/reference/default-config)
- [Documentation Generator](/config/reference/doc-generator)
- [Etherscan](/config/reference/etherscan)
- [Formatter](/config/reference/formatter)
- [In-line test configuration](/config/reference/inline-test-config)
- [Linter Configuration](/config/reference/linter)
- [Config Overview](/config/reference/overview)
- [Project](/config/reference/project)
- [Config Reference](/config/reference/README)
- [Solidity compiler](/config/reference/solidity-compiler)
- [Testing](/config/reference/testing)
- [Inefficient keccak256 call](/forge/linting/asm-keccak256): Inefficient keccak256 call
- [Use of block.timestamp in comparisons](/forge/linting/block-timestamp): Use of block.timestamp in comparisons
- [Misuse of a boolean constant](/forge/linting/boolean-cst): Misuse of a boolean constant
- [Boolean comparison to a constant](/forge/linting/boolean-equal): Boolean comparison to a constant
- [State variable could be immutable](/forge/linting/could-be-immutable): State variable could be immutable
- [Prefer custom errors over revert strings](/forge/linting/custom-errors): Prefer custom errors over revert strings
- [Divide before multiply](/forge/linting/divide-before-multiply): Divide before multiply
- [Unchecked ERC20 transfer return value](/forge/linting/erc20-unchecked-transfer): Unchecked ERC20 transfer return value
- [Incorrect ERC20 interface](/forge/linting/incorrect-erc20-interface): Incorrect ERC20 interface
- [Incorrect ERC721 interface](/forge/linting/incorrect-erc721-interface): Incorrect ERC721 interface
- [Incorrect shift order](/forge/linting/incorrect-shift): Incorrect shift order
- [Inline assembly](/forge/linting/inline-assembly): Inline assembly usage
- [Interface file naming](/forge/linting/interface-file-naming): Interface file naming
- [Interface name should be prefixed with 'I'](/forge/linting/interface-naming): Interface name should be prefixed with 'I'
- [Missing zero-address check](/forge/linting/missing-zero-check): Missing zero-address check
- [Function names should use mixedCase](/forge/linting/mixed-case-function): Function names should use mixedCase
- [Mutable variable names should use mixedCase](/forge/linting/mixed-case-variable): Mutable variable names should use mixedCase
- [Multiple contracts in one file](/forge/linting/multi-contract-file): Multiple contracts in one file
- [Contract name reused across files](/forge/linting/name-reused): Contract name reused across files
- [Prefer named struct fields](/forge/linting/named-struct-fields): Prefer named struct fields
- [Struct names should use PascalCase](/forge/linting/pascal-case-struct): Struct names should use PascalCase
- [Inconsistent pragma directives](/forge/linting/pragma-inconsistent): Inconsistent pragma directives
- [Redundant base-constructor call](/forge/linting/redundant-base-constructor-call): Redundant base-constructor call
- [Right-to-left override character](/forge/linting/rtlo): Right-to-left override character
- [Constants should use SCREAMING_SNAKE_CASE](/forge/linting/screaming-snake-case-const): Constants should use SCREAMING_SNAKE_CASE
- [Immutables should use SCREAMING_SNAKE_CASE](/forge/linting/screaming-snake-case-immutable): Immutables should use SCREAMING_SNAKE_CASE
- [Numeric literal with too many digits](/forge/linting/too-many-digits): Numeric literal with too many digits
- [Use of tx.origin for authorization](/forge/linting/tx-origin): Use of tx.origin for authorization
- [Unaliased plain import](/forge/linting/unaliased-plain-import): Unaliased plain import
- [Unchecked low-level call](/forge/linting/unchecked-call): Unchecked low-level call
- [Usage of unsafe cheatcodes](/forge/linting/unsafe-cheatcode): Usage of unsafe cheatcodes
- [Unsafe typecast](/forge/linting/unsafe-typecast): Unsafe typecast
- [Unused import](/forge/linting/unused-import): Unused import
- [Unused state variable](/forge/linting/unused-state-variables): Unused state variable
- [Unwrapped modifier logic](/forge/linting/unwrapped-modifier-logic): Unwrapped modifier logic
- [State variable read via this](/forge/linting/var-read-using-this): State variable read via `this`
- [Foundry v1.0 migration guide](/guides/migrations/foundry-v1): Summary of breaking changes and migration steps for Foundry v1.0.
- [anvil](/reference/anvil/anvil)
- [anvil completions](/reference/anvil/completions)
- [cast 4byte](/reference/cast/4byte)
- [cast 4byte-calldata](/reference/cast/4byte-calldata)
- [cast 4byte-event](/reference/cast/4byte-event)
- [cast abi-encode](/reference/cast/abi-encode)
- [cast abi-encode-event](/reference/cast/abi-encode-event)
- [cast access-list](/reference/cast/access-list)
- [cast address-zero](/reference/cast/address-zero)
- [cast admin](/reference/cast/admin)
- [cast age](/reference/cast/age)
- [cast artifact](/reference/cast/artifact)
- [cast b2e-payload](/reference/cast/b2e-payload)
- [cast balance](/reference/cast/balance)
- [cast base-fee](/reference/cast/base-fee)
- [cast batch-mktx](/reference/cast/batch-mktx)
- [cast batch-send](/reference/cast/batch-send)
- [cast bind](/reference/cast/bind)
- [cast block](/reference/cast/block)
- [cast block-number](/reference/cast/block-number)
- [cast call](/reference/cast/call)
- [cast calldata](/reference/cast/calldata)
- [cast](/reference/cast/cast)
- [cast chain](/reference/cast/chain)
- [cast chain-id](/reference/cast/chain-id)
- [cast client](/reference/cast/client)
- [cast code](/reference/cast/code)
- [cast codehash](/reference/cast/codehash)
- [cast codesize](/reference/cast/codesize)
- [cast completions](/reference/cast/completions)
- [cast compute-address](/reference/cast/compute-address)
- [cast concat-hex](/reference/cast/concat-hex)
- [cast constructor-args](/reference/cast/constructor-args)
- [cast create2](/reference/cast/create2)
- [cast creation-code](/reference/cast/creation-code)
- [cast da-estimate](/reference/cast/da-estimate)
- [cast decode-abi](/reference/cast/decode-abi)
- [cast decode-calldata](/reference/cast/decode-calldata)
- [cast decode-error](/reference/cast/decode-error)
- [cast decode-event](/reference/cast/decode-event)
- [cast decode-string](/reference/cast/decode-string)
- [cast decode-transaction](/reference/cast/decode-transaction)
- [cast disassemble](/reference/cast/disassemble)
- [cast erc20-token](/reference/cast/erc20-token)
- [cast estimate](/reference/cast/estimate)
- [cast find-block](/reference/cast/find-block)
- [cast format-bytes32-string](/reference/cast/format-bytes32-string)
- [cast format-units](/reference/cast/format-units)
- [cast from-bin](/reference/cast/from-bin)
- [cast from-fixed-point](/reference/cast/from-fixed-point)
- [cast from-rlp](/reference/cast/from-rlp)
- [cast from-utf8](/reference/cast/from-utf8)
- [cast from-wei](/reference/cast/from-wei)
- [cast gas-price](/reference/cast/gas-price)
- [cast hash-message](/reference/cast/hash-message)
- [cast hash-zero](/reference/cast/hash-zero)
- [cast implementation](/reference/cast/implementation)
- [cast index](/reference/cast/index-cmd)
- [cast index-erc7201](/reference/cast/index-erc7201)
- [cast interface](/reference/cast/interface)
- [cast keccak](/reference/cast/keccak)
- [cast keychain](/reference/cast/keychain)
- [cast logs](/reference/cast/logs)
- [cast lookup-address](/reference/cast/lookup-address)
- [cast max-int](/reference/cast/max-int)
- [cast max-uint](/reference/cast/max-uint)
- [cast min-int](/reference/cast/min-int)
- [cast mktx](/reference/cast/mktx)
- [cast namehash](/reference/cast/namehash)
- [cast nonce](/reference/cast/nonce)
- [cast pad](/reference/cast/pad)
- [cast parse-bytes32-address](/reference/cast/parse-bytes32-address)
- [cast parse-bytes32-string](/reference/cast/parse-bytes32-string)
- [cast parse-units](/reference/cast/parse-units)
- [cast pretty-calldata](/reference/cast/pretty-calldata)
- [cast proof](/reference/cast/proof)
- [cast publish](/reference/cast/publish)
- [cast receipt](/reference/cast/receipt)
- [cast recover-authority](/reference/cast/recover-authority)
- [cast resolve-name](/reference/cast/resolve-name)
- [cast rpc](/reference/cast/rpc)
- [cast run](/reference/cast/run)
- [cast selectors](/reference/cast/selectors)
- [cast send](/reference/cast/send)
- [cast shl](/reference/cast/shl)
- [cast shr](/reference/cast/shr)
- [cast sig](/reference/cast/sig)
- [cast sig-event](/reference/cast/sig-event)
- [cast source](/reference/cast/source)
- [cast storage](/reference/cast/storage)
- [cast storage-root](/reference/cast/storage-root)
- [cast tip20-token](/reference/cast/tip20-token)
- [cast to-ascii](/reference/cast/to-ascii)
- [cast to-base](/reference/cast/to-base)
- [cast to-bytes32](/reference/cast/to-bytes32)
- [cast to-check-sum-address](/reference/cast/to-check-sum-address)
- [cast to-dec](/reference/cast/to-dec)
- [cast to-fixed-point](/reference/cast/to-fixed-point)
- [cast to-hex](/reference/cast/to-hex)
- [cast to-hexdata](/reference/cast/to-hexdata)
- [cast to-int256](/reference/cast/to-int256)
- [cast to-rlp](/reference/cast/to-rlp)
- [cast to-uint256](/reference/cast/to-uint256)
- [cast to-unit](/reference/cast/to-unit)
- [cast to-utf8](/reference/cast/to-utf8)
- [cast to-wei](/reference/cast/to-wei)
- [cast trace](/reference/cast/trace)
- [cast tx](/reference/cast/tx)
- [cast tx-pool](/reference/cast/tx-pool)
- [cast upload-signature](/reference/cast/upload-signature)
- [cast wallet](/reference/cast/wallet)
- [accesses](/reference/cheatcodes/accesses): Gets all storage slots that have been read or written to on an address
- [activeFork](/reference/cheatcodes/active-fork): Returns the identifier of the currently active fork
- [addr](/reference/cheatcodes/addr): Computes the address for a given private key
- [allowCheatcodes](/reference/cheatcodes/allow-cheatcodes): Grants cheatcode access to an address in forking mode
- [assume](/reference/cheatcodes/assume): Discards fuzz inputs that don't satisfy a condition
- [assumeNoRevert](/reference/cheatcodes/assume-no-revert): Discards fuzz inputs if the next call reverts
- [breakpoint](/reference/cheatcodes/breakpoint): Places a breakpoint for the debugger
- [broadcast](/reference/cheatcodes/broadcast): Makes the next call create a transaction that can be signed and sent onchain
- [chainId](/reference/cheatcodes/chain-id): Sets block.chainid to a specified value in Forge tests
- [clearMockedCalls](/reference/cheatcodes/clear-mocked-calls): Clears all mocked calls
- [coinbase](/reference/cheatcodes/coinbase): Sets block.coinbase to a specified address
- [copyStorage](/reference/cheatcodes/copy-storage): Copies storage from one contract to another
- [createFork](/reference/cheatcodes/create-fork): Creates a new fork from an RPC endpoint
- [createSelectFork](/reference/cheatcodes/create-select-fork): Creates and activates a new fork in one call
- [createWallet](/reference/cheatcodes/create-wallet): Creates a new Wallet struct with address and keys
- [deal](/reference/cheatcodes/deal): Sets the ETH balance of an address
- [deriveKey](/reference/cheatcodes/derive-key): Derives a private key from a mnemonic phrase
- [difficulty](/reference/cheatcodes/difficulty): Sets block.difficulty for pre-merge EVM versions in Forge tests
- [envAddress](/reference/cheatcodes/env-address): Reads an environment variable as address or address[]
- [envBool](/reference/cheatcodes/env-bool): Reads an environment variable as bool or bool[]
- [envBytes](/reference/cheatcodes/env-bytes): Reads an environment variable as bytes or bytes[]
- [envBytes32](/reference/cheatcodes/env-bytes32): Reads an environment variable as bytes32 or bytes32[]
- [envInt](/reference/cheatcodes/env-int): Reads an environment variable as int256 or int256[]
- [envOr](/reference/cheatcodes/env-or): Reads an environment variable with a default fallback value
- [envString](/reference/cheatcodes/env-string): Reads an environment variable as string or string[]
- [envUint](/reference/cheatcodes/env-uint): Reads an environment variable as uint256 or uint256[]
- [etch](/reference/cheatcodes/etch): Sets the bytecode of an address to custom code
- [expectCall](/reference/cheatcodes/expect-call): Asserts that a specific call is made during test execution
- [expectEmit](/reference/cheatcodes/expect-emit): Asserts that specific events are emitted during the next call
- [expectRevert](/reference/cheatcodes/expect-revert): Asserts that the next call reverts with optional message matching
- [fee](/reference/cheatcodes/fee): Sets block.basefee to a specified value in Forge tests
- [ffi](/reference/cheatcodes/ffi): Calls an arbitrary external command
- [File Cheatcodes](/reference/cheatcodes/fs): File system operations for reading, writing, and managing files
- [snapshotGas cheatcodes](/reference/cheatcodes/gas-snapshots): Capture and compare gas usage across test runs
- [getBlockNumber](/reference/cheatcodes/get-block-number): Gets the current block.number, avoiding IR compilation optimization issues
- [getBlockTimestamp](/reference/cheatcodes/get-block-timestamp): Gets the current block.timestamp, avoiding IR compilation optimization issues
- [getCode](/reference/cheatcodes/get-code): Returns the creation bytecode for a contract in the project
- [getDeployedCode](/reference/cheatcodes/get-deployed-code): Returns the deployed (runtime) bytecode for a contract in the project
- [getLabel](/reference/cheatcodes/get-label): Retrieves the label for an address
- [getNonce](/reference/cheatcodes/get-nonce): Gets the nonce of an account or wallet
- [getRecordedLogs](/reference/cheatcodes/get-recorded-logs): Gets all emitted events recorded by recordLogs
- [isContext](/reference/cheatcodes/is-context): Checks the current Forge execution context
- [isPersistent](/reference/cheatcodes/is-persistent): Checks if an account is marked as persistent across forks
- [keyExists](/reference/cheatcodes/key-exists): Checks if a key exists in a JSON string (deprecated)
- [keyExistsJson](/reference/cheatcodes/key-exists-json): Checks if a key exists in a JSON string
- [keyExistsToml](/reference/cheatcodes/key-exists-toml): Checks if a key exists in a TOML table
- [label](/reference/cheatcodes/label): Sets a label for an address in test traces
- [load](/reference/cheatcodes/load): Loads a value from a specific storage slot of an account
- [makePersistent](/reference/cheatcodes/make-persistent): Marks accounts as persistent across fork switches
- [mockCall](/reference/cheatcodes/mock-call): Mocks calls to an address with specific calldata to return specified data
- [mockCallRevert](/reference/cheatcodes/mock-call-revert): Mocks calls to an address to revert with specified data
- [mockCalls](/reference/cheatcodes/mock-calls): Mocks calls to return different data for each successive invocation
- [mockFunction](/reference/cheatcodes/mock-function): Executes calls to an address using bytecode from another address
- [Cheatcodes Reference](/reference/cheatcodes/overview)
- [parseAddress](/reference/cheatcodes/parse-address): Parses a hex string into an address
- [parseBool](/reference/cheatcodes/parse-bool): Parses a string into a bool
- [parseBytes](/reference/cheatcodes/parse-bytes): Parses a hex string into bytes
- [parseBytes32](/reference/cheatcodes/parse-bytes32): Parses a hex string into bytes32
- [parseInt](/reference/cheatcodes/parse-int): Parses a string into an int256
- [parseJson](/reference/cheatcodes/parse-json): Parses JSON files and returns values as ABI-encoded bytes
- [parseJsonKeys](/reference/cheatcodes/parse-json-keys): Gets list of keys present in a JSON string
- [parseToml](/reference/cheatcodes/parse-toml): Parses TOML files and returns values as ABI-encoded bytes
- [parseTomlKeys](/reference/cheatcodes/parse-toml-keys): Gets list of keys present in a TOML string
- [parseUint](/reference/cheatcodes/parse-uint): Parses a string into a uint256
- [pauseGasMetering](/reference/cheatcodes/pause-gas-metering): Pauses gas metering so gasleft() does not decrease
- [prank](/reference/cheatcodes/prank): Sets msg.sender for the next call to a specified address
- [prevrandao](/reference/cheatcodes/prevrandao): Sets block.prevrandao for post-merge EVM versions in Forge tests
- [projectRoot](/reference/cheatcodes/project-root): Returns the root directory of the current Foundry project
- [prompt](/reference/cheatcodes/prompt): Displays an interactive prompt for user input in scripts
- [readCallers](/reference/cheatcodes/read-callers): Reads the current caller mode, msg.sender, and tx.origin
- [record](/reference/cheatcodes/record): Starts recording all storage reads and writes
- [recordLogs](/reference/cheatcodes/record-logs): Starts recording all emitted events
- [rememberKey](/reference/cheatcodes/remember-key): Stores a private key in forge's local wallet for broadcasting
- [resetGasMetering](/reference/cheatcodes/reset-gas-metering): Resets gas metering to the gas limit of the current execution frame
- [resumeGasMetering](/reference/cheatcodes/resume-gas-metering): Resumes gas metering after it was paused
- [revokePersistent](/reference/cheatcodes/revoke-persistent): Removes persistent status from accounts
- [roll](/reference/cheatcodes/roll): Sets block.number to a specified value in Forge tests
- [rollFork](/reference/cheatcodes/roll-fork): Sets the block number of a fork
- [RPC Cheatcodes](/reference/cheatcodes/rpc): Access configured RPC endpoints and make JSON-RPC calls
- [selectFork](/reference/cheatcodes/select-fork): Activates a previously created fork
- [serializeJson](/reference/cheatcodes/serialize-json): Serializes values as a stringified JSON object
- [setArbitraryStorage](/reference/cheatcodes/set-arbitrary-storage): Makes the storage of an address fully symbolic
- [setEnv](/reference/cheatcodes/set-env): Sets an environment variable
- [setNonce](/reference/cheatcodes/set-nonce): Sets the nonce of an account
- [sign](/reference/cheatcodes/sign): Signs a digest with a private key, returning (v, r, s)
- [signDelegation](/reference/cheatcodes/sign-delegation): Signs and attaches EIP-7702 authorization for account delegation
- [skip](/reference/cheatcodes/skip): Marks a test as skipped conditionally
- [sleep](/reference/cheatcodes/sleep): Pauses execution for a specified duration
- [startBroadcast](/reference/cheatcodes/start-broadcast): Makes all subsequent calls create transactions that can be signed and sent onchain
- [startPrank](/reference/cheatcodes/start-prank): Sets msg.sender for all subsequent calls until stopPrank is called
- [startStateDiffRecording](/reference/cheatcodes/start-state-diff-recording): Starts recording all state changes during execution
- [snapshotState cheatcodes](/reference/cheatcodes/state-snapshots): Snapshot and restore EVM state
- [stopAndReturnStateDiff](/reference/cheatcodes/stop-and-return-state-diff): Stops state diff recording and returns all recorded state changes
- [stopBroadcast](/reference/cheatcodes/stop-broadcast): Stops collecting transactions for onchain broadcasting
- [stopPrank](/reference/cheatcodes/stop-prank): Stops an active prank, resetting msg.sender and tx.origin
- [store](/reference/cheatcodes/store): Stores a value in a specific storage slot of an account
- [toString](/reference/cheatcodes/to-string): Converts any type to its string representation
- [transact](/reference/cheatcodes/transact): Fetches and executes a transaction from a fork
- [txGasPrice](/reference/cheatcodes/tx-gas-price): Sets tx.gasprice for the rest of the transaction
- [unixTime](/reference/cheatcodes/unix-time): Returns the current unix timestamp in milliseconds
- [warp](/reference/cheatcodes/warp): Sets block.timestamp to a specified value in Forge tests
- [writeJson](/reference/cheatcodes/write-json): Writes a serialized JSON object to a file
- [writeToml](/reference/cheatcodes/write-toml): Writes a serialized JSON object to a TOML file
- [chisel](/reference/chisel/chisel)
- [chisel clear-cache](/reference/chisel/clear-cache)
- [chisel eval](/reference/chisel/eval)
- [chisel list](/reference/chisel/list)
- [chisel load](/reference/chisel/load)
- [chisel view](/reference/chisel/view)
- [Base Options](/reference/common/base-options)
- [Create Option](/reference/common/cast-estimate-create-option)
- [Display Options](/reference/common/display-options)
- [Etherscan Options](/reference/common/etherscan-options)
- [Wallet Options - Hardware Wallet](/reference/common/multi-wallet-options-hardware)
- [Wallet Options - Keystore](/reference/common/multi-wallet-options-keystore)
- [Wallet Options - Raw](/reference/common/multi-wallet-options-raw)
- [Wallet Options - Remote](/reference/common/multi-wallet-options-remote)
- [RPC Options](/reference/common/rpc-options)
- [Transaction Options](/reference/common/transaction-options)
- [Wallet Options - Hardware Wallet](/reference/common/wallet-options-hardware)
- [Wallet Options - Keystore](/reference/common/wallet-options-keystore)
- [WALLET OPTIONS - RAW:](/reference/common/wallet-options-raw)
- [Wallet Options - Remote](/reference/common/wallet-options-remote)
- [abs](/reference/forge-std/abs)
- [arithmeticError](/reference/forge-std/arithmeticError)
- [assertApproxEqAbs](/reference/forge-std/assertApproxEqAbs)
- [assertApproxEqAbsDecimal](/reference/forge-std/assertApproxEqAbsDecimal)
- [assertApproxEqRel](/reference/forge-std/assertApproxEqRel)
- [assertApproxEqRelDecimal](/reference/forge-std/assertApproxEqRelDecimal)
- [assertEq](/reference/forge-std/assertEq)
- [assertEqDecimal](/reference/forge-std/assertEqDecimal)
- [assertFalse](/reference/forge-std/assertFalse)
- [assertGe](/reference/forge-std/assertGe)
- [assertGeDecimal](/reference/forge-std/assertGeDecimal)
- [assertGt](/reference/forge-std/assertGt)
- [assertGtDecimal](/reference/forge-std/assertGtDecimal)
- [assertionError](/reference/forge-std/assertionError)
- [assertLe](/reference/forge-std/assertLe)
- [assertLeDecimal](/reference/forge-std/assertLeDecimal)
- [assertLt](/reference/forge-std/assertLt)
- [assertLtDecimal](/reference/forge-std/assertLtDecimal)
- [assertNotEq](/reference/forge-std/assertNotEq)
- [assertNotEqDecimal](/reference/forge-std/assertNotEqDecimal)
- [assertTrue](/reference/forge-std/assertTrue)
- [assumeNotPrecompile](/reference/forge-std/assume-no-precompiles)
- [assumePayable](/reference/forge-std/assume-payable)
- [bound](/reference/forge-std/bound)
- [changePrank](/reference/forge-std/change-prank)
- [checked_write](/reference/forge-std/checked_write)
- [computeCreateAddress](/reference/forge-std/compute-create-address)
- [Config](/reference/forge-std/config)
- [Console Logging](/reference/forge-std/console-log)
- [deal](/reference/forge-std/deal)
- [delta](/reference/forge-std/delta)
- [deployCode](/reference/forge-std/deployCode)
- [deployCodeTo](/reference/forge-std/deployCodeTo)
- [depth](/reference/forge-std/depth)
- [deriveRememberKey](/reference/forge-std/derive-remember-key)
- [divisionError](/reference/forge-std/divisionError)
- [enable_packed_slots](/reference/forge-std/enable_packed_slots)
- [encodeStorageError](/reference/forge-std/encodeStorageError)
- [enumConversionError](/reference/forge-std/enumConversionError)
- [fail](/reference/forge-std/fail)
- [find](/reference/forge-std/find)
- [hoax](/reference/forge-std/hoax)
- [indexOOBError](/reference/forge-std/indexOOBError)
- [makeAddr](/reference/forge-std/make-addr)
- [makeAddrAndKey](/reference/forge-std/make-addr-and-key)
- [memOverflowError](/reference/forge-std/memOverflowError)
- [noGasMetering](/reference/forge-std/noGasMetering)
- [Forge Standard Library Reference](/reference/forge-std/overview)
- [percentDelta](/reference/forge-std/percentDelta)
- [popError](/reference/forge-std/popError)
- [read](/reference/forge-std/read)
- [rewind](/reference/forge-std/rewind)
- [Script Utils](/reference/forge-std/script-utils)
- [sig](/reference/forge-std/sig)
- [skip](/reference/forge-std/skip)
- [startHoax](/reference/forge-std/startHoax)
- [Std Assertions](/reference/forge-std/std-assertions)
- [Std Cheats](/reference/forge-std/std-cheats)
- [StdConfig](/reference/forge-std/std-config)
- [Std Errors](/reference/forge-std/std-errors)
- [Std Logs](/reference/forge-std/std-logs)
- [Std Math](/reference/forge-std/std-math)
- [Std Storage](/reference/forge-std/std-storage)
- [target](/reference/forge-std/target)
- [with_key](/reference/forge-std/with_key)
- [zeroVarError](/reference/forge-std/zeroVarError)
- [forge bind](/reference/forge/bind)
- [forge bind-json](/reference/forge/bind-json)
- [forge build](/reference/forge/build)
- [forge cache](/reference/forge/cache)
- [forge clean](/reference/forge/clean)
- [forge clone](/reference/forge/clone)
- [forge compiler](/reference/forge/compiler)
- [forge completions](/reference/forge/completions)
- [forge config](/reference/forge/config)
- [forge coverage](/reference/forge/coverage)
- [forge create](/reference/forge/create)
- [forge doc](/reference/forge/doc)
- [forge eip712](/reference/forge/eip712)
- [forge flatten](/reference/forge/flatten)
- [forge fmt](/reference/forge/fmt)
- [forge](/reference/forge/forge)
- [forge geiger](/reference/forge/geiger)
- [forge generate](/reference/forge/generate)
- [forge init](/reference/forge/init)
- [forge inspect](/reference/forge/inspect)
- [forge install](/reference/forge/install)
- [forge lint](/reference/forge/lint)
- [forge remappings](/reference/forge/remappings)
- [forge remove](/reference/forge/remove)
- [forge script](/reference/forge/script)
- [forge selectors](/reference/forge/selectors)
- [forge snapshot](/reference/forge/snapshot)
- [forge soldeer](/reference/forge/soldeer)
- [forge test](/reference/forge/test)
- [forge tree](/reference/forge/tree)
- [forge update](/reference/forge/update)
- [forge verify-bytecode](/reference/forge/verify-bytecode)
- [forge verify-check](/reference/forge/verify-check)
- [forge verify-contract](/reference/forge/verify-contract)
- [cast call --create](/reference/cast/call/--create)
- [cast erc20-token allowance](/reference/cast/erc20-token/allowance)
- [cast erc20-token approve](/reference/cast/erc20-token/approve)
- [cast erc20-token balance](/reference/cast/erc20-token/balance)
- [cast erc20-token burn](/reference/cast/erc20-token/burn)
- [cast erc20-token decimals](/reference/cast/erc20-token/decimals)
- [cast erc20-token mint](/reference/cast/erc20-token/mint)
- [cast erc20-token name](/reference/cast/erc20-token/name)
- [cast erc20-token symbol](/reference/cast/erc20-token/symbol)
- [cast erc20-token total-supply](/reference/cast/erc20-token/total-supply)
- [cast erc20-token transfer](/reference/cast/erc20-token/transfer)
- [cast estimate --create](/reference/cast/estimate/--create)
- [cast keychain authorize](/reference/cast/keychain/authorize)
- [cast keychain check](/reference/cast/keychain/check)
- [cast keychain list](/reference/cast/keychain/list)
- [cast keychain revoke](/reference/cast/keychain/revoke)
- [cast keychain rl](/reference/cast/keychain/rl)
- [cast keychain rs](/reference/cast/keychain/rs)
- [cast keychain show](/reference/cast/keychain/show)
- [cast keychain ss](/reference/cast/keychain/ss)
- [cast keychain ul](/reference/cast/keychain/ul)
- [cast mktx --create](/reference/cast/mktx/--create)
- [cast send --create](/reference/cast/send/--create)
- [cast tip20-token create](/reference/cast/tip20-token/create)
- [cast tip20-token mine](/reference/cast/tip20-token/mine)
- [cast tx-pool content](/reference/cast/tx-pool/content)
- [cast tx-pool content-from](/reference/cast/tx-pool/content-from)
- [cast tx-pool inspect](/reference/cast/tx-pool/inspect)
- [cast tx-pool status](/reference/cast/tx-pool/status)
- [cast wallet address](/reference/cast/wallet/address)
- [cast wallet change-password](/reference/cast/wallet/change-password)
- [cast wallet decrypt-keystore](/reference/cast/wallet/decrypt-keystore)
- [cast wallet derive](/reference/cast/wallet/derive)
- [cast wallet import](/reference/cast/wallet/import)
- [cast wallet list](/reference/cast/wallet/list)
- [cast wallet new](/reference/cast/wallet/new)
- [cast wallet new-mnemonic](/reference/cast/wallet/new-mnemonic)
- [cast wallet private-key](/reference/cast/wallet/private-key)
- [cast wallet public-key](/reference/cast/wallet/public-key)
- [cast wallet remove](/reference/cast/wallet/remove)
- [cast wallet sign](/reference/cast/wallet/sign)
- [cast wallet sign-auth](/reference/cast/wallet/sign-auth)
- [cast wallet vanity](/reference/cast/wallet/vanity)
- [cast wallet verify](/reference/cast/wallet/verify)
- [forge cache clean](/reference/forge/cache/clean)
- [forge cache ls](/reference/forge/cache/ls)
- [forge compiler resolve](/reference/forge/compiler/resolve)
- [forge generate test](/reference/forge/generate/test)
- [forge selectors cache](/reference/forge/selectors/cache)
- [forge selectors collision](/reference/forge/selectors/collision)
- [forge selectors find](/reference/forge/selectors/find)
- [forge selectors list](/reference/forge/selectors/list)
- [forge selectors upload](/reference/forge/selectors/upload)
- [forge soldeer clean](/reference/forge/soldeer/clean)
- [forge soldeer init](/reference/forge/soldeer/init)
- [forge soldeer install](/reference/forge/soldeer/install)
- [forge soldeer login](/reference/forge/soldeer/login)
- [forge soldeer push](/reference/forge/soldeer/push)
- [forge soldeer uninstall](/reference/forge/soldeer/uninstall)
- [forge soldeer update](/reference/forge/soldeer/update)
- [forge soldeer version](/reference/forge/soldeer/version)
-->

## Solidity compiler

Configuration related to the behavior of the Solidity compiler.

**Sections**

* [General](#general)
* [Optimizer](#optimizer)
* [Model Checker](#model-checker)
* [Compilation Restrictions](#compilation-restrictions)

### General

Configuration related to the behavior of the Solidity compiler.

##### `remappings`

* Type: array of strings (remappings)
* Default: none
* Environment: `FOUNDRY_REMAPPINGS` or `DAPP_REMAPPINGS`

An array of remappings in the following format: `<name>=<target>`.

A remapping *remaps* Solidity imports to different directories. For example, the following remapping

```
@openzeppelin/=node_modules/@openzeppelin/openzeppelin-contracts/
```

with an import like

```solidity
import {Context} from "@openzeppelin/contracts/utils/Context.sol";
```

becomes

```solidity
import {Context} from "node_modules/@openzeppelin/openzeppelin-contracts/contracts/utils/Context.sol";
```

##### `auto_detect_remappings`

* Type: boolean
* Default: true
* Environment: `FOUNDRY_AUTO_DETECT_REMAPPINGS` or `DAPP_AUTO_DETECT_REMAPPINGS`

If enabled, Foundry will automatically try auto-detect remappings by scanning the `libs` folder(s).

If set to `false`, only the remappings in `foundry.toml` and `remappings.txt` are used.

##### `allow_paths`

* Type: array of strings (paths)
* Default: none
* Environment: `FOUNDRY_ALLOW_PATHS` or `DAPP_ALLOW_PATHS`

Tells solc to allow reading source files from additional directories. This is mainly relevant for complex workspaces managed by `pnpm` or similar.

See also [solc allowed-paths](https://docs.soliditylang.org/en/latest/path-resolution.html#allowed-paths)

##### `include_paths`

* Type: array of strings (paths)
* Default: none
* Environment: `FOUNDRY_INCLUDE_PATHS` or `DAPP_INCLUDE_PATHS`

Make an additional source directory available to the default import callback. Use this option if you want to import contracts whose location is not fixed in relation to your main source tree, e.g. third-party libraries installed using a package manager. Can be used multiple times. Can only be used if base path has a non-empty value.

See also [solc path resolution](https://docs.soliditylang.org/en/latest/path-resolution.html)

##### `libraries`

* Type: array of strings (libraries)
* Default: none
* Environment: `FOUNDRY_LIBRARIES` or `DAPP_LIBRARIES`

An array of libraries to link against in the following format: `<file>:<lib>:<address>`, for example: `src/MyLibrary.sol:MyLibrary:0xfD88CeE74f7D78697775aBDAE53f9Da1559728E4`.

##### `solc_version`

* Type: string (semver)
* Default: none
* Environment: `FOUNDRY_SOLC_VERSION` or `DAPP_SOLC_VERSION`

If specified, overrides the auto-detection system (more below) and uses a single Solidity compiler version for the project.

Only strict versions are supported (i.e. `0.8.11` is valid, but `^0.8.0` is not).

##### `auto_detect_solc`

* Type: boolean
* Default: true
* Environment: `FOUNDRY_AUTO_DETECT_SOLC` or `DAPP_AUTO_DETECT_SOLC`

If enabled, Foundry will automatically try to resolve appropriate Solidity compiler versions to compile your project.

This key is ignored if `solc_version` is set.

##### `offline`

* Type: boolean
* Default: false
* Environment: `FOUNDRY_OFFLINE` or `DAPP_OFFLINE`

If enabled, Foundry will not attempt to download any missing solc versions.

If both `offline` and `auto-detect-solc` are set to `true`, the required version(s) of solc will be auto detected but any missing versions will *not* be installed.

##### `ignored_warnings_from`

* Type: array of strings (file paths)
* Default: none
* Environment: `FOUNDRY_IGNORED_WARNINGS_FROM` OR `DAPP_IGNORED_WARNINGS_FROM`

An array of file paths from which warnings should be ignored during the compulation process. This is useful when you have a specific
directories of files that produce known warnings and you wish to suppress these warnings without affecting others.

Each entry in the array should be a path to a directory or a specific file. For Example:

`ignored_warnings_from = ["path/to/warnings/file1.sol", "path/to/warnings/file2.sol"]`

This configuration will cause the compiler to ignore any warnings that originate from the specified paths.

##### `ignored_error_codes`

* Type: array of integers/strings
* Default: none for source, SPDX license identifiers and contract size for tests
* Environment: `FOUNDRY_IGNORED_ERROR_CODES` or `DAPP_IGNORED_ERROR_CODES`

An array of Solidity compiler error codes to ignore during build, such as warnings.

Valid values are:

* `license`: 1878
* `code-size`: 5574
* `func-mutability`: 2018
* `unused-var`: 2072
* `unused-param`: 5667
* `unused-return`: 9302
* `virtual-interfaces`: 5815
* `missing-receive-ether`: 3628
* `shadowing`: 2519
* `same-varname`: 8760
* `unnamed-return`: 6321
* `unreachable`: 5740
* `pragma-solidity`: 3420
* `constructor-visibility`: 2462
* `init-code-size`: 3860
* `transient-storage`: 2394
* `too-many-warnings`: 4591

##### `deny_warnings`

* Type: boolean
* Default: false
* Environment: `FOUNDRY_DENY_WARNINGS` or `DAPP_DENY_WARNINGS`

If enabled, Foundry will treat Solidity compiler warnings as errors, stopping artifacts from being written to disk.

##### `evm_version`

* Type: string
* Default: prague
* Environment: `FOUNDRY_EVM_VERSION` or `DAPP_EVM_VERSION`

The EVM version to use during tests. The value **must** be an EVM hardfork name, such as `london`, `paris`, `shanghai`, `cancun`, `prague`, etc.

If you are relying on a specific EVM version for compatibility reasons you are recommended to pin to it in `foundry.toml`:

```toml
evm_version = "paris"
```

##### `revert_strings`

* Type: string
* Default: default
* Environment: `FOUNDRY_REVERT_STRINGS` or `DAPP_REVERT_STRINGS`

Possible values are:

* `default` does not inject compiler-generated revert strings and keeps user-supplied ones.
* `strip` removes all revert strings (if possible, i.e. if literals are used) keeping side-effects.
* `debug` injects strings for compiler-generated internal reverts, implemented for ABI encoders V1 and V2 for now.
* `verboseDebug` even appends further information to user-supplied revert strings (not yet implemented).

##### `extra_output_files`

* Type: array of strings
* Default: none
* Environment: N/A

Extra output from the Solidity compiler that should be written to files in the artifacts directory.

Valid values are:

* `metadata`: Written as a `metadata.json` file in the artifacts directory
* `ir`: Written as a `.ir` file in the artifacts directory
* `irOptimized`: Written as a `.iropt` file in the artifacts directory
* `ewasm`: Written as a `.ewasm` file in the artifacts directory
* `evm.assembly`: Written as a `.asm` file in the artifacts directory

##### `extra_output`

* Type: array of strings
* Default: see below
* Environment: N/A

Extra output to include in the contract's artifact.

The following values are always set, since they're required by Forge:

```toml
extra_output = [
  "abi",
  "evm.bytecode",
  "evm.deployedBytecode",
  "evm.methodIdentifiers",
]
```

For a list of valid values, see the [Solidity docs](https://docs.soliditylang.org/en/latest/using-the-compiler.html#input-description) (search for: *The available output types are as follows*).

##### `bytecode_hash`

* Type: string
* Default: ipfs
* Environment: `FOUNDRY_BYTECODE_HASH` or `DAPP_BYTECODE_HASH`

Determines the hash method for the metadata hash that is appended to the bytecode.

Valid values are:

* ipfs (default)
* bzzr1
* none

##### `sparse_mode`

* Type: boolean
* Default: false
* Environment: `FOUNDRY_SPARSE_MODE` or `DAPP_SPARSE_MODE`

Enables [sparse mode](/reference/forge/build#sparse-mode-experimental) for builds.

### Optimizer

Configuration related to the Solidity optimizer.

##### `optimizer`

* Type: boolean
* Default: false
* Environment: `FOUNDRY_OPTIMIZER` or `DAPP_OPTIMIZER`

Whether or not to enable the Solidity optimizer.

> ℹ️ **Note**
> Solidity optimizer is automatically enabled if `optimizer_runs` is set to a value greater than 0.

##### `optimizer_runs`

* Type: integer
* Default: 200
* Environment: `FOUNDRY_OPTIMIZER_RUNS` or `DAPP_OPTIMIZER_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). A `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. The maximum value of the parameter is `2**32-1`.

A common misconception is that this parameter specifies the number of iterations of the optimizer. This is not true: The optimizer will always run as many times as it can still improve the code.

##### `via_ir`

* Type: boolean
* Default: false
* Environment: `FOUNDRY_VIA_IR` or `DAPP_VIA_IR`

If set to true, changes compilation pipeline to go through the new IR optimizer.

##### `use_literal_content`

* Type: boolean
* Default: false

If set to true, changes compilation to only use literal content and not URLs.

##### `[optimizer_details]`

The optimizer details section is used to tweak how the Solidity optimizer behaves. There are several configurable values in this section (each of them are booleans):

* `peephole`
* `inliner`
* `jumpdestRemover`
* `orderLiterals`
* `deduplicate`
* `cse`
* `constantOptimizer`
* `yul`

Refer to the Solidity [compiler input description](https://docs.soliditylang.org/en/latest/using-the-compiler.html#compiler-input-and-output-json-description) for the default values.

##### `[optimizer_details.yul_details]`

The Yul details subsection of the optimizer details section is used to tweak how the new IR optimizer behaves. There are two configuration values:

* `stack_allocation`: Tries to improve the allocation of stack slots by freeing them up earlier.
* `optimizer_steps`: Selects the optimizer steps to be applied.

Refer to the Solidity [compiler input description](https://docs.soliditylang.org/en/latest/using-the-compiler.html#compiler-input-and-output-json-description) for the default values.

> ℹ️ **Note**
> If you encounter compiler errors when using `via_ir`, explicitly enable the legacy `optimizer` and leave `optimizer_steps` as an empty string

### Model checker

The Solidity model checker is a built-in opt-in module that is available in Solidity compilers for OSX and Linux. Learn more about the model checker in the [Solidity compiler documentation](https://docs.soliditylang.org/en/latest/smtchecker.html#tutorial)

> ℹ️ **Note**
> The model checker requires `z3` version 4.8.8 or 4.8.14 on Linux.

The model checker settings are configured in the `[model_checker]` section of the configuration.

The model checker will run when `forge build` is invoked, and any findings will show up as warnings.

These are the recommended settings when using the model checker:

```toml
[profile.default.model_checker]
contracts = {'/path/to/project/src/Contract.sol' = ['Contract']}
engine = 'chc'
timeout = 10000
targets = ['assert']
```

Setting which contract should be verified is extremely important, otherwise all available contracts will be verified which may take a long time.

The recommended engine is `chc`, but `bmc` and `all` (which runs both) are also accepted.

It is also important to set a proper timeout (given in milliseconds), since the default time given to the underlying solver may not be enough.

If no verification targets are given, only assertions will be checked.

##### `[model_checker]`

The following keys are available in the model checker section.

###### `model_checker.contracts`

* Type: table
* Default: all
* Environment: N/A

Specifies what contracts the model checker will analyze.

The key of the table is the path to a source file, and the value is an array of contract names to check.

For example:

```toml
[profile.default.model_checker]
contracts = { "src/MyContracts.sol" = ["ContractA", "ContractB"] }
```

###### `model_checker.div_mod_with_slacks`

* Type: boolean
* Default: false
* Environment: N/A

Sets how division and modulo operations should be encoded.

Refer to the [Solidity documentation](https://docs.soliditylang.org/en/latest/smtchecker.html#division-and-modulo-with-slack-variables) for more information.

###### `model_checker.engine`

* Type: string (see below)
* Default: all
* Environment: N/A

Specifies the model checker engine to run. Valid values are:

* `chc`: The constrained horn clauses engine
* `bmc`: The bounded model checker engine
* `all`: Runs both engines

Refer to the [Solidity documentation](https://docs.soliditylang.org/en/latest/smtchecker.html#model-checking-engines) for more information on the engines.

###### `model_checker.invariants`

* Type: array of strings
* Default: N/A
* Environment: N/A

Sets the model checker invariants. Valid values are:

* `contract`: Contract Invariants
* `reentrancy`: Reentrancy Properties

Refer to the [Solidity documentation](https://docs.soliditylang.org/en/latest/smtchecker.html#reported-inferred-inductive-invariants) for more information on the invariants.

###### `model_checker.show_unproved`

* Type: boolean
* Default: false
* Environment: N/A

Whether or not to output all unproved targets.

Refer to the [Solidity documentation](https://docs.soliditylang.org/en/latest/smtchecker.html#unproved-targets) for more information.

###### `model_checker.solvers`

* Type: array of strings
* Default: N/A
* Environment: N/A

Sets the model checker solvers. Valid values are:

* `cvc4`
* `eld`: introduced in v0.8.18
* `smtlib2`
* `z3`

Refer to the [Solidity documentation](https://docs.soliditylang.org/en/latest/smtchecker.html#smt-and-horn-solvers) for more information.

###### `model_checker.timeout`

* Type: number (milliseconds)
* Default: N/A
* Environment: N/A

Sets the timeout for the underlying model checker engines (in milliseconds).

###### `model_checker.targets`

* Type: array of strings
* Default: assert
* Environment: N/A

Sets the model checker targets. Valid values are:

* `assert`: Assertions
* `underflow`: Arithmetic underflow
* `overflow`: Arithmetic overflow
* `divByZero`: Division by zero
* `constantCondition`: Trivial conditions and unreachable code
* `popEmptyArray`: Popping an empty array
* `outOfBounds`: Out of bounds array/fixed bytes index access
* `default`: All of the above (note: not the default for Forge)

### Compilation Restrictions

Compilation restrictions allows configuration of how individual files or directories within projects are compiled.

> For a complex configuration of compiler profiles and compiler restrictions please refer to Uniswap [contracts monorepo](https://github.com/Uniswap/contracts/blob/4d80a9cfed9b920b83a394b168a95319606a0b73/foundry.toml#L27-L72).

For example, with configuration below, `Counter.sol` contract under `src` is compiled with `via-ir` option enabled while all other contracts (including tests) are compiled with the default profile.

```toml
# add via_ir profile
additional_compiler_profiles = [ { name = "via-ir", via_ir = true } ]

# enforce compiling tests without via_ir and only some heavy contract with via_ir
# note: it will only work if tests are using vm.deployCode to deploy contract
compilation_restrictions = [
    { paths = "test/**", via_ir = false },
    { paths = "src/Counter.sol", via_ir = true },
]
```

We can configure how individual files or directories are compiled by specifying the `compilation_restrictions` configuration (which applies to sources importing the restricted file as well).\
Once we have a set of restrictions we need to construct settings objects to satisfy them. This is done by adding `additional_compiler_profiles`, which is a mapping from profile name to settings overrides.

In the example above, we added a single profile named `via-ir` which uses default compilation settings but enables `via_ir` option, making it possible to compile the `Counter.sol` contract with `via_ir`, while all other contracts (including tests) with the default profile.\
When choosing compiler profile, first profile (starting with default one) satisfying restrictions of the source file and all of its imports will be used.

> If the same source file is compiled with several profiles, then an artifact is generated for each profile - if `Counter` is compiled with default and `v1` profile, `Counter.json` and `Counter.v1.json` artifacts are created.

#### Additional compiler settings:

`[additional_compiler_profiles]`

* Type: array of additional compiler profiles

Configures a mapping from profile name to settings overrides.

For example, an additional `via-ir` compiler profile that changes compilation pipeline to go through the new IR optimizer can be defined as:

```toml
additional_compiler_profiles = [ { name = "via-ir", via_ir = true } ]
```

There are several configurable values for a compiler profile:

* `name`
* `via_ir`
* `evm_version`
* `optimizer`
* `optimizer_runs`
* `bytecode_hash`

##### `additional_compiler_profile.name`

* Type: string

Additional compiler profile name.

##### `additional_compiler_profile.via_ir`

* Type: boolean
* Default: false

Additional compiler profile [via\_ir](#via_ir) setting.

##### `additional_compiler_profile.evm_version`

* Type: string
* Default: prague

Additional compiler profile [evm\_version](#evm_version) setting.

##### `additional_compiler_profile.optimizer`

* Type: boolean
* Default: false

Additional compiler profile [optimizer](#optimizer) setting.

##### `additional_compiler_profile.optimizer_runs`

* Type: integer
* Default: 200

Additional compiler profile [optimizer\_runs](#optimizer_runs) setting.

##### `additional_compiler_profile.bytecode_hash`

* Type: string
* Default: ipfs

Additional compiler profile [bytecode\_hash](#bytecode_hash) setting.

#### Compilation restrictions settings:

#### `[compilation_restrictions]`

* Type: array of compilation restrictions settings

##### `compilation_restriction.paths`

* Type: regex

Only applies compilation restrictions on files matching given paths.

For example:

* `src/contracts/Counter.sol` - apply restrictions for specific contract
* `src/contracts/{Counter,CounterFactory}.sol` - apply restrictions for multiple contracts, by name
* `src/v1/**` or `src/v3/**/libraries/**` - apply restrictions for all contracts in matching source path

There are several configurable values for an compilation restriction:

* `version`
* `via_ir`
* `bytecode_hash`
* `optimizer_runs`
* `min_optimizer_runs`
* `max_optimizer_runs`
* `evm_version`
* `min_evm_version`
* `max_evm_version`

##### `compilation_restriction.version`

* Type: string (semver)

Restrict compilation for specific [solc\_version](#solc_version).

##### `compilation_restriction.via_ir`

* Type: boolean

Restrict compilation for specific [via\_ir](#via_ir) setting.

##### `compilation_restriction.bytecode_hash`

* Type: string

Restrict compilation matching provided bytecode hash method.

##### `compilation_restriction.optimizer_runs`

* Type: integer

Restrict compilation for specific [optimizer\_runs](#optimizer_runs) setting. Conflicts with `min_optimizer_runs` and `max_optimizer_runs` settings.

##### `compilation_restriction.min_optimizer_runs`

* Type: integer

Restrict compilation for min of [optimizer\_runs](#optimizer_runs) setting. Conflicts with `optimizer_runs` setting, requires `max_optimizer_runs` setting.

##### `compilation_restriction.max_optimizer_runs`

* Type: integer

Restrict compilation for max of [optimizer\_runs](#optimizer_runs) setting. Conflicts with `optimizer_runs` setting, requires `min_optimizer_runs` setting.

##### `compilation_restriction.evm_version`

* Type: string

Restrict compilation for specific [evm\_version](#evm_version) setting. Conflicts with `min_evm_version` and `max_evm_version` settings.

##### `compilation_restriction.min_evm_version`

* Type: string

Restrict compilation for a min version of [evm\_version](#evm_version) setting. Conflicts with `evm_version` setting, requires `max_evm_version` setting.

##### `compilation_restriction.max_evm_version`

* Type: string

Restrict compilation for a max version of [evm\_version](#evm_version) setting. Conflicts with `evm_version` setting, requires `min_evm_version` setting.
