Foundry
Foundry is a blazing-fast, portable, and modular toolkit for Ethereum application development. This guide shows you how to deploy smart contracts to LitVM using Foundry.
Prerequisites
A wallet with testnet zkLTC (see Add to Your Wallet)
Basic familiarity with Solidity
Install Foundry
If you haven't installed Foundry yet:
# Install foundryup
curl -L https://foundry.paradigm.xyz | bash
# Install Foundry
foundryupVerify installation:
forge --versionCreate a New Project
This creates a project structure:
Write Your Contract
Create a simple contract in src/Counter.sol:
Configure for LitVM
Update foundry.toml to include LitVM network:
Set Up Environment
Create a .env file (add to .gitignore!):
Load environment variables:
Compile
Expected output:
Test
Run tests before deploying:
Add a test in test/Counter.t.sol:
Run with verbosity:
Deploy
Verify Contract
Verify on LitVM Explorer:
Interact with Contract
Using cast
Using Forge Script
Create script/Interact.s.sol:
Gas Estimation
Check gas costs before deploying:
Common Issues
Next Steps
Deploy more complex contracts (ERC-20, ERC-721, etc.)
Set up Hardhat for alternative tooling
Explore LitVM ecosystem dApps
Resources
LitVM Block Explorer (coming soon)
Last updated