Deploy with Remix

Deploy Smart Contract on LazAI Chain using Remix

1. Prerequisites

Before you begin, ensure you have:

  • A web browser (Chrome, Firefox, or Edge recommended)

  • MetaMask wallet extension installed

  • LazAI testnet tokens (get from faucet)

2. Setup MetaMask for LazAI Testnet

Add LazAI Network to MetaMask

  1. Open MetaMask extension

  2. Click on the network dropdown (usually shows "Ethereum Mainnet")

  3. Click "Add Network"

  4. Enter the following details:

Pre-Testnet Network

Contract Addresses

  1. Click "Save" to add the network

  2. Switch to LazAI Testnet in MetaMask

Get Testnet Tokens

Visit the LazAI faucet to get Testnet Tokens for deployment and transaction fees.

3. Access Remix IDE

  1. Open your web browser

  2. Remix IDE will load automatically - no installation required

4. Create Your Smart Contract

Create a New File

  1. In the File Explorer (left panel), click the "+" icon next to "contracts"

  2. Name your file Counter.sol

  3. Add the following code:

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
contract Counter { 
uint256 private count;   
function increment() public {        
count += 1;    
}     
function decrement() public {        
count -= 1;    
}     
function getCount() public view returns (uint256) {        
return count;    
}
}

5. Compile Your Contract

Select Compiler Version

  1. Click on the "Solidity Compiler" tab (second icon in left panel)

  2. Select compiler version 0.8.0 or higher

  3. Ensure "Auto compile" is checked (optional but recommended)

Compile

  1. Click "Compile Counter.sol" button

  2. Check for any compilation errors in the console

  3. Green checkmark indicates successful compilation

6. Deploy Your Contract

Setup Deployment Environment

  1. Click on "Deploy & Run Transactions" tab (third icon in left panel)

  2. In the "Environment" dropdown, select "Injected Provider - MetaMask"

  3. MetaMask will prompt you to connect - click "Connect"

  4. Ensure you're connected to LazAI Testnet in MetaMask

Deploy Contract

  1. Under "Contract" dropdown, select "Counter"

  2. Click "Deploy" button

  3. MetaMask will open asking you to confirm the transaction

  4. Review gas fees and click "Confirm"

  5. Wait for transaction confirmation