<!--
Sitemap:
- [Installation](/introduction/installation): Install Foundry using foundryup, precompiled binaries, or build from source.
- [Getting Started](/introduction/getting-started): Get started with Foundry's four core tools - Forge, Cast, Anvil, and Chisel.
- [Prompting](/introduction/prompting): Use structured prompts to get better results from AI coding assistants.
- [Project Setup](/projects/): Create and configure Foundry projects for smart contract development.
- [Project Layout](/projects/layout): Understand Foundry's project structure and directory conventions.
- [Dependencies](/projects/dependencies): Manage dependencies using git submodules and remappings.
- [Soldeer](/projects/soldeer): Use Soldeer as an alternative package manager for Foundry projects.
- [Forge](/forge/): Forge is Foundry's build, test, and deploy tool for Solidity smart contracts.
- [Building contracts](/forge/build): Compile Solidity contracts with Forge.
- [Testing](/forge/testing): Write and run tests for Solidity contracts with Forge.
- [Scripting](/forge/scripting): Deploy and interact with contracts using Forge scripts.
- [Debugging](/forge/debugging): Debug Solidity contracts with Forge traces and the interactive debugger.
- [Gas tracking](/forge/gas-tracking): Track and compare gas usage with Forge snapshots and reports.
- [Formatting](/forge/formatting): Format Solidity code with Forge.
- [Linting](/forge/linting): Lint Solidity code with Forge.
- [Arbitrary ERC20 send](/forge/linting/arbitrary-send-erc20): Arbitrary ERC20 send
- [Arbitrary ETH send](/forge/linting/arbitrary-send-eth): Arbitrary ETH send
- [Controlled delegatecall](/forge/linting/controlled-delegatecall): Controlled delegatecall target
- [Hash collision from abi.encodePacked](/forge/linting/encode-packed-collision): Hash collision from abi.encodePacked with multiple dynamic arguments
- [Unchecked ERC20 transfer return value](/forge/linting/erc20-unchecked-transfer): Unchecked ERC20 transfer return value
- [Incorrect shift order](/forge/linting/incorrect-shift): Incorrect shift order
- [ETH reentrancy through uncapped calls](/forge/linting/reentrancy-eth): ETH reentrancy through uncapped calls
- [Right-to-left override character](/forge/linting/rtlo): Right-to-left override character
- [Unchecked low-level call](/forge/linting/unchecked-call): Unchecked low-level call
- [Unprotected upgradeable initializer](/forge/linting/unprotected-initializer): Unprotected upgradeable initializer
- [Assert State Change](/forge/linting/assert-state-change): State-modifying expression inside assert()
- [Misuse of a boolean constant](/forge/linting/boolean-cst): Misuse of a boolean constant
- [Divide before multiply](/forge/linting/divide-before-multiply): Divide before multiply
- [Incorrect ERC20 interface](/forge/linting/incorrect-erc20-interface): Incorrect ERC20 interface
- [Incorrect ERC721 interface](/forge/linting/incorrect-erc721-interface): Incorrect ERC721 interface
- [Incorrect strict equality](/forge/linting/incorrect-strict-equality): Dangerous strict equality check on an externally-influenced value
- [Locked Ether](/forge/linting/locked-ether): Contract receives ETH but has no way to send it out
- [Low-level calls](/forge/linting/low-level-calls): Low-level calls
- [No-ETH read-before-write reentrancy](/forge/linting/reentrancy-no-eth): No-ETH read-before-write reentrancy
- [Use of tx.origin for authorization](/forge/linting/tx-origin): Use of tx.origin for authorization
- [Type-Based Tautology](/forge/linting/type-based-tautology): Type-based tautological comparison
- [Uninitialized local variable](/forge/linting/uninitialized-local): Uninitialized local variable
- [Uninitialized state variable](/forge/linting/uninitialized-state): Uninitialized state variable
- [Unsafe typecast](/forge/linting/unsafe-typecast): Unsafe typecast
- [Unused return value](/forge/linting/unused-return): Unused return value from an external call
- [Weak pseudo-random number generation](/forge/linting/weak-prng): Weak pseudo-random number generation
- [Use of block.timestamp in comparisons](/forge/linting/block-timestamp): Use of block.timestamp in comparisons
- [External calls inside loops](/forge/linting/calls-loop): External calls inside loops
- [Delegatecall inside payable loops](/forge/linting/delegatecall-loop): Delegatecall inside payable loops
- [Missing events for access control changes](/forge/linting/missing-events-access-control): Missing events for access control changes
- [Missing events for arithmetic state changes](/forge/linting/missing-events-arithmetic): Missing events for arithmetic state changes
- [Missing zero-address check](/forge/linting/missing-zero-check): Missing zero-address check
- [msg.value inside loops](/forge/linting/msg-value-loop): msg.value inside loops
- [Events emitted after external calls](/forge/linting/reentrancy-events): Events emitted after external calls
- [Return bomb](/forge/linting/return-bomb): Return bomb
- [Boolean comparison to a constant](/forge/linting/boolean-equal): Boolean comparison to a constant
- [Address and id event parameters should be indexed](/forge/linting/event-fields): Address and id event parameters should be indexed
- [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 inheritance from an implemented interface](/forge/linting/missing-inheritance): Missing inheritance from an implemented interface
- [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
- [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
- [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
- [Unaliased plain import](/forge/linting/unaliased-plain-import): Unaliased plain import
- [Usage of unsafe cheatcodes](/forge/linting/unsafe-cheatcode): Usage of unsafe cheatcodes
- [Unused import](/forge/linting/unused-import): Unused import
- [Inefficient keccak256 call](/forge/linting/asm-keccak256): Inefficient keccak256 call
- [Array length not cached](/forge/linting/cache-array-length): Array length not cached
- [Costly Operations Inside a Loop](/forge/linting/costly-loop): Costly operations inside a loop
- [State variable could be constant](/forge/linting/could-be-constant): State variable could be 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
- [Public function can be declared external](/forge/linting/external-function): Public function can be declared external
- [Unused state variable](/forge/linting/unused-state-variables): Unused state variable
- [State variable read via this](/forge/linting/var-read-using-this): State variable read via `this`
- [Write After Write](/forge/linting/write-after-write): Redundant storage write; value overwritten before being read
- [Unwrapped modifier logic](/forge/linting/unwrapped-modifier-logic): Unwrapped modifier logic
- [Cast](/cast/): Cast is Foundry's command-line tool for interacting with Ethereum.
- [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.
- [ABI encoding](/cast/abi-encoding): Encode and decode ABI data, calldata, and function signatures with Cast.
- [Anvil](/anvil/): Anvil is Foundry's local Ethereum node for development and testing.
- [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.
- [Custom methods](/anvil/custom-methods): Anvil's custom RPC methods for impersonation, mining control, and state manipulation.
- [Chisel](/chisel/): Chisel is Foundry's interactive Solidity REPL for rapid prototyping and debugging.
- [Session management](/chisel/session-management): Save, load, and export Chisel REPL sessions.
- [Forking](/chisel/forking): Fork live chains in Chisel to interact with deployed contracts.
- [Commands](/chisel/commands): All available commands in the Chisel REPL.
- [FAQ](/help/faq): Frequently asked questions about Foundry and its tools.
- [Troubleshooting](/help/troubleshooting): Solutions to common Foundry errors and issues.
- [Configuration](/config/): Configure Foundry with foundry.toml, profiles, and environment variables.
- [Profiles](/config/profiles): Use profiles to switch between configurations for development, CI, and production.
- [Compiler](/config/compiler): Configure the Solidity compiler settings for your Foundry project.
- [Testing](/config/testing): Configure testing behavior including fuzz testing and invariant testing.
- [MESC](/config/mesc): Use MESC to manage RPC endpoints across all your crypto tools from a single configuration file.
- [CI Integration](/config/ci): Set up Foundry in GitHub Actions and other CI systems.
- [Editor Setup](/config/editors): Configure VS Code, Vim, and other editors for Foundry projects.
- [Best Practices](/best-practices): Best practices for writing contracts, tests, scripts, and managing security in Foundry projects.
- [Guides](/guides/): Practical guides for common Foundry workflows and advanced patterns.
- [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.
- [Multi-Chain Deployments](/guides/multi-chain-deployments): Deploy the same contracts across multiple networks with per-chain configuration.
- [Upgrading Contracts](/guides/upgrading-contracts): Implement proxy patterns with Forge scripts and verify storage layout compatibility.
- [Fork Testing](/guides/fork-testing): Test against live chain state, impersonate accounts, and handle time-sensitive logic.
- [Invariant Testing](/guides/invariant-testing): Write effective invariant tests with handler patterns and ghost variables.
- [Foundry on Tempo](/guides/tempo): Use Foundry's upstream Tempo support to initialize projects, configure foundry.toml, and work with Tempo transactions.
- [MPP-backed RPC endpoints](/guides/mpp): Use Foundry with HTTP 402 payment-gated RPC endpoints through the Machine Payments Protocol (MPP).
- [Debugging Transactions](/guides/debugging-transactions): Replay and debug failed mainnet transactions with trace analysis.
- [Gas Optimization](/guides/gas-optimization): Profile gas usage and optimize with snapshots and the IR pipeline.
- [Stack Too Deep](/guides/stack-too-deep): Understanding and resolving the "Stack too deep" compilation error in Solidity.
- [Docker & Containers](/guides/docker): Run Foundry in Docker for reproducible builds and CI environments.
- [Foundry v1.0 migration guide](/guides/migrations/foundry-v1): Summary of breaking changes and migration steps for Foundry v1.0.
- [forge](/reference/forge/forge)
- [forge build](/reference/forge/build)
- [forge cache clean](/reference/forge/cache/clean)
- [forge clean](/reference/forge/clean)
- [forge inspect](/reference/forge/inspect)
- [forge soldeer clean](/reference/forge/soldeer/clean)
- [forge create](/reference/forge/create)
- [forge flatten](/reference/forge/flatten)
- [forge verify-check](/reference/forge/verify-check)
- [forge verify-contract](/reference/forge/verify-contract)
- [forge completions](/reference/forge/completions)
- [forge clone](/reference/forge/clone)
- [forge config](/reference/forge/config)
- [forge geiger](/reference/forge/geiger)
- [forge init](/reference/forge/init)
- [forge install](/reference/forge/install)
- [forge remappings](/reference/forge/remappings)
- [forge remove](/reference/forge/remove)
- [forge soldeer init](/reference/forge/soldeer/init)
- [forge soldeer install](/reference/forge/soldeer/install)
- [forge soldeer update](/reference/forge/soldeer/update)
- [forge tree](/reference/forge/tree)
- [forge update](/reference/forge/update)
- [forge coverage](/reference/forge/coverage)
- [forge snapshot](/reference/forge/snapshot)
- [forge test](/reference/forge/test)
- [forge bind](/reference/forge/bind)
- [forge bind-json](/reference/forge/bind-json)
- [forge cache](/reference/forge/cache)
- [forge cache ls](/reference/forge/cache/ls)
- [forge compiler](/reference/forge/compiler)
- [forge compiler resolve](/reference/forge/compiler/resolve)
- [forge doc](/reference/forge/doc)
- [forge eip712](/reference/forge/eip712)
- [forge fmt](/reference/forge/fmt)
- [forge lint](/reference/forge/lint)
- [forge script](/reference/forge/script)
- [forge selectors](/reference/forge/selectors)
- [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](/reference/forge/soldeer)
- [forge soldeer login](/reference/forge/soldeer/login)
- [forge soldeer push](/reference/forge/soldeer/push)
- [forge soldeer uninstall](/reference/forge/soldeer/uninstall)
- [forge soldeer version](/reference/forge/soldeer/version)
- [forge verify-bytecode](/reference/forge/verify-bytecode)
- [cast](/reference/cast/cast)
- [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 calldata](/reference/cast/calldata)
- [cast decode-abi](/reference/cast/decode-abi)
- [cast decode-calldata](/reference/cast/decode-calldata)
- [cast pretty-calldata](/reference/cast/pretty-calldata)
- [cast selectors](/reference/cast/selectors)
- [cast upload-signature](/reference/cast/upload-signature)
- [cast balance](/reference/cast/balance)
- [cast code](/reference/cast/code)
- [cast codesize](/reference/cast/codesize)
- [cast erc20-token balance](/reference/cast/erc20-token/balance)
- [cast nonce](/reference/cast/nonce)
- [cast proof](/reference/cast/proof)
- [cast storage](/reference/cast/storage)
- [cast age](/reference/cast/age)
- [cast block](/reference/cast/block)
- [cast block-number](/reference/cast/block-number)
- [cast find-block](/reference/cast/find-block)
- [cast gas-price](/reference/cast/gas-price)
- [cast chain](/reference/cast/chain)
- [cast chain-id](/reference/cast/chain-id)
- [cast client](/reference/cast/client)
- [cast format-bytes32-string](/reference/cast/format-bytes32-string)
- [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 parse-bytes32-address](/reference/cast/parse-bytes32-address)
- [cast parse-bytes32-string](/reference/cast/parse-bytes32-string)
- [cast shl](/reference/cast/shl)
- [cast shr](/reference/cast/shr)
- [cast to-ascii](/reference/cast/to-ascii)
- [cast to-base](/reference/cast/to-base)
- [cast to-bytes32](/reference/cast/to-bytes32)
- [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-wei](/reference/cast/to-wei)
- [cast lookup-address](/reference/cast/lookup-address)
- [cast namehash](/reference/cast/namehash)
- [cast resolve-name](/reference/cast/resolve-name)
- [cast source](/reference/cast/source)
- [cast completions](/reference/cast/completions)
- [cast access-list](/reference/cast/access-list)
- [cast call](/reference/cast/call)
- [cast estimate](/reference/cast/estimate)
- [cast logs](/reference/cast/logs)
- [cast mktx](/reference/cast/mktx)
- [cast publish](/reference/cast/publish)
- [cast receipt](/reference/cast/receipt)
- [cast rpc](/reference/cast/rpc)
- [cast run](/reference/cast/run)
- [cast send](/reference/cast/send)
- [cast tx](/reference/cast/tx)
- [cast abi-encode-event](/reference/cast/abi-encode-event)
- [cast address-zero](/reference/cast/address-zero)
- [cast admin](/reference/cast/admin)
- [cast artifact](/reference/cast/artifact)
- [cast b2e-payload](/reference/cast/b2e-payload)
- [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 call --create](/reference/cast/call/--create)
- [cast codehash](/reference/cast/codehash)
- [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 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 erc20-token allowance](/reference/cast/erc20-token/allowance)
- [cast erc20-token approve](/reference/cast/erc20-token/approve)
- [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 format-units](/reference/cast/format-units)
- [cast hash-message](/reference/cast/hash-message)
- [cast hash-zero](/reference/cast/hash-zero)
- [cast implementation](/reference/cast/implementation)
- [cast index-erc7201](/reference/cast/index-erc7201)
- [cast interface](/reference/cast/interface)
- [cast keccak](/reference/cast/keccak)
- [cast keychain](/reference/cast/keychain)
- [cast keychain authorize](/reference/cast/keychain/authorize)
- [cast keychain check](/reference/cast/keychain/check)
- [cast keychain doctor](/reference/cast/keychain/doctor)
- [cast keychain inspect](/reference/cast/keychain/inspect)
- [cast keychain list](/reference/cast/keychain/list)
- [cast keychain policy](/reference/cast/keychain/policy)
- [cast keychain policy add-call](/reference/cast/keychain/policy/add-call)
- [cast keychain policy remove-target](/reference/cast/keychain/policy/remove-target)
- [cast keychain policy set-limit](/reference/cast/keychain/policy/set-limit)
- [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 max-int](/reference/cast/max-int)
- [cast max-uint](/reference/cast/max-uint)
- [cast min-int](/reference/cast/min-int)
- [cast mktx --create](/reference/cast/mktx/--create)
- [cast pad](/reference/cast/pad)
- [cast parse-units](/reference/cast/parse-units)
- [cast recover-authority](/reference/cast/recover-authority)
- [cast send --create](/reference/cast/send/--create)
- [cast sig](/reference/cast/sig)
- [cast sig-event](/reference/cast/sig-event)
- [cast storage-root](/reference/cast/storage-root)
- [cast tempo](/reference/cast/tempo)
- [cast tempo login](/reference/cast/tempo/login)
- [cast tip20-token](/reference/cast/tip20-token)
- [cast tip20-token create](/reference/cast/tip20-token/create)
- [cast tip20-token mine](/reference/cast/tip20-token/mine)
- [cast to-check-sum-address](/reference/cast/to-check-sum-address)
- [cast to-utf8](/reference/cast/to-utf8)
- [cast trace](/reference/cast/trace)
- [cast tx-pool](/reference/cast/tx-pool)
- [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 virtual-address](/reference/cast/virtual-address)
- [cast virtual-address create](/reference/cast/virtual-address/create)
- [cast virtual-address resolve](/reference/cast/virtual-address/resolve)
- [cast virtual-address watch](/reference/cast/virtual-address/watch)
- [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)
- [cast wallet](/reference/cast/wallet)
- [anvil](/reference/anvil/anvil)
- [anvil completions](/reference/anvil/completions)
- [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)
- [Cheatcodes Reference](/reference/cheatcodes/overview)
- [warp](/reference/cheatcodes/warp): Sets block.timestamp to a specified value in Forge tests
- [roll](/reference/cheatcodes/roll): Sets block.number to a specified value in Forge tests
- [fee](/reference/cheatcodes/fee): Sets block.basefee to a specified value in Forge tests
- [getBlockTimestamp](/reference/cheatcodes/get-block-timestamp): Gets the current block.timestamp, avoiding IR compilation optimization issues
- [getBlockNumber](/reference/cheatcodes/get-block-number): Gets the current block.number, avoiding IR compilation optimization issues
- [difficulty](/reference/cheatcodes/difficulty): Sets block.difficulty for pre-merge EVM versions in Forge tests
- [prevrandao](/reference/cheatcodes/prevrandao): Sets block.prevrandao for post-merge EVM versions in Forge tests
- [chainId](/reference/cheatcodes/chain-id): Sets block.chainid to a specified value in Forge tests
- [store](/reference/cheatcodes/store): Stores a value in a specific storage slot of an account
- [load](/reference/cheatcodes/load): Loads a value from a specific storage slot of an account
- [etch](/reference/cheatcodes/etch): Sets the bytecode of an address to custom code
- [deal](/reference/cheatcodes/deal): Sets the ETH balance of an address
- [prank](/reference/cheatcodes/prank): Sets msg.sender for the next call to a specified address
- [startPrank](/reference/cheatcodes/start-prank): Sets msg.sender for all subsequent calls until stopPrank is called
- [stopPrank](/reference/cheatcodes/stop-prank): Stops an active prank, resetting msg.sender and tx.origin
- [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
- [accesses](/reference/cheatcodes/accesses): Gets all storage slots that have been read or written to on an address
- [recordLogs](/reference/cheatcodes/record-logs): Starts recording all emitted events
- [getRecordedLogs](/reference/cheatcodes/get-recorded-logs): Gets all emitted events recorded by recordLogs
- [setNonce](/reference/cheatcodes/set-nonce): Sets the nonce of an account
- [getNonce](/reference/cheatcodes/get-nonce): Gets the nonce of an account or wallet
- [mockCall](/reference/cheatcodes/mock-call): Mocks calls to an address with specific calldata to return specified data
- [mockCalls](/reference/cheatcodes/mock-calls): Mocks calls to return different data for each successive invocation
- [mockCallRevert](/reference/cheatcodes/mock-call-revert): Mocks calls to an address to revert with specified data
- [mockFunction](/reference/cheatcodes/mock-function): Executes calls to an address using bytecode from another address
- [clearMockedCalls](/reference/cheatcodes/clear-mocked-calls): Clears all mocked calls
- [coinbase](/reference/cheatcodes/coinbase): Sets block.coinbase to a specified address
- [broadcast](/reference/cheatcodes/broadcast): Makes the next call create a transaction that can be signed and sent onchain
- [startBroadcast](/reference/cheatcodes/start-broadcast): Makes all subsequent calls create transactions that can be signed and sent onchain
- [stopBroadcast](/reference/cheatcodes/stop-broadcast): Stops collecting transactions for onchain broadcasting
- [pauseGasMetering](/reference/cheatcodes/pause-gas-metering): Pauses gas metering so gasleft() does not decrease
- [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
- [txGasPrice](/reference/cheatcodes/tx-gas-price): Sets tx.gasprice for the rest of the transaction
- [startStateDiffRecording](/reference/cheatcodes/start-state-diff-recording): Starts recording all state changes during execution
- [stopAndReturnStateDiff](/reference/cheatcodes/stop-and-return-state-diff): Stops state diff recording and returns all recorded state changes
- [snapshotState cheatcodes](/reference/cheatcodes/state-snapshots): Snapshot and restore EVM state
- [snapshotGas cheatcodes](/reference/cheatcodes/gas-snapshots): Capture and compare gas usage across test runs
- [isContext](/reference/cheatcodes/is-context): Checks the current Forge execution context
- [expectRevert](/reference/cheatcodes/expect-revert): Asserts that the next call reverts with optional message matching
- [expectEmit](/reference/cheatcodes/expect-emit): Asserts that specific events are emitted during the next call
- [expectCall](/reference/cheatcodes/expect-call): Asserts that a specific call is made during test execution
- [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
- [createFork](/reference/cheatcodes/create-fork): Creates a new fork from an RPC endpoint
- [selectFork](/reference/cheatcodes/select-fork): Activates a previously created fork
- [createSelectFork](/reference/cheatcodes/create-select-fork): Creates and activates a new fork in one call
- [activeFork](/reference/cheatcodes/active-fork): Returns the identifier of the currently active fork
- [rollFork](/reference/cheatcodes/roll-fork): Sets the block number of a fork
- [makePersistent](/reference/cheatcodes/make-persistent): Marks accounts as persistent across fork switches
- [revokePersistent](/reference/cheatcodes/revoke-persistent): Removes persistent status from accounts
- [isPersistent](/reference/cheatcodes/is-persistent): Checks if an account is marked as persistent across forks
- [allowCheatcodes](/reference/cheatcodes/allow-cheatcodes): Grants cheatcode access to an address in forking mode
- [transact](/reference/cheatcodes/transact): Fetches and executes a transaction from a fork
- [ffi](/reference/cheatcodes/ffi): Calls an arbitrary external command
- [prompt](/reference/cheatcodes/prompt): Displays an interactive prompt for user input in scripts
- [projectRoot](/reference/cheatcodes/project-root): Returns the root directory of the current Foundry project
- [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
- [sleep](/reference/cheatcodes/sleep): Pauses execution for a specified duration
- [unixTime](/reference/cheatcodes/unix-time): Returns the current unix timestamp in milliseconds
- [setEnv](/reference/cheatcodes/set-env): Sets an environment variable
- [envOr](/reference/cheatcodes/env-or): Reads an environment variable with a default fallback value
- [envBool](/reference/cheatcodes/env-bool): Reads an environment variable as bool or bool[]
- [envUint](/reference/cheatcodes/env-uint): Reads an environment variable as uint256 or uint256[]
- [envInt](/reference/cheatcodes/env-int): Reads an environment variable as int256 or int256[]
- [envAddress](/reference/cheatcodes/env-address): Reads an environment variable as address or address[]
- [envBytes32](/reference/cheatcodes/env-bytes32): Reads an environment variable as bytes32 or bytes32[]
- [envString](/reference/cheatcodes/env-string): Reads an environment variable as string or string[]
- [envBytes](/reference/cheatcodes/env-bytes): Reads an environment variable as bytes or bytes[]
- [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
- [parseJson](/reference/cheatcodes/parse-json): Parses JSON files and returns values as ABI-encoded bytes
- [parseToml](/reference/cheatcodes/parse-toml): Parses TOML files and returns values as ABI-encoded bytes
- [parseJsonKeys](/reference/cheatcodes/parse-json-keys): Gets list of keys present in a JSON string
- [parseTomlKeys](/reference/cheatcodes/parse-toml-keys): Gets list of keys present in a TOML string
- [serializeJson](/reference/cheatcodes/serialize-json): Serializes values as a stringified JSON object
- [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
- [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
- [addr](/reference/cheatcodes/addr): Computes the address for a given private key
- [skip](/reference/cheatcodes/skip): Marks a test as skipped conditionally
- [label](/reference/cheatcodes/label): Sets a label for an address in test traces
- [getLabel](/reference/cheatcodes/get-label): Retrieves the label for an address
- [deriveKey](/reference/cheatcodes/derive-key): Derives a private key from a mnemonic phrase
- [parseBytes](/reference/cheatcodes/parse-bytes): Parses a hex string into bytes
- [parseAddress](/reference/cheatcodes/parse-address): Parses a hex string into an address
- [parseUint](/reference/cheatcodes/parse-uint): Parses a string into a uint256
- [parseInt](/reference/cheatcodes/parse-int): Parses a string into an int256
- [parseBytes32](/reference/cheatcodes/parse-bytes32): Parses a hex string into bytes32
- [parseBool](/reference/cheatcodes/parse-bool): Parses a string into a bool
- [rememberKey](/reference/cheatcodes/remember-key): Stores a private key in forge's local wallet for broadcasting
- [toString](/reference/cheatcodes/to-string): Converts any type to its string representation
- [breakpoint](/reference/cheatcodes/breakpoint): Places a breakpoint for the debugger
- [createWallet](/reference/cheatcodes/create-wallet): Creates a new Wallet struct with address and keys
- [copyStorage](/reference/cheatcodes/copy-storage): Copies storage from one contract to another
- [setArbitraryStorage](/reference/cheatcodes/set-arbitrary-storage): Makes the storage of an address fully symbolic
- [RPC Cheatcodes](/reference/cheatcodes/rpc): Access configured RPC endpoints and make JSON-RPC calls
- [File Cheatcodes](/reference/cheatcodes/fs): File system operations for reading, writing, and managing files
- [Forge Standard Library Reference](/reference/forge-std/overview)
- [Std Logs](/reference/forge-std/std-logs)
- [Std Assertions](/reference/forge-std/std-assertions)
- [fail](/reference/forge-std/fail)
- [assertTrue](/reference/forge-std/assertTrue)
- [assertFalse](/reference/forge-std/assertFalse)
- [assertEq](/reference/forge-std/assertEq)
- [assertEqDecimal](/reference/forge-std/assertEqDecimal)
- [assertNotEq](/reference/forge-std/assertNotEq)
- [assertNotEqDecimal](/reference/forge-std/assertNotEqDecimal)
- [assertLt](/reference/forge-std/assertLt)
- [assertLtDecimal](/reference/forge-std/assertLtDecimal)
- [assertGt](/reference/forge-std/assertGt)
- [assertGtDecimal](/reference/forge-std/assertGtDecimal)
- [assertLe](/reference/forge-std/assertLe)
- [assertLeDecimal](/reference/forge-std/assertLeDecimal)
- [assertGe](/reference/forge-std/assertGe)
- [assertGeDecimal](/reference/forge-std/assertGeDecimal)
- [assertApproxEqAbs](/reference/forge-std/assertApproxEqAbs)
- [assertApproxEqAbsDecimal](/reference/forge-std/assertApproxEqAbsDecimal)
- [assertApproxEqRel](/reference/forge-std/assertApproxEqRel)
- [assertApproxEqRelDecimal](/reference/forge-std/assertApproxEqRelDecimal)
- [Std Cheats](/reference/forge-std/std-cheats)
- [skip](/reference/forge-std/skip)
- [rewind](/reference/forge-std/rewind)
- [hoax](/reference/forge-std/hoax)
- [startHoax](/reference/forge-std/startHoax)
- [deal](/reference/forge-std/deal)
- [deployCode](/reference/forge-std/deployCode)
- [deployCodeTo](/reference/forge-std/deployCodeTo)
- [bound](/reference/forge-std/bound)
- [changePrank](/reference/forge-std/change-prank)
- [makeAddr](/reference/forge-std/make-addr)
- [makeAddrAndKey](/reference/forge-std/make-addr-and-key)
- [noGasMetering](/reference/forge-std/noGasMetering)
- [assumeNotPrecompile](/reference/forge-std/assume-no-precompiles)
- [assumePayable](/reference/forge-std/assume-payable)
- [StdConfig](/reference/forge-std/std-config)
- [Std Errors](/reference/forge-std/std-errors)
- [assertionError](/reference/forge-std/assertionError)
- [arithmeticError](/reference/forge-std/arithmeticError)
- [divisionError](/reference/forge-std/divisionError)
- [enumConversionError](/reference/forge-std/enumConversionError)
- [encodeStorageError](/reference/forge-std/encodeStorageError)
- [popError](/reference/forge-std/popError)
- [indexOOBError](/reference/forge-std/indexOOBError)
- [memOverflowError](/reference/forge-std/memOverflowError)
- [zeroVarError](/reference/forge-std/zeroVarError)
- [Std Storage](/reference/forge-std/std-storage)
- [target](/reference/forge-std/target)
- [sig](/reference/forge-std/sig)
- [with_key](/reference/forge-std/with_key)
- [depth](/reference/forge-std/depth)
- [enable_packed_slots](/reference/forge-std/enable_packed_slots)
- [checked_write](/reference/forge-std/checked_write)
- [find](/reference/forge-std/find)
- [read](/reference/forge-std/read)
- [Std Math](/reference/forge-std/std-math)
- [abs](/reference/forge-std/abs)
- [delta](/reference/forge-std/delta)
- [percentDelta](/reference/forge-std/percentDelta)
- [Script Utils](/reference/forge-std/script-utils)
- [computeCreateAddress](/reference/forge-std/compute-create-address)
- [deriveRememberKey](/reference/forge-std/derive-remember-key)
- [Console Logging](/reference/forge-std/console-log)
- [Config Overview](/config/reference/overview)
- [Project](/config/reference/project)
- [Solidity compiler](/config/reference/solidity-compiler)
- [Testing](/config/reference/testing)
- [In-line test configuration](/config/reference/inline-test-config)
- [Formatter](/config/reference/formatter)
- [Linter Configuration](/config/reference/linter)
- [Documentation Generator](/config/reference/doc-generator)
- [Etherscan](/config/reference/etherscan)
- [Foundry - Ethereum Development Framework](/index)
- [Benchmarks](/benchmarks)
- [Changelog](/changelog/)
- [cast index](/reference/cast/)
- [References](/reference/README)
- [Default foundry configuration](/config/reference/default-config)
- [Config Reference](/config/reference/README)
- [cast da-estimate](/reference/cast/da-estimate)
- [cast index](/reference/cast/index-cmd)
- [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)
- [Config](/reference/forge-std/config)
- [forge generate](/reference/forge/generate)
- [forge generate test](/reference/forge/generate/test)
-->

## Linting

Forge includes a built-in linter to catch common issues and enforce best practices.

### Run the linter

```bash
$ forge lint
```

The linter checks for:

* Incorrect shift operations
* Unchecked external calls
* Divide-before-multiply bugs
* Incorrect ERC721 interface signatures
* Incorrect ERC20 interface definitions
* Strict equality on externally-influenced values
* Unsafe typecasts
* Naming convention violations
* Use of tx.origin for authorization
* Return bomb risks from gas-limited calls
* Unused imports
* Gas optimizations

### Configuration

Configure linter rules in `foundry.toml`:

```toml [foundry.toml]
[lint]
severity = ["high", "med", "low"]
exclude_lints = ["mixed-case-function", "custom-errors"]
```

#### Severity levels

Control which lints run by severity:

```toml [foundry.toml]
[lint]
severity = ["high", "med"]  # Only high and medium severity
```

Valid severity levels: `high`, `med`, `low`, `info`, `gas`, `code-size`

#### Exclude specific lints

Disable specific lint rules globally:

```toml [foundry.toml]
[lint]
exclude_lints = ["mixed-case-variable", "asm-keccak256"]
```

### Ignoring files

Exclude files from linting:

```toml [foundry.toml]
[lint]
ignore = ["src/legacy/**", "test/**"]
```

### Inline suppression

Disable lints for specific lines or blocks using comment directives.

#### Disable on current line

```solidity
uint256 Mixed_Case = 1; // forge-lint: disable-line(mixed-case-variable)
```

#### Disable on next line

```solidity
// forge-lint: disable-next-line(custom-errors)
revert("Use custom errors instead");
```

#### Disable for next item

Disable lints for an entire function, struct, or contract:

```solidity
// forge-lint: disable-next-item(mixed-case-function)
function non_standard_name() public {
    // entire function is excluded from the lint
}
```

#### Disable a block

```solidity
// forge-lint: disable-start(asm-keccak256)
bytes32 hash1 = keccak256(abi.encodePacked(a, b));
bytes32 hash2 = keccak256(abi.encodePacked(c, d));
// forge-lint: disable-end(asm-keccak256)
```

#### Disable multiple lints

```solidity
// forge-lint: disable-next-line(custom-errors, mixed-case-variable)
```

#### Disable all lints

```solidity
// forge-lint: disable-next-line
```

Or explicitly:

```solidity
// forge-lint: disable-next-line(all)
```

### Disable linting on build

By default, `forge build` runs the linter. To disable for a single invocation, pass
`--no-lint` (alias `--skip-lint`):

```bash
forge build --no-lint
```

To disable persistently:

```toml [foundry.toml]
[lint]
lint_on_build = false
```

### CI integration

Add linting to your CI pipeline:

```yaml
- name: Run linter
  run: forge lint
```

See the [linter reference](/config/reference/linter) for all configuration options.

### Lint reference

Every lint emitted by `forge lint` has its own page describing what it flags, why it
matters, and how to fix it. Use the index below to jump to a specific lint, or use the
navigation on the right to browse by severity.

#### High severity

* [`arbitrary-send-erc20`](/forge/linting/arbitrary-send-erc20) — Flags `transferFrom` / `safeTransferFrom` calls whose `from` argument is not provably equal to `msg.sender` or `address(this)`.
* [`arbitrary-send-eth`](/forge/linting/arbitrary-send-eth) — Flags functions that send ETH (via `transfer` / `send` / `{value:}` calls / `selfdestruct` / known OZ + Solady helpers) to a caller-controlled destination without restricting who can call them.
* [`controlled-delegatecall`](/forge/linting/controlled-delegatecall) — Flags `delegatecall` targets that are not provably trusted.
* [`encode-packed-collision`](/forge/linting/encode-packed-collision) — Flags `abi.encodePacked()` calls with two or more dynamic-type arguments (`string`, `bytes`, `T[]`) that can produce hash collisions.
* [`erc20-unchecked-transfer`](/forge/linting/erc20-unchecked-transfer) — Flags calls to ERC20 `transfer` and `transferFrom` where the boolean return value is ignored.
* [`incorrect-shift`](/forge/linting/incorrect-shift) — Flags shift operations where a literal appears on the left and a non-literal on the right, which is almost always the wrong operand order.
* [`reentrancy-eth`](/forge/linting/reentrancy-eth) — Flags uncapped ETH-transferring low-level `call` operations when state read before the call is written after the call.
* [`rtlo`](/forge/linting/rtlo) — Flags the presence of Unicode bidirectional override characters in source code, which can be used to hide malicious behavior ("Trojan Source", [CVE-2021-42574](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-42574)).
* [`unchecked-call`](/forge/linting/unchecked-call) — Flags low-level calls (`call`, `delegatecall`, `staticcall`, `callcode`) whose `success` return value is ignored.
* [`unprotected-initializer`](/forge/linting/unprotected-initializer) — Flags upgradeable initializers that can be called directly on an implementation contract with a destructive entry point.

#### Medium severity

* [`assert-state-change`](/forge/linting/assert-state-change) — Flags expressions inside `assert()` that modify contract state.
* [`boolean-cst`](/forge/linting/boolean-cst) — Flags expressions where a boolean constant (`true`/`false`) is used as a control-flow condition or operand of a boolean operator, which usually indicates dead code or a leftover debug toggle.
* [`divide-before-multiply`](/forge/linting/divide-before-multiply) — Flags arithmetic expressions where division is performed before multiplication, which can cause unintended precision loss in integer arithmetic.
* [`incorrect-erc20-interface`](/forge/linting/incorrect-erc20-interface) — Flags interfaces or contracts whose function signatures match an ERC20 method by name and parameters but use the wrong return type.
* [`incorrect-erc721-interface`](/forge/linting/incorrect-erc721-interface) — Flags interfaces or contracts whose function signatures match an ERC721 (or ERC165) method by name and parameters but use the wrong return type.
* [`locked-ether`](/forge/linting/locked-ether) — Flags contracts that can receive Ether (via `payable` functions, `receive()`, or a payable `fallback()`) but expose no code path that can send Ether out, permanently trapping user funds.
* [`low-level-calls`](/forge/linting/low-level-calls) — Flags direct use of Solidity low-level calls (`call`, `delegatecall`, and `staticcall`).
* [`reentrancy-no-eth`](/forge/linting/reentrancy-no-eth) — Flags non-ETH external calls when state read before the call is written after the call.
* [`tx-origin`](/forge/linting/tx-origin) — Flags use of `tx.origin` inside authorization-like predicates, which can be exploited by a malicious contract acting on behalf of a legitimate owner.
* [`type-based-tautology`](/forge/linting/type-based-tautology) — Flags comparison expressions that are always true or always false due to the numeric range of the variable's type.
* [`uninitialized-local`](/forge/linting/uninitialized-local) — Flags local variables that are declared without an initializer and read before any explicit assignment, where the silent zero-default is almost certainly unintentional.
* [`uninitialized-state`](/forge/linting/uninitialized-state) — Flags state variables that are read in a contract's inheritance chain but never assigned, leaving them silently equal to their type's zero default.
* [`unsafe-typecast`](/forge/linting/unsafe-typecast) — Flags explicit numeric typecasts that can silently truncate or alter the value.
* [`unused-return`](/forge/linting/unused-return) — Flags external calls whose return value is silently discarded.
* [`weak-prng`](/forge/linting/weak-prng) — Flags randomness-like expressions that directly derive entropy from predictable on-chain values.

#### Low severity

* [`block-timestamp`](/forge/linting/block-timestamp) — Flags use of `block.timestamp` as an operand of a comparison, where its value can be slightly manipulated by the block proposer.
* [`calls-loop`](/forge/linting/calls-loop) — Flags external calls made from inside loops, which can cause denial-of-service if a callee reverts or exhausts gas.
* [`delegatecall-loop`](/forge/linting/delegatecall-loop) — Flags `delegatecall` operations inside loops in externally callable payable functions.
* [`missing-events-access-control`](/forge/linting/missing-events-access-control) — Flags access-controlled updates to state used for authorization when the update function does not emit an event.
* [`missing-events-arithmetic`](/forge/linting/missing-events-arithmetic) — Flags access-controlled updates to integer state used in arithmetic when the update path does not emit an event.
* [`missing-zero-check`](/forge/linting/missing-zero-check) — Flags entry-point functions and constructors where an `address` parameter flows into a state write or value transfer without a zero-address guard.
* [`msg-value-loop`](/forge/linting/msg-value-loop) — Flags `msg.value` reads inside loops reachable from externally callable payable functions.
* [`reentrancy-events`](/forge/linting/reentrancy-events) — Flags `emit` statements reachable after an external call, where a reentrant callee can reorder or fabricate logs that off-chain consumers rely on.
* [`return-bomb`](/forge/linting/return-bomb) — Flags external calls that set an explicit gas limit while copying unbounded dynamic returndata.

#### Informational

* [`boolean-equal`](/forge/linting/boolean-equal) — Flags expressions of the form `x == true`, `x == false`, `x != true`, `x != false`, which can be simplified.
* [`event-fields`](/forge/linting/event-fields) — Flags event parameters of type `address`, `address payable`, or id-like `uint256`/`bytes32` that are not declared `indexed`.
* [`inline-assembly`](/forge/linting/inline-assembly) — Flags every `assembly { ... }` block; inline assembly bypasses Solidity safety features and should be reviewed deliberately.
* [`interface-file-naming`](/forge/linting/interface-file-naming) — Flags Solidity files whose only top-level declaration is an interface but whose filename is not prefixed with `I`.
* [`interface-naming`](/forge/linting/interface-naming) — Flags `interface` declarations whose names are not prefixed with `I`.
* [`missing-inheritance`](/forge/linting/missing-inheritance) — Flags contracts that implement every external function of an interface but do not explicitly inherit from it.
* [`mixed-case-function`](/forge/linting/mixed-case-function) — Flags function names that do not follow `mixedCase`.
* [`mixed-case-variable`](/forge/linting/mixed-case-variable) — Flags mutable variable names (locals, parameters, mutable state) that do not follow `mixedCase`.
* [`multi-contract-file`](/forge/linting/multi-contract-file) — Flags source files that declare more than one top-level contract, interface, or library.
* [`named-struct-fields`](/forge/linting/named-struct-fields) — Flags struct construction expressions that pass fields positionally instead of by name.
* [`pascal-case-struct`](/forge/linting/pascal-case-struct) — Flags struct definitions whose names do not follow `PascalCase`.
* [`pragma-inconsistent`](/forge/linting/pragma-inconsistent) — Flags projects whose source files declare incompatible or differently-shaped Solidity version pragmas.
* [`redundant-base-constructor-call`](/forge/linting/redundant-base-constructor-call) — Flags explicit empty base-constructor arguments (e.g. `is A()` or `constructor() A() {}`) when the base contract requires no arguments.
* [`screaming-snake-case-const`](/forge/linting/screaming-snake-case-const) — Flags `constant` state variables whose names do not follow `SCREAMING_SNAKE_CASE`.
* [`screaming-snake-case-immutable`](/forge/linting/screaming-snake-case-immutable) — Flags `immutable` state variables whose names do not follow `SCREAMING_SNAKE_CASE`.
* [`too-many-digits`](/forge/linting/too-many-digits) — Flags numeric literals containing five or more consecutive zeros, which are easy to misread.
* [`unaliased-plain-import`](/forge/linting/unaliased-plain-import) — Flags `import "path";` statements that pull in every top-level symbol from another file without an alias.
* [`unsafe-cheatcode`](/forge/linting/unsafe-cheatcode) — Flags use of Foundry cheatcodes that perform dangerous side effects (filesystem access, network activity, environment variable reads, etc.) so they cannot slip into production code unnoticed.
* [`unused-import`](/forge/linting/unused-import) — Flags imported symbols (or whole import statements) whose imported names are not referenced anywhere in the source unit.

#### Gas optimization

* [`asm-keccak256`](/forge/linting/asm-keccak256) — Flags calls to the high-level `keccak256(...)` builtin that can be cheaply rewritten with inline assembly.
* [`cache-array-length`](/forge/linting/cache-array-length) — Flags `for` loop conditions that read a dynamic array or `bytes` value's `.length` on every iteration instead of comparing against a cached local length.
* [`costly-loop`](/forge/linting/costly-loop) — Flags storage variable writes inside loops, where each SSTORE multiplies gas cost by the number of iterations.
* [`could-be-constant`](/forge/linting/could-be-constant) — Flags state variables with a compile-time-constant inline initializer that are never written — making them eligible to be declared `constant`.
* [`could-be-immutable`](/forge/linting/could-be-immutable) — Flags state variables that are assigned only in the constructor and never written to afterward — making them eligible to be declared `immutable`.
* [`custom-errors`](/forge/linting/custom-errors) — Flags `require(cond, "message")`, `revert("message")`, and `revert()` calls; suggests replacing them with a `revert CustomError(...)`.
* [`external-function`](/forge/linting/external-function) — Flags `public` functions that are never called internally and have a reference-type `memory` parameter; switching them to `external` (with `calldata` parameters) avoids an extra calldata-to-memory copy.
* [`unused-state-variables`](/forge/linting/unused-state-variables) — Flags state variables that are declared but never read or written anywhere in the contract or its descendants.
* [`var-read-using-this`](/forge/linting/var-read-using-this) — Flags `this.X(...)` calls that read the contract's own state through its external interface; the unnecessary `STATICCALL` can be avoided by accessing the variable directly.
* [`write-after-write`](/forge/linting/write-after-write) — Flags storage variables written consecutively without the first value being read; only the final write is needed.

#### Code size

* [`unwrapped-modifier-logic`](/forge/linting/unwrapped-modifier-logic) — Flags modifiers whose body contains non-trivial logic that should be moved into a helper function to reduce contract code size.
