Join our community of builders on Discord!

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
Select "Create a JavaScript project" when prompted.

Step 2 — Write Your Contract

Create
CodeHTML
:
CodeSOLIDITY

Step 3 — Configure the Network

Update
CodeHTML
:
CodeJAVASCRIPT
Create a
CodeHTML
file in your project root:
CodeHTML
Never commit your .env file or private key to version control. Add .env to your .gitignore immediately.

Step 4 — Write the Deployment Script

Create
CodeHTML
:
CodeJAVASCRIPT

Step 5 — Deploy

CodeBASH
You should see output like:
CodeHTML

Option B: Deploy with Foundry

Step 1 — Initialize a Project

CodeBASH

Step 2 — Write Your Contract

Replace
CodeHTML
with
CodeHTML
:
CodeSOLIDITY

Step 3 — Write the Deployment Script

Create
CodeHTML
:
CodeSOLIDITY

Step 4 — Deploy

CodeBASH

Option C: Deploy with Remix (No Setup Required)

For quick prototyping without any local setup:
  1. Open Remix IDE.
  2. Create a new file and paste the
    CodeHTML
    contract above.
  3. Compile using Solidity compiler 0.8.24+.
  4. Go to the "Deploy & Run Transactions" tab.
  5. Set the environment to "Injected Provider — MetaMask".
  6. Ensure MetaMask is connected to Lightchain AI Testnet (Chain ID
    CodeHTML
    ).
  7. Enter a constructor argument (e.g.,
    CodeHTML
    ).
  8. Click Deploy and confirm the transaction in MetaMask.

Confirm Your Deployment

After deployment, verify the transaction on the block explorer:
  1. Copy the contract address from your terminal output or Remix.
  2. Search for it on the Lightchain AI Testnet Explorer.
  3. You should see the contract creation transaction with status Success.
Your contract is now live on the Lightchain AI Testnet!

Next Steps


Last updated: February 2026