ACP-267: Primary Network validator uptime requirement increases from 80% to 90%.Read the proposal
Foundry

Foundry

Foundry is a blockchain development platform that provides a suite of tools for building and deploying blockchain applications.

Back

Overview

Foundry is a Rust-based smart contract development toolchain built by Paradigm. It handles compilation, testing, deployment, and on-chain interaction from the command line. Foundry is fast, has a built-in fuzz tester, and works with Avalanche C-Chain and L1s out of the box.

Features

  • Written in Rust: Fast compilation and test execution compared to JavaScript-based alternatives.
  • Forge: Compile and test contracts with unit tests, fuzz tests, and invariant tests -- all written in Solidity.
  • Cast: CLI tool for interacting with deployed contracts, sending transactions, and querying chain state.
  • Anvil: Local EVM node for development and testing.
  • Script-Based Deployment: Write deployment scripts in Solidity using forge script.

Getting Started

  1. Install Foundry by following the instructions at book.getfoundry.sh.
  2. Initialize a project with forge init.
  3. Write your contracts and tests in src/ and test/.
  4. Run forge test to execute your test suite.
  5. Deploy to Avalanche C-Chain or an L1 using forge script or forge create.
  6. Use cast to interact with deployed contracts from the command line.

Documentation

For installation, tutorials, and CLI references, see the Foundry Book.

Use Cases

  • Contract Development: Write, compile, and test Solidity contracts with a fast feedback loop.
  • Fuzz Testing: Use Foundry’s built-in fuzzer to find edge cases in your contract logic.
  • Scripted Deployments: Manage multi-step deployments with Solidity-based scripts.
  • On-Chain Interaction: Query contract state and send transactions from the CLI with cast.

Is this guide helpful?

Developer:

Paradigm

Categories:

Developer Tooling

Available For:

C-Chain
All Avalanche L1s

Website:

https://book.getfoundry.sh/

Documentation:

https://book.getfoundry.sh/