forge - Build, test, fuzz, debug and deploy Solidity contracts.
forge
[options] command [args]
forge
[options] --version
forge
[options] --help
This program is a set of tools to build, test, fuzz, debug and deploy Solidity smart contracts.
forge help
Display help information about Forge.
forge completions
Generate shell autocompletions for Forge.
forge init
Create a new Forge project.
forge clone
Clone a on-chain verified contract as a Forge project.
forge install
Install one or multiple dependencies.
forge update
Update one or multiple dependencies.
forge remove
Remove one or multiple dependencies.
forge config
Display the current config.
forge remappings
Get the automatically inferred remappings for this project.
forge tree
Display a tree visualization of the project's dependency graph.
forge geiger Detects usage of unsafe cheat codes in a foundry project and its dependencies.
forge build
Build the project's smart contracts.
forge clean
Remove the build artifacts and cache directories.
forge inspect
Get specialized information about a smart contract.
forge test
Run the project's tests.
forge snapshot
Create a snapshot of each test's gas usage.
forge coverage
Generate coverage reports.
forge create
Deploy a smart contract.
forge verify-contract
Verify smart contracts on Etherscan.
forge verify-check
Check verification status on Etherscan.
forge flatten
Flatten a source file and all of its imports into one file.
forge debug
Debug a single smart contract as a script.
forge bind
Generate Rust bindings for smart contracts.
forge cache
Manage the Foundry cache.
forge cache clean
Cleans cached data from ~/.foundry
.
forge cache ls
Shows cached data from ~/.foundry
.
forge script
Run a smart contract as a script, building transactions that can be sent onchain.
forge upload-selectors
Uploads abi of given contract to https://openchain.xyz/signatures function selector database.
forge doc
Generate documentation for Solidity source files.
-V
--version
Print version info and exit.
{{#include common-options.md}}
~/.foundry/
Default location for Foundry's "home" directory where it stores various files.
~/.foundry/bin/
Binaries installed using foundryup
will be located here.
~/.foundry/cache/
Forge's cache directory, where it stores cached block data and more.
~/.foundry/foundry.toml
The global Foundry config.
~/.svm
The location of the Forge-managed solc binaries.
-
Create a new Forge project:
forge init hello_foundry
-
Build a project:
forge build
-
Run a project's tests:
forge test
See https://github.com/foundry-rs/foundry/issues for issues.