Foundry Tutorial Resources:
Installation
Foundry installation is straightforward. Install using the official installer:source to reload environment variables), then run:
foundryup will automatically install the latest stable version of the precompiled binaries:
forge- Build, test, and deploy toolcast- CLI for interacting with contractsanvil- Local testnet nodechisel- Solidity REPL
Creating a New Project
Initialize a new Foundry project:src/- Your Solidity contractstest/- Your test filesscript/- Deployment scriptsfoundry.toml- Configuration file
Configuring for MANTRA Chain
Updatefoundry.toml to configure MANTRA Chain networks:
Building Contracts
Build your contracts:Testing
Write tests in Solidity and run them:Deploying
Deploy to MANTRA Chain testnet:Deployment walkthrough (legacy pattern)
If you prefer keeping deployment config in a.env file (handy for scripts/CI), you can use a pattern like:
Next Steps
- Learn about deploying contracts
- Understand contract verification
- Explore EVM development