Now that you’re connected and have CREDITS to cover compute costs, let’s deploy your first smart contract on SKALE Base Mainnet. This guide uses Foundry — a fast, portable toolkit for Ethereum development. If you prefer Hardhat, see the Setup Hardhat guide.Documentation Index
Fetch the complete documentation index at: https://docs.skale.space/llms.txt
Use this file to discover all available pages before exploring further.
Every transaction in this guide deducts from your CREDIT balance — no gas token needed. Make sure you have CREDITS before starting. See Buy CREDITS.
Prerequisites
- Foundry installed (
foundryup) - CREDITS in your wallet on SKALE Base Mainnet (see Buy CREDITS)
- SKALE Base Mainnet RPC URL:
https://skale-base.skalenodes.com/v1/base(see Connect to SKALE)
Step 1: Set Up a Foundry Project
Step 2: Configure foundry.toml
Updatefoundry.toml to point at SKALE Base Mainnet:
Step 3: Create Your Contract
Create an ERC-721 (NFT) contract insrc/MyNFT.sol:
Step 4: Compile
Step 5: Deploy to Mainnet
Deploy your contract to SKALE Base Mainnet:SKALE Chains require the
--legacy flag. If you don’t have a keystore, --interactive prompts for your private key. The deployment will deduct CREDITS from your wallet to cover compute.Done. Your contract is live on SKALE Base Mainnet. Next, verify your contract or deploy an ERC-20 token.
Related Topics
- Setup Foundry — full Foundry configuration guide
- Setup Hardhat — Hardhat alternative
- Verify Smart Contracts
- Explore Programmable Privacy
