介绍
入门
安装
Foundry 的第一步
项目
创建新项目
处理现有项目
克隆链上已验证的合约
依赖项
Soldeer
项目布局
Forge 概述
Forge 概述
测试
❱
编写测试
Cheatcodes
Forge 标准库概述
理解 Traces
Fork 测试
重放失败
高级测试
❱
模糊测试
不变性测试
差异测试
部署和验证
Gas 跟踪
❱
Gas 报告
Gas 函数快照
Gas 部分快照
调试器
Cast 概述
Cast 概述
Anvil 概述
Anvil 概述
Chisel 概述
Chisel 概述
配置
使用 foundry.toml 配置
持续集成
与 VSCode 集成
Shell 自动补全
静态分析器
与 Hardhat 集成
Vyper 支持
教程
最佳实践
使用 Solmate 创建 NFT
Docker 和 Foundry
测试 EIP-712 签名
Solidity 脚本编写
使用 CREATE2 进行确定性部署
使用 Cast 和 Anvil 分叉主网
学习 Foundry 视频
附录
常见问题
帮助我们改进 Foundry
参考资料
❱
CLI 参考
❱
forge
❱
forge bind
forge bind-json
forge build
forge cache
❱
forge cache clean
forge cache ls
forge clean
forge clone
forge compiler
❱
forge compiler resolve
forge completions
forge config
forge coverage
forge create
forge debug
forge doc
forge eip712
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 selectors find
forge snapshot
forge soldeer
❱
forge soldeer init
forge soldeer install
forge soldeer update
forge soldeer login
forge soldeer push
forge soldeer uninstall
forge soldeer version
forge test
forge tree
forge update
forge verify-bytecode
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 codehash
cast codesize
cast completions
cast compute-address
cast concat-hex
cast create2
cast decode-eof
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-message
cast hash-zero
cast implementation
cast index
cast index-erc7201
cast interface
cast keccak
cast logs
cast lookup-address
cast max-int
cast max-uint
cast min-int
cast mktx
❱
cast mktx --create
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 selectors
cast send
❱
cast send --create
cast shl
cast shr
cast sig
cast sig-event
cast storage
cast storage-root
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-utf8
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 sign-auth
cast wallet verify
cast wallet import
cast wallet list
cast wallet private-key
cast wallet decrypt-keystore
anvil
❱
anvil completions
anvil generate-fig-spec
chisel
❱
chisel list
chisel load
chisel view
chisel clear-cache
chisel eval
forge 命令
❱
通用命令
❱
forge
forge help
forge completions
项目命令
❱
forge init
forge clone
forge install
forge update
forge remove
forge config
forge remappings
forge tree
forge geiger
构建命令
❱
forge build
forge clean
forge inspect
测试命令
❱
forge test
forge snapshot
forge coverage
部署命令
❱
forge create
forge verify-contract
forge verify-check
forge flatten
实用命令
❱
forge debug
forge bind
forge cache
forge cache clean
forge cache ls
forge script
forge upload-selectors
forge doc
cast 命令
❱
通用命令
❱
cast
cast help
cast completions
链命令
❱
cast chain-id
cast chain
cast client
交易命令
❱
cast publish
cast receipt
cast send
cast mktx
cast call
cast rpc
cast tx
cast run
cast estimate
cast access-list
cast logs
区块命令
❱
cast find-block
cast gas-price
cast block-number
cast basefee
cast block
cast age
账户命令
❱
cast balance
cast storage
cast proof
cast nonce
cast code
cast codesize
ENS 命令
❱
cast lookup-address
cast resolve-name
cast namehash
Etherscan 命令
❱
cast etherscan-source
ABI 命令
❱
cast abi-decode
cast abi-encode
cast 4byte
cast 4byte-decode
cast 4byte-event
cast calldata
cast calldata-decode
cast pretty-calldata
cast selectors
cast upload-signature
转换命令
❱
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
实用命令
❱
cast address-zero
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
钱包命令
❱
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 参考
chisel 参考
配置参考
❱
概述
项目
Solidity 编译器
测试
内联配置测试
格式化程序
文档生成器
Etherscan
辅助代码参考
❱
环境
❱
warp
roll
fee
getBlockTimestamp
getBlockNumber
difficulty
prevrandao
chainId
store
load
etch
deal
prank
startPrank
stopPrank
readCallers
record
accesses
recordLogs
getRecordedLogs
setNonce
getNonce
mockCall
mockCallRevert
mockFunction
clearMockedCalls
coinbase
broadcast
startBroadcast
stopBroadcast
pauseGasMetering
resetGasMetering
resumeGasMetering
txGasPrice
startStateDiffRecording
stopAndReturnStateDiff
snapshotState
snapshotGas
断言
❱
expectRevert
expectEmit
expectCall
模糊测试
❱
assume
assumeNoRevert
分叉
❱
createFork
selectFork
createSelectFork
activeFork
rollFork
makePersistent
revokePersistent
isPersistent
allowCheatcodes
transact
外部
❱
ffi
prompt
projectRoot
getCode
getDeployedCode
sleep
unixTime
setEnv
envOr
envBool
envUint
envInt
envAddress
envBytes32
envString
envBytes
keyExists
keyExistsJson
keyExistsToml
parseJson
parseToml
parseJsonKeys
parseTomlKeys
serializeJson
writeJson
writeToml
实用程序
❱
addr
sign
skip
label
getLabel
deriveKey
parseBytes
parseAddress
parseUint
parseInt
parseBytes32
parseBool
rememberKey
toString
breakpoint
createWallet
copyStorage
setArbitraryStorage
RPC
文件
Forge 标准库参考
❱
日志
断言
❱
fail
assertTrue
assertFalse
assertEq
assertEqDecimal
assertNotEq
assertNotEqDecimal
assertLt
assertLtDecimal
assertGt
assertGtDecimal
assertLe
assertLeDecimal
assertGe
assertGeDecimal
assertApproxEqAbs
assertApproxEqAbsDecimal
assertApproxEqRel
assertApproxEqRelDecimal
作弊码
❱
skip
rewind
hoax
startHoax
deal
deployCode
deployCodeTo
bound
changePrank
makeAddr
makeAddrAndKey
noGasMetering
assumeNoPrecompiles
assumePayable
错误
❱
assertionError
arithmeticError
divisionError
enumConversionError
encodeStorageError
popError
indexOOBError
memOverflowError
zeroVarError
存储
❱
target
sig
with_key
depth
checked_write
find
read
数学
❱
abs
delta
percentDelta
脚本工具
❱
computeCreateAddress
deriveRememberKey
控制台日志
DSTest Reference
其它
❱
结构体编码
Light
Rust
Coal
Navy
Ayu
Foundry 中文文档 | 登链社区
ABI 命令
cast abi-encode
cast 4byte
cast 4byte-decode
cast 4byte-event
cast calldata
cast pretty-calldata
cast --abi-decode
cast --calldata-decode
cast selectors
cast upload-signature