Introduction
Getting Started
Installation
First Steps with Foundry
Projects
Creating a New Project
Working on an Existing Project
Dependencies
Project Layout
Forge Overview
Overview of Forge
Tests
❱
Writing Tests
Cheatcodes
Forge Standard Library Overview
Understanding Traces
Fork Testing
Advanced Testing
❱
Fuzz Testing
Invariant Testing
Differential Testing
Deploying and Verifying
Gas Tracking
❱
Gas Reports
Gas Snapshots
Debugger
Cast Overview
Overview of Cast
Anvil Overview
Overview of Anvil
Chisel Overview
Overview of Chisel
Configuration
Configuring with foundry.toml
Continuous Integration
Integrating with VSCode
Shell Autocompletion
Static Analyzers
Integrating with Hardhat
Tutorials
Best Practices
Creating an NFT with Solmate
Docker and Foundry
Testing EIP-712 Signatures
Solidity Scripting
Deterministic deployment using CREATE2
Forking Mainnet with Cast and Anvil
Learning Foundry Videos
Appendix
FAQ
Help us improve Foundry
References
❱
CLI Reference
❱
forge
❱
forge bind
forge build
forge cache
❱
forge cache clean
forge cache ls
forge clean
forge completions
forge config
forge coverage
forge create
forge debug
forge doc
forge flatten
forge fmt
forge geiger
forge generate
❱
forge generate test
forge generate-fig-spec
forge init
forge inspect
forge install
forge remappings
forge remove
forge script
forge selectors
❱
forge selectors collision
forge selectors upload
forge selectors list
forge snapshot
forge test
forge tree
forge update
forge verify-check
forge verify-contract
cast
❱
cast 4byte
cast 4byte-decode
cast 4byte-event
cast abi-decode
cast abi-encode
cast access-list
cast address-zero
cast admin
cast age
cast balance
cast base-fee
cast bind
cast block
cast block-number
cast call
❱
cast call --create
cast calldata
cast calldata-decode
cast chain
cast chain-id
cast client
cast code
cast codesize
cast completions
cast compute-address
cast concat-hex
cast create2
cast decode-transaction
cast disassemble
cast estimate
❱
cast estimate --create
cast etherscan-source
cast find-block
cast format-bytes32-string
cast from-bin
cast from-fixed-point
cast from-rlp
cast from-utf8
cast from-wei
cast gas-price
cast generate-fig-spec
cast hash-zero
cast implementation
cast index
cast interface
cast keccak
cast logs
cast lookup-address
cast max-int
cast max-uint
cast min-int
cast namehash
cast nonce
cast parse-bytes32-address
cast parse-bytes32-string
cast pretty-calldata
cast proof
cast publish
cast receipt
cast resolve-name
cast rpc
cast run
cast send
❱
cast send --create
cast shl
cast shr
cast sig
cast sig-event
cast storage
cast to-ascii
cast to-base
cast to-bytes32
cast to-check-sum-address
cast to-dec
cast to-fixed-point
cast to-hex
cast to-hexdata
cast to-int256
cast to-rlp
cast to-uint256
cast to-unit
cast to-wei
cast tx
cast upload-signature
cast wallet
❱
cast wallet new
cast wallet new-mnemonic
cast wallet vanity
cast wallet address
cast wallet sign
cast wallet verify
cast wallet import
cast wallet list
anvil
❱
anvil completions
anvil generate-fig-spec
chisel
❱
chisel list
chisel load
chisel view
chisel clear-cache
forge Commands
❱
General Commands
❱
forge
forge help
forge completions
Project Commands
❱
forge init
forge install
forge update
forge remove
forge config
forge remappings
forge tree
forge geiger
Build Commands
❱
forge build
forge clean
forge inspect
Test Commands
❱
forge test
forge snapshot
forge coverage
Deploy Commands
❱
forge create
forge verify-contract
forge verify-check
forge flatten
Utility Commands
❱
forge debug
forge bind
forge cache
forge cache clean
forge cache ls
forge script
forge upload-selectors
forge doc
cast Commands
❱
General Commands
❱
cast
cast help
cast completions
Chain Commands
❱
cast chain-id
cast chain
cast client
Transaction Commands
❱
cast publish
cast receipt
cast send
cast call
cast rpc
cast tx
cast run
cast estimate
cast access-list
cast logs
Block Commands
❱
cast find-block
cast gas-price
cast block-number
cast basefee
cast block
cast age
Account Commands
❱
cast balance
cast storage
cast proof
cast nonce
cast code
cast codesize
ENS Commands
❱
cast lookup-address
cast resolve-name
cast namehash
Etherscan Commands
❱
cast etherscan-source
ABI Commands
❱
cast abi-decode
cast abi-encode
cast 4byte
cast 4byte-decode
cast 4byte-event
cast calldata
cast calldata-decode
cast pretty-calldata
cast upload-signature
Conversion Commands
❱
cast format-bytes32-string
cast from-bin
cast from-fixed-point
cast from-rlp
cast from-utf8
cast from-wei
cast parse-bytes32-address
cast parse-bytes32-string
cast to-ascii
cast to-base
cast to-bytes32
cast to-dec
cast to-fixed-point
cast to-hex
cast to-hexdata
cast to-int256
cast to-rlp
cast to-uint256
cast to-unit
cast to-wei
cast shl
cast shr
Utility Commands
❱
cast sig
cast sig-event
cast keccak
cast compute-address
cast create2
cast interface
cast index
cast concat-hex
cast max-int
cast min-int
cast max-uint
cast to-check-sum-address
Wallet Commands
❱
cast wallet
cast wallet new
cast wallet new-mnemonic
cast wallet address
cast wallet sign
cast wallet vanity
cast wallet verify
cast wallet import
cast wallet list
anvil Reference
chisel Reference
Config Reference
❱
Overview
Project
Solidity Compiler
Testing
In-line Configuration Testing
Formatter
Documentation Generator
Etherscan
Cheatcodes Reference
❱
Environment
❱
warp
roll
fee
getBlockTimestamp
getBlockNumber
difficulty
prevrandao
chainId
store
load
etch
deal
prank
startPrank
stopPrank
readCallers
record
accesses
recordLogs
getRecordedLogs
setNonce
getNonce
mockCall
mockCallRevert
clearMockedCalls
coinbase
broadcast
startBroadcast
stopBroadcast
pauseGasMetering
resumeGasMetering
txGasPrice
startStateDiffRecording
stopAndReturnStateDiff
Assertions
❱
expectRevert
expectEmit
expectCall
Fuzzer
❱
assume
Forking
❱
createFork
selectFork
createSelectFork
activeFork
rollFork
makePersistent
revokePersistent
isPersistent
allowCheatcodes
transact
External
❱
ffi
projectRoot
getCode
getDeployedCode
sleep
unixTime
setEnv
envOr
envBool
envUint
envInt
envAddress
envBytes32
envString
envBytes
parseJson
keyExists
parseJsonKeys
serializeJson
writeJson
Utilities
❱
addr
sign
skip
label
getLabel
deriveKey
parseBytes
parseAddress
parseUint
parseInt
parseBytes32
parseBool
rememberKey
toString
breakpoint
createWallet
Snapshots
RPC
Files
Forge Standard Library Reference
❱
Std Logs
Std Assertions
❱
fail
assertFalse
assertEq
assertApproxEqAbs
assertApproxEqRel
Std Cheats
❱
skip
rewind
hoax
startHoax
deal
deployCode
deployCodeTo
bound
changePrank
makeAddr
makeAddrAndKey
noGasMetering
assumeNoPrecompiles
assumePayable
Std Errors
❱
assertionError
arithmeticError
divisionError
enumConversionError
encodeStorageError
popError
indexOOBError
memOverflowError
zeroVarError
Std Storage
❱
target
sig
with_key
depth
checked_write
find
read
Std Math
❱
abs
delta
percentDelta
Script Utils
❱
computeCreateAddress
deriveRememberKey
Console Logging
DSTest Reference
Miscellaneous
❱
Struct encoding
Precompile Registry
Light
Rust
Coal
Navy
Ayu
Foundry Book
英文
中文
Project Commands
forge init
forge install
forge update
forge remove
forge config
forge remappings
forge tree
forge geiger