Deploy a DApp on the C-Chain with Foundry

This guide shows how to deploy and interact with smart contracts using foundry on a local Avalanche Network and the Fuji C-Chain.

Back

Foundry toolchain is a smart contract development toolchain written in Rust. It manages your dependencies, compiles your project, runs tests, deploys, and lets you interact with the chain from the command-line.

Recommended Knowledge

Run Avalanche Starter Kit

The Avalanche Starter Kit contains everything you need to get started quickly with Avalanche. Among other tools it contains Avalanche CLI. With that you can set up a local network, create a Avalanche L1, customize the Avalanche L1/VM configuration, and so on.

In this course we will run the Avalanche Starter Kit in a hosted environment on Github. This is the most quick way to get started.

Start Avalanche Starter Kit in a Codespace

Follow the steps in the following video:

PLACEHOLDER: [Video: Start Avalanche Starter Kit in a Codespace]

Open Avalanche Starter Kit

The Codespace will open in a new tab. Wait until it's fully built

Verify everything is working correctly

Open the terminal with Ctrl + ` or by opening it through the menu:

Now enter avalanche -h to verify everything is working:

avalanche -h

As a result you should see the help of Avalanche CLI:

Avalanche-CLI is a command-line tool that gives developers access to
everything Avalanche. This release specializes in helping developers
build and test Avalanche L1s.
 
To get started, look at the documentation for the subcommands or jump right
in with avalanche blockchain create myNewAvalanche L1.
 
Usage:
  avalanche [command]
 
Available Commands:
  config                Modify configuration for Avalanche-CLI
  help                  Help about any command
  key                   Create and manage testnet signing keys

Optional: Open Codespace locally in Visual Studio Code

You can switch any time from the browser IDE to Visual Studio Code:

The first time you switch, you will be asked to install the Codespaces extension and connect VS Code to you GitHub account, if it is not already connceted.

Written by

At

Sun May 26 2024

Topics

solidityfoundryAvalanche Starter Kit
Edit on Github