Lumia - The RWA Chain
  • What is Lumia Chain?
  • Polygon
    • CDK
    • AggLayer
    • Miden
    • Passport
  • ⛓️Lumia
    • Architecture
    • Roadmap
    • LUMIA Token
      • Token Swap Guide (UI)
      • Token Swap Guide (SmartContract)
    • 普通话 - LUMIA 代币
    • rwaUSD
    • HyperNodes
    • zkProvers
      • zkProver Network (zkN) via Gevolut
    • Sequencer
      • Decentralised Sequencer Network (DCN)
    • Data Availability
      • Validium
      • Volition (Enhanced Validium)
      • What is Avail DA?
        • How does AvailDA Scale?
        • Benefits of AvailDA
      • Lumia DA - Lightclient Nodes
    • Lumia Stream
      • Node Owned Liquidity
      • Liquidity Restaking
    • Interoperability
      • Polygon AggLayer
      • HyperLane
    • KYC
    • Chain & Account Abstraction with Intents
      • Particle Connect on Lumia
    • Real World Assets (RWA) on Lumia
  • 🛠️Build
    • Introduction
      • Accounts and Wallets
      • Setup Metamask with Lumia Chain
      • Bridge to/ from Lumia L2
      • Setup FoxWallet with Lumia Chain
    • Explorers
    • Build Environment
      • RPC
        • RPC Guide
      • Add Lumia Network to MetaMask
      • Testnet Tokens
    • SmartContracts
      • Deployment
        • Hardhat
        • Truffle
      • Verify
        • Hardhat
        • Truffle
      • Interact
      • Relay
      • Web3 Functions
    • On-Chain KYC
    • Oracles
      • API3
      • Supra
      • Commodity Prices
    • Indexers
      • Indexing with TheGraph
      • Indexing with Goldsky
    • zkNode
      • Run Local Validium Node
      • Run an RPC
        • JSON RPC Endpoints
      • Gas Fees
    • DA Lightclient
    • CDK Repos
    • rwaUSD
      • rwaUSD: Overcollateralizing
      • rwaUSD: Bridging
    • FAQs
Powered by GitBook
On this page
  • Verifying Contracts on Lumia Chain with Truffle
  • Prerequisites
  • Lumia Chain Testnet
  • Lumia Chain Mainnet

Was this helpful?

  1. Build
  2. SmartContracts
  3. Verify

Truffle

Verify your SmartContract using Truffle

Verifying Contracts on Lumia Chain with Truffle

Truffle is a popular development framework for Ethereum and compatible networks like Lumia chain. It provides a convenient way to verify contracts directly from the command line interface (CLI) using the truffle-plugin-verify plugin.

In this tutorial, we'll guide you through the process of verifying your contracts on the Lumia chain network using Truffle.

Prerequisites

Before getting started, ensure that you have the following:

  • Truffle installed globally: npm install -g truffle

  • truffle-plugin-verify plugin installed: npm install -g truffle-plugin-verify

  • A Lumia L2 Explorer API key

Lumia Chain Testnet

Let's start by verifying a contract on the Lumia chain Testnet. You can explore the Lumia chain Testnet Explorer to view verified contracts and transactions.

  1. Open your Truffle configuration file (truffle-config.js) and add the following configuration:

module.exports = {
  // ...
  plugins: ['truffle-plugin-verify'],
  api_keys: {
    lumia_l2_explorer: 'YOUR_LUMIA_L2_EXPLORER_API_KEY',
  },
  networks: {
    lumia_testnet: {
      provider: () => new HDWalletProvider(mnemonic, 'https://testnet-rpc.lumia.org/'),
      network_id: 1001,
      timeoutBlocks: 200,
      confirmations: 5,
    },
  },
  // ...
};

Make sure

YOUR_LUMIA_L2_EXPLORER_API_KEY - this is just an arbtrary key as Blockscout does not need an API key for verification

  1. Deploy your contracts to the Lumia L2 Testnet:

truffle migrate --network lumia_testnet
  1. Verify your contracts using the truffle run verify command:

truffle run verify ConvertLib MetaCoin --network lumia_testnet

Replace ConvertLib and MetaCoin with the names of your contract.

  1. Wait for the verification process to complete. Truffle will display a success message once the contracts are verified.

  2. View your verified contracts on the Lumia chain Testnet Explorer.

Lumia Chain Mainnet

To verify your contracts on the Lumia chain Mainnet, follow these steps:

  1. Update your Truffle configuration file (truffle-config.js) with the Lumia chain Mainnet settings:

module.exports = {
  // ...
  plugins: ['truffle-plugin-verify'],
  api_keys: {
    lumia_l2_explorer: 'YOUR_LUMIA_L2_EXPLORER_API_KEY',
  },
  networks: {
    lumia_mainnet: {
      provider: () => new HDWalletProvider(mnemonic, 'https://mainnet.lumia.org'),
      network_id: 8888,
      timeoutBlocks: 200,
      confirmations: 5,
    },
  },
  // ...
};

Replace 'YOUR_LUMIA_L2_EXPLORER_API_KEY' with your actual Lumia chain Explorer API key.

  1. Deploy your contracts to the Lumia chain Mainnet:

truffle migrate --network lumia_mainnet
  1. Verify your contracts using the truffle run verify command:

truffle run verify ConvertLib MetaCoin --network lumia_mainnet
  1. Wait for the verification process to complete. Truffle will display a success message once the contracts are verified.

  2. View your verified contracts on the Lumia chain Mainnet Explorer.

If you encounter any issues during the verification process, feel free to reach out to the Lumia chain community on Discord for assistance.

By following this tutorial, you can easily verify your contracts on the Lumia chain network using Truffle, enhancing the transparency and trust in your decentralized applications.

PreviousHardhatNextInteract

Last updated 7 months ago

Was this helpful?

🛠️