1. Introduction
  2. Getting Started
  3. Installation
  4. First Steps with Foundry
  5. Projects
  6. Creating a New Project
  7. Working on an Existing Project
  8. Dependencies
  9. Project Layout
  10. Forge Overview
  11. Overview of Forge
  12. Tests
    ❱
    1. Writing Tests
    2. Cheatcodes
    3. Forge Standard Library Overview
    4. Understanding Traces
    5. Fork Testing
  13. Advanced Testing
    ❱
    1. Fuzz Testing
    2. Differential Testing
  14. Deploying and Verifying
  15. Gas Tracking
    ❱
    1. Gas Reports
    2. Gas Snapshots
  16. Debugger
  17. Cast Overview
  18. Overview of Cast
  19. Anvil Overview
  20. Overview of Anvil
  21. Configuration
  22. Configuring with foundry.toml
  23. Continuous Integration
  24. Integrating with VSCode
  25. Shell Autocompletion
  26. Static Analyzers
  27. Integrating with Hardhat
  28. Tutorials
  29. Creating an NFT with Solmate
  30. Docker and Foundry
  31. Testing EIP-712 Signatures
  32. Solidity Scripting
  33. Forking Mainnet with Cast and Anvil
  34. Appendix
  35. FAQ
  36. References
    ❱
    1. forge Commands
      ❱
      1. General Commands
        ❱
        1. forge
        2. forge help
        3. forge completions
      2. Project Commands
        ❱
        1. forge init
        2. forge install
        3. forge update
        4. forge remove
        5. forge config
        6. forge remappings
        7. forge tree
      3. Build Commands
        ❱
        1. forge build
        2. forge clean
        3. forge inspect
      4. Test Commands
        ❱
        1. forge test
        2. forge snapshot
      5. Deploy Commands
        ❱
        1. forge create
        2. forge verify-contract
        3. forge verify-check
        4. forge flatten
      6. Utility Commands
        ❱
        1. forge debug
        2. forge bind
        3. forge cache
        4. forge cache clean
        5. forge cache ls
        6. forge script
        7. forge upload-selectors
    2. cast Commands
      ❱
      1. General Commands
        ❱
        1. cast
        2. cast help
        3. cast completions
      2. Chain Commands
        ❱
        1. cast chain-id
        2. cast chain
        3. cast client
      3. Transaction Commands
        ❱
        1. cast publish
        2. cast receipt
        3. cast send
        4. cast call
        5. cast tx
        6. cast run
        7. cast estimate
        8. cast access-list
      4. Block Commands
        ❱
        1. cast find-block
        2. cast gas-price
        3. cast block-number
        4. cast basefee
        5. cast block
        6. cast age
      5. Account Commands
        ❱
        1. cast balance
        2. cast storage
        3. cast proof
        4. cast nonce
        5. cast code
      6. ENS Commands
        ❱
        1. cast lookup-address
        2. cast resolve-name
        3. cast namehash
      7. Etherscan Commands
        ❱
        1. cast etherscan-source
      8. ABI Commands
        ❱
        1. cast abi-encode
        2. cast 4byte
        3. cast 4byte-decode
        4. cast 4byte-event
        5. cast calldata
        6. cast pretty-calldata
        7. cast --abi-decode
        8. cast --calldata-decode
        9. cast upload-signature
      9. Conversion Commands
        ❱
        1. cast --format-bytes32-string
        2. cast --from-bin
        3. cast --from-fix
        4. cast --from-rlp
        5. cast --from-utf8
        6. cast --parse-bytes32-string
        7. cast --to-ascii
        8. cast --to-bytes32
        9. cast --to-dec
        10. cast --to-fix
        11. cast --to-hex
        12. cast --to-hexdata
        13. cast --to-int256
        14. cast --to-rlp
        15. cast --to-uint256
        16. cast --to-unit
        17. cast --to-wei
      10. Utility Commands
        ❱
        1. cast sig
        2. cast keccak
        3. cast compute-address
        4. cast interface
        5. cast index
        6. cast --concat-hex
        7. cast --max-int
        8. cast --min-int
        9. cast --max-uint
        10. cast --to-checksum-address
      11. Wallet Commands
        ❱
        1. cast wallet
        2. cast wallet new
        3. cast wallet address
        4. cast wallet sign
        5. cast wallet vanity
        6. cast wallet verify
    3. anvil Reference
    4. Config Reference
    5. Cheatcodes Reference
      ❱
      1. Environment
        ❱
        1. warp
        2. roll
        3. fee
        4. difficulty
        5. chainId
        6. store
        7. load
        8. etch
        9. deal
        10. prank
        11. startPrank
        12. stopPrank
        13. record
        14. accesses
        15. recordLogs
        16. getRecordedLogs
        17. setNonce
        18. getNonce
        19. mockCall
        20. clearMockedCalls
        21. coinbase
        22. broadcast
        23. startBroadcast
        24. stopBroadcast
      2. Assertions
        ❱
        1. expectRevert
        2. expectEmit
        3. expectCall
      3. Fuzzer
        ❱
        1. assume
      4. Forking
        ❱
        1. createFork
        2. selectFork
        3. createSelectFork
        4. activeFork
        5. rollFork
        6. makePersistent
        7. revokePersistent
        8. isPersistent
      5. External
        ❱
        1. ffi
        2. projectRoot
        3. getCode
        4. setEnv
        5. envBool
        6. envUint
        7. envInt
        8. envAddress
        9. envBytes32
        10. envString
        11. envBytes
      6. Utilities
        ❱
        1. addr
        2. sign
        3. label
        4. deriveKey
        5. toString
      7. Snapshots
      8. RPC
    6. Forge Standard Library Reference
      ❱
      1. Std Logs
      2. Std Assertions
        ❱
        1. fail
        2. assertFalse
        3. assertEq
        4. assertApproxEqAbs
        5. assertApproxEqRel
      3. Std Cheats
        ❱
        1. skip
        2. rewind
        3. hoax
        4. startHoax
        5. deal
        6. deployCode
        7. bound
        8. changePrank
        9. makeAddr
        10. makeAddrAndKey
      4. Std Errors
        ❱
        1. assertionError
        2. arithmeticError
        3. divisionError
        4. enumConversionError
        5. encodeStorageError
        6. popError
        7. indexOOBError
        8. memOverflowError
        9. zeroVarError
      5. Std Storage
        ❱
        1. target
        2. sig
        3. with_key
        4. depth
        5. checked_write
        6. find
        7. read
      6. Std Math
        ❱
        1. abs
        2. delta
        3. percentDelta
      7. Console Logging
    7. DSTest Reference
  37. Miscellaneous
    ❱
    1. Struct encoding

Foundry Book

cast Commands

  • General Commands
  • Chain Commands
  • Transaction Commands
  • Block Commands
  • Account Commands
  • ENS Commands
  • Etherscan Commands
  • ABI Commands
  • Conversion Commands
  • Utility Commands
  • Wallet Commands