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 Your Contracts on Lumia L2
  • Installation
  • Configuration
  • Deployment and Verification
  • Confirming Verification on BlockScout

Was this helpful?

  1. Build
  2. SmartContracts
  3. Verify

Hardhat

Verify your SmartContract using Hardhat

Verifying Your Contracts on Lumia L2

After you've deployed your contract to the Lumia L2 network, the next crucial step is to verify its source code. Verifying a contract involves making its source code publicly available, along with the compiler settings used, allowing anyone to compile it and compare the generated bytecode with the deployed version on the blockchain. This transparency is essential in an open platform like Lumia L2.

In this guide, we'll walk you through the process of verifying your contract using the Lumia L2 Explorer.

Installation

  1. If starting from scratch, create a new npm project in an empty folder using npm init (npm 7 or higher recommended).

  2. Install Hardhat by running npm install --save-dev hardhat or yarn add --dev hardhat.

  3. Create a Hardhat project by running npx hardhat and following the prompts.

  4. Install the hardhat-verify plugin (v3.0.0+) using npm install --save-dev @nomicfoundation/hardhat-verify or yarn add --dev @nomicfoundation/hardhat-verify.

  5. Add the plugin reference to your hardhat.config.js or hardhat.config.ts file.

Configuration

  1. Set up your Hardhat config file to support the network you're working on (e.g., Lumia Testnet).

  2. Add an RPC URL with an arbitrary string as the API key.

  3. To use BlockScout for verification, specify the explorer details under a customChains object, including the chainID, apiURL, and browserURL.

Deployment and Verification

  1. Use Hardhat Ignition for deployment.

  2. Deploy your contract.

  3. Verify the deployed contract using:

npx hardhat verify --network lumia-testnet DEPLOYED_CONTRACT_ADDRESS "Constructor argument 1".

If the contract is automatically verified via the Ethereum Bytecode Database service, you may need to use the --force flag to enforce verification.

Confirming Verification on BlockScout

  1. Go to your Lumia Testnet URL and search for the contract address.

  2. Check for a green checkmark ✅ indicating the contract is verified.

  3. Scroll down to view and interact with the contract code.

PreviousVerifyNextTruffle

Last updated 11 months ago

Was this helpful?

🛠️
Sample verified contract view