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
- Basic understanding of Solidity and Avalanche.
- You are familiar with Avalanche Smart Contract Quickstart.
- Basic understanding of the Avalanche's architecture
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.
Create a Codespace
- Click the green Code button
- Switch to the Codespaces tab
- Click Create Codespace on main or if you already have a Codespace click the plus (+) button
The Codespace will open in a new tab. Wait a few minutes 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:
As a result you should see the help of Avalanche CLI:
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.
Create a Smart Contract
Create a new Solidity file in the src
directory of your project. For example, src/MyContract.sol
.
Create Deployment Address
You can create a new wallet with the case command:
Fund Your Account
Go the the faucet and fund the address with Fuji AVAX. You can use the code avalanche-academy
:
Deploy the Smart Contract
With foundry's forge
command, you can deploy your smart contract to the Fuji C-Chain.