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
Open MetaMask extension
Click on the network dropdown (usually shows "Ethereum Mainnet")
Click "Add Network"
Enter the following details:
Contract Addresses
Click "Save" to add the network
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
Open your web browser
Remix IDE will load automatically - no installation required
4. Create Your Smart Contract
Create a New File
In the File Explorer (left panel), click the "+" icon next to "contracts"
Name your file
Counter.sol
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
Click on the "Solidity Compiler" tab (second icon in left panel)
Select compiler version
0.8.0
or higherEnsure "Auto compile" is checked (optional but recommended)
Compile
Click "Compile Counter.sol" button
Check for any compilation errors in the console
Green checkmark indicates successful compilation
6. Deploy Your Contract
Setup Deployment Environment
Click on "Deploy & Run Transactions" tab (third icon in left panel)
In the "Environment" dropdown, select "Injected Provider - MetaMask"
MetaMask will prompt you to connect - click "Connect"
Ensure you're connected to LazAI Testnet in MetaMask
Deploy Contract
Under "Contract" dropdown, select "Counter"
Click "Deploy" button
MetaMask will open asking you to confirm the transaction
Review gas fees and click "Confirm"
Wait for transaction confirmation