Skip to main content
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.
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

Step 1: Set Up a Foundry Project

Project structure:
Install OpenZeppelin contracts:

Step 2: Configure foundry.toml

Update foundry.toml to point at SKALE Base Mainnet:

Step 3: Create Your Contract

Create an ERC-721 (NFT) contract in src/MyNFT.sol:

Step 4: Compile

Step 5: Deploy to Mainnet

Deploy your contract to SKALE Base Mainnet:
Or use an encrypted keystore:
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.