Foundry Seminar
join the dev telegram: https://t.me/foundry_rs join the support telegram: https://t.me/foundry_support
Agenda
- wtf is foundry and y it's dope
- quick setup
- writing tests
- fuzzing in foundry & why it's valuable
- using traces
- using the debugger
- future of foundry
- Q&A
Intro
wtf is foundry
"Foundry is a blazing fast, portable and modular toolkit for Ethereum application development written in Rust."
Has 2 core utilities:
forge
cast
forge
is primarily what we will cover today, it is an Ethereum smart contract testing framework, like Truffle, Hardhat, and dapptools.
cast
is a collection of utilities for interacting with smart contracts, endcoding, decoding, and understanding EVM ecosystem semantics.
why foundry is dope
Think about any language you have ever written -- did you write your tests in another language? How can you expect to master a language when you spend sometimes greater than half your development time writing in another language?
This is one of the core problems foundry aims to solve: write your tests in the same language as your production software.
Context switching also reduces productivity; being able to stay in solidity can speed up development. Speaking of speed, foundry
is fast. Really freakin' fast. The benchmarks below are even a little outdated (we got faster :)).
Project | Forge | DappTools | Speedup |
---|---|---|---|
guni-lev | 28.6s | 2m36s | 5.45x |
solmate | 6s | 46s | 7.66x |
geb | 11s | 40s | 3.63x |
vaults | 1.4s | 5.5s | 3.9x |
And it is only getting faster. A new evm backend is being integrated right now and early benchmarks have it close to a 50% speedup.
cool features
- FAST
- mainnet forking
- cheatcodes
- debugger
- traces
- fuzzing
- multi compiler version support
LETS HOP IN!
Repo will be available after the talk.
Install & Setup
curl -L https://foundry.paradigm.xyz | bash
foundryup
forge init foundry_seminar
Feel free to follow along :)