Get Started
Deploy a Smart Contract
Lightchain AI is fully EVM-compatible, so you can deploy Solidity smart contracts using any standard Ethereum toolchain.[!NOTE] Make sure you have connected to the testnet and claimed testnet LCAI before proceeding.
Prerequisites
- A wallet with testnet LCAI (at least 0.1 LCAI for gas).
- Node.js v18+ installed (for Hardhat).
- Foundry installed (optional).
- Basic familiarity with Solidity.
Option A: Deploy with Hardhat
Step 1 — Initialize a Project
CodeBASH
Step 2 — Write Your Contract
CreateCodeHTML
CodeSOLIDITY
Step 3 — Configure the Network
UpdateCodeHTML
CodeJAVASCRIPT
CodeHTML
CodeHTML
Never commit your .env file or private key to version control.
Add .env to your .gitignore immediately.
Step 4 — Write the Deployment Script
CreateCodeHTML
CodeJAVASCRIPT
Step 5 — Deploy
CodeBASH
CodeHTML
Option B: Deploy with Foundry
Step 1 — Initialize a Project
CodeBASH
Step 2 — Write Your Contract
ReplaceCodeHTML
CodeHTML
CodeSOLIDITY
Step 3 — Write the Deployment Script
CreateCodeHTML
CodeSOLIDITY
Step 4 — Deploy
CodeBASH
Option C: Deploy with Remix (No Setup Required)
For quick prototyping without any local setup:- Open Remix IDE.
- Create a new file and paste the contract above.CodeHTML
- Compile using Solidity compiler 0.8.24+.
- Go to the "Deploy & Run Transactions" tab.
- Set the environment to "Injected Provider — MetaMask".
- Ensure MetaMask is connected to Lightchain AI Testnet (Chain ID ).CodeHTML
- Enter a constructor argument (e.g., ).CodeHTML
- Click Deploy and confirm the transaction in MetaMask.
Confirm Your Deployment
After deployment, verify the transaction on the block explorer:- Copy the contract address from your terminal output or Remix.
- Search for it on the Lightchain AI Testnet Explorer.
- You should see the contract creation transaction with status Success.
Your contract is now live on the Lightchain AI Testnet!
Next Steps
- Interact with your contract — Call functions and read state.
- Verify your contract — Publish your source code on the explorer.
Last updated: February 2026