Foundry Overview
Foundry is a smart contract development toolchain.
Foundry manages your dependencies, compiles your project, runs tests, deploys, and lets you interact with the chain from the command-line and via Solidity scripts.
Navigating the Documentation
Getting Started
Get up and running with Foundry by installing the toolkit and get started with the basics of each tool.
Guides
Comprehensive tutorials and best practices for building robust smart contracts and development workflows with Foundry.
-
Best Practices
- Writing Contracts - Guidelines for clean, secure smart contract development
- Writing Tests - Effective testing strategies and patterns
- Writing Scripts - Deployment and automation script best practices
- Security - Security considerations and vulnerability prevention
- Key Management - Safe handling of private keys and secrets
- Commenting - Documentation and code commenting standards
- Scripting with Solidity - Advanced deployment and automation techniques
- Deterministic deployments using CREATE2 - Predictable contract addresses
- Forking Mainnet with Cast and Anvil - Test against live chain state
- Running Foundry inside of Docker - Containerized development environments
Project Setup
Learn how to organize your projects with the forge project setup guides for scaling smart contract codebases.
Forge
Master the core smart contract development tool with the Forge overview, covering building, testing, deploying, and verifying contracts.
Cast
Learn to interact with blockchain networks from the command line using Cast for contract calls, transactions, and chain data retrieval.
Anvil
Set up local development networks with Anvil, Foundry's fast Ethereum-compatible node with forking capabilities.
Chisel
Explore Solidity interactively with Chisel, the integrated REPL for rapid prototyping and debugging.
Configuration
Customize your Foundry setup and integrate with other tools for an optimized development workflow.
- Config Overview with
foundry.toml
- Project configuration and settings - Continuous Integration - CI/CD pipeline integration
- Integrating with VSCode - Editor setup and extensions
- Shell Autocompletion - Command-line productivity enhancements
- Static Analyzers - Code analysis tool integration
- Integrating with Hardhat - Cross-framework compatibility
- Vyper support - Alternative smart contract language support
- Forge Lint - Code style and quality enforcement
Contributing
Help improve Foundry by contributing - see the contribution guidelines to learn more.
Reference
Complete command references, configuration options, and API documentation for all Foundry tools.
- FAQ - Frequently asked questions and troubleshooting
-
Command References
- forge Commands - Complete forge CLI reference
- cast Commands - Complete cast CLI reference
- anvil Commands - Complete anvil CLI reference
- chisel Commands - Complete chisel CLI reference
-
Configuration & APIs
- Config Reference - All configuration options
- Cheatcodes Reference - Testing utilities and helpers
- Forge Standard Library Reference - Standard library documentation
- DSTest Reference - Legacy testing framework reference