EVM Development Toolchains
1. Foundry
Introduction to Foundry: Ethereum Development Toolkit
Foundry is a versatile toolkit designed for Ethereum application development, written in Rust. It comprises the following components:
Forge: Ethereum Testing Framework
Similar to Truffle, Hardhat, and DappTools, Forge serves as an Ethereum testing framework. It facilitates testing smart contracts and application logic within the Ethereum ecosystem.
Cast: Versatile Ethereum Interaction Tool
Cast operates as a Swiss army knife for engaging with EVM (Ethereum Virtual Machine) smart contracts. It enables users to send transactions and access chain data conveniently.
Anvil: Local Ethereum Node
Resembling Ganache and Hardhat Network, Anvil functions as a local Ethereum node. It provides a testing environment for Ethereum-based applications, aiding in development and testing processes.
Chisel: Solidity REPL (Read-Eval-Print Loop)
Chisel stands as a rapid, utilitarian, and verbose Solidity REPL. It offers an interactive environment for Solidity programming, allowing developers to experiment, test code snippets, and execute Solidity commands swiftly.
Installation Guide for Foundry on Mac
Precompiled Binaries using Foundryup
- Install Foundryup: Open your terminal and run the following command:
Follow the on-screen instructions to complete the installation. This will make the 'foundryup' command available in your CLI.
- Install Foundry tools: Run 'foundryup' to install the latest (nightly) precompiled binaries including Forge, Cast, Anvil, and Chisel. Use foundryup --help for more options, such as installing from a specific version or commit.
Building from Source
Prerequisites
- Rust Compiler and Cargo: Install with rustup.rs.
- Windows: Additionally, install Visual Studio with the "Desktop Development With C++" Workloads option.
Building Steps
- Using Foundryup Flags:
- Using Cargo Command:
-
Manually Building from Repository:
These steps should guide you through installing Foundry on your Mac, whether through precompiled binaries using Foundryup or building from the source code.
First Steps with Foundry
This section provides an overview of the 'forge' command line tool. Let's dive into creating a new project, compiling, and testing it.
Creating a New Project
To initiate a new project with Foundry, use 'forge init':
2. Hardhat
- They have incredible documentation, that's why I personally still prefer doing a lot of things using hardhat, but lately been dabbling more with Foundry.
- https://hardhat.org/hardhat-runner/docs/getting-started#overview