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.
Open your Truffle configuration file (
truffle-config.js
) and add the following configuration:
Make sure
YOUR_LUMIA_L2_EXPLORER_API_KEY -
this is just an arbtrary key as Blockscout does not need an API key for verification
Deploy your contracts to the Lumia L2 Testnet:
Verify your contracts using the
truffle run verify
command:
Replace ConvertLib
and MetaCoin
with the names of your contract.
Wait for the verification process to complete. Truffle will display a success message once the contracts are verified.
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:
Update your Truffle configuration file (
truffle-config.js
) with the Lumia chain Mainnet settings:
Replace 'YOUR_LUMIA_L2_EXPLORER_API_KEY'
with your actual Lumia chain Explorer API key.
Deploy your contracts to the Lumia chain Mainnet:
Verify your contracts using the
truffle run verify
command:
Wait for the verification process to complete. Truffle will display a success message once the contracts are verified.
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.
Last updated