Skip to main content

Foundry Reference

Mega CLI builds on top of Foundry, a powerful Ethereum development toolkit. This page provides a quick reference for Foundry tools that are used within Mega CLI.
For comprehensive documentation, refer to the Foundry Book, which is the official documentation.

Foundry Components

Foundry consists of four main tools that are used throughout Mega CLI:

Forge

Forge is a testing framework for Ethereum smart contracts.

Cast

Cast is a command-line tool for interacting with EVM smart contracts, sending transactions, and getting chain data.

Anvil

Anvil is a local Ethereum node designed for development with configurable options.

Chisel

Chisel is a Solidity REPL (Read-Eval-Print Loop) for quick code testing and prototyping.

RPC selection in Mega CLI

Foundry commands such as forge create, forge verify-contract, and cast balance support --rpc-url. Mega CLI exposes the same override on its network-aware commands:
Mega CLI supplies --rpc-url to Foundry once and validates that a custom endpoint’s chain ID matches --network. The network defaults are local Anvil (31337), MegaETH testnet (6343), and MegaETH mainnet (4326).

Additional Resources