Foundry is a blazing fast, portable, and modular toolkit for Ethereum application development written in Rust.
Foundry consists of several key components, each designed to streamline different aspects of Ethereum development:
For detailed guides and usage instructions, refer to the following resources:
To install Foundry, follow the installation guide in the Foundry Book. If you encounter any issues, refer to the FAQ.
~/.svm
)DsTest
's emitted logsconsole.sol
contractFoundry's Forge is optimized for speed, both in compiling and testing. Benchmark comparisons demonstrate significant speed improvements over similar tools:
Testing Benchmarks
Project | Forge | DappTools | Speedup |
---|---|---|---|
[transmissions11/solmate][solmate] | 2.8s | 6m34s | 140x |
[reflexer-labs/geb][geb] | 0.4s | 23s | 57.5x |
[Rari-Capital/vaults][vaults] | 0.28s | 6.5s | 23x |
Note: Compilation was skipped in these benchmarks.
Compilation Benchmarks
Compilation benchmarks
Takeaway: Forge compilation is consistently faster by a factor of 1.7-11.3x, depending on caching.
Cast is a versatile command-line tool for interacting with Ethereum applications. It provides functionalities for sending transactions, interacting with smart contracts, and retrieving chain data.
foundry.toml
Foundry is designed to be highly configurable. Configuration is managed through the foundry.toml
file, which can be located in the root of your project or any parent directory.
To initialize a basic foundry.toml
file:
To view the current configuration:
For additional setup and configurations, refer to the Foundry Book.
You can reuse your .dapprc
environment variables by running: