Remix

Remix IDE is a browser-based development environment that requires no setup. It's perfect for quick prototyping, learning, and deploying simple contracts to LitVM.

Prerequisites

  • A modern web browser (Chrome, Firefox, Brave)

  • MetaMask or another Web3 wallet installed

  • Testnet zkLTC in your wallet (see Add to Your Wallet)


Access Remix

1

Open Remix

  1. Open remix.ethereum.org in your browser

  2. You'll see the Remix IDE with a default workspace


Create Your Contract

1

Create a New File

  • In the File Explorer panel (left sidebar), click the 📄 icon to create a new file

  • Name it Counter.sol

2

Write the Contract

Paste this code into Counter.sol:

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.19;
contract Counter {
uint256 public count;
event CountChanged(uint256 new Count);
constructor(uint256_initialCount){
count = _initialCount;
}
function increment() public {
count += 1;
emit CountChanged(count);
}
function decrement() public {
require(count > 0, "Count cannot go below zero");
count -= 1;
emit CountChanged(count);
}
functiongetCount() publicviewreturns(uint256){
returncount;
}
}

Compile the Contract

1

Open Compiler

  • Click the Solidity Compiler icon in the left sidebar (looks like "S")

2

Configure Compiler

  • Compiler Version : Select 0.8.19 (or match your pragma)

  • EVM Version : Leave as default or select shanghai

  • Enable Auto compile for convenience

3

Compile

  1. Click Compile Counter.sol

  2. A green checkmark appears when successful

  3. You'll see "Counter" in the CONTRACT dropdown


Connect to LitVM

1

Configure MetaMask

Ensure LitVM Testnet is added to your wallet:

Setting

Value

Network Name

LitVM Testnet

RPC URL

⚠️ ⚠️ TBA — This value will be published closer to launch — This value will be published closer to launch

Chain ID

⚠️ ⚠️ TBA — This value will be published closer to launch — This value will be published closer to launch

Currency Symbol

zkLTC

2

Select Network in Remix

  1. Click the Deploy & Run icon in the left sidebar (arrow icon)

  2. In the ENVIRONMENT dropdown, select Injected Provider - MetaMask

  3. MetaMask will popup—select LitVM Testnet and connect

3

Verify Connection

  • You should see your wallet address under ACCOUNT

  • Your zkLTC balance will be displayed

  • The network should show the LitVM Chain ID


Deploy the Contract

1

Configure Deployment

  1. In the CONTRACT dropdown, select Counter

  2. In the field next to Deploy, enter the initial count (e.g., 0)

2

Deploy

  1. Click Deploy

  2. MetaMask will popup with the transaction

  3. Review gas fees (paid in zkLTC)

  4. Click Confirm

3

Wait for Confirmation

  • Watch the Remix terminal for deployment status

  • Once confirmed, your contract appears under Deployed Contracts


Interact with Your Contract

Read Functions (Free)

Under Deployed Contracts, expand your contract to see available functions:

  • count : Click to read the current count value

  • getCount : Alternative read function

Write Functions (Costs Gas)

  • increment : Click to add 1 to the count

  • decrement : Click to subtract 1 from the count

Each write function triggers a MetaMask transaction popup.

Example Interaction

1
  1. Click "count" → Shows: 0

2
  1. Click "increment" → Confirm in MetaMask

3
  1. Click "count" → Shows: 1

4
  1. Click "increment" → Confirm in MetaMask

5
  1. Click "count" → Shows: 2


View on Block Explorer

  1. After deploying, copy the contract address from Deployed Contracts

  2. Visit LitVM Explorer (Coming Soon)

  3. Paste your contract address in the search bar

  4. View transactions, events, and contract code


Verify Your Contract

1

Open Verification Plugin

  1. In Remix, go to Plugin Manager (plug icon in left sidebar)

  2. Search for "Contract Verification"

  3. Click Activate

2

Verify

  1. Open the verification plugin

  2. Select LitVM Testnet as the chain

  3. Enter your contract address

  4. Select the contract file and compiler version

  5. Enter constructor arguments (e.g., 0)

  6. Click Verify


Deploy an ERC-20 Token

1

Install OpenZeppelin

  1. In Remix, go to Plugin Manager

  2. Search for and activate DGIT or Remixd for GitHub imports

2

Create Token Contract

Create MyToken.sol:

3

Compile and Deploy

  1. Compile with Solidity 0.8.19

  2. Deploy with initial supply (e.g., 1000000 for 1M tokens)

  3. Your wallet will receive all tokens


Tips for Using Remix

Save Your Work

  • Remix stores files in browser storage

  • For important work, use GitHub integration or download files

Use Workspaces

  • Create separate workspaces for different projects

  • Click the hamburger menu in File Explorer → Create Workspace

Debug Transactions

  1. Go to Debugger plugin

  2. Enter a transaction hash

  3. Step through execution to find issues

Gas Estimation

  • Before deploying, Remix shows estimated gas

  • Ensure you have enough zkLTC


Common Issues

"Transaction reverted"
  • Check error message in Remix console

  • Ensure you're passing correct parameters

  • Verify you have sufficient zkLTC

"MetaMask not connecting"
  • Refresh the page

  • Ensure you're on LitVM Testnet in MetaMask

  • Try disconnecting and reconnecting

"Contract not verified"
  • Ensure compiler version matches exactly

  • Check constructor arguments are correct

  • Try flattening your contract first

"Invalid opcode"
  • Your EVM version might not match

  • Try selecting a different EVM version in compiler


Deploy to Mainnet

When LitVM mainnet launches:

  1. Switch MetaMask to LitVM Mainnet

  2. Ensure you have mainnet zkLTC

  3. Follow the same deployment process

  4. Be extra careful—mainnet deployments are permanent!


Next Steps

  • Try deploying an NFT contract

  • Learn Foundry for local development

  • Set up Hardhat for larger projects

  • Explore verified contracts on LitVM Explorer


Resources

Last updated