# Hardhat

Verify your SmartContract using Hardhat

## Verifying Your Contracts on Flops

After you've deployed your contract to the FLOPS 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 FLOPS network.

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

### Installation

1. If starting from scratch, create a new npm project in an empty folder using  (npm 7 or higher recommended).<mark style="color:green;">npm init</mark>
2. Install Hardhat by running  or <mark style="color:green;">.npm install --save-dev hardhatyarn add --dev hardhat</mark>
3. Create a Hardhat project by running  and following the prompts.<mark style="color:green;">npx hardhat</mark>
4. Install the hardhat-verify plugin (v3.0.0+) using  or .<mark style="color:green;">npm install --save-dev @nomicfoundation/hardhat-verifyyarn add --dev @nomicfoundation/hardhat-verify</mark>
5. Add the plugin reference to your  or  <mark style="color:green;">file.hardhat.config.jshardhat.config.ts</mark>

### 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  object

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 flag to enforce verification.--force`<br>

Confirming Verification on BlockScout

1. Go to your Flops 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.

<figure><img src="https://3626508012-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FkFHFuYF5KILTWn3mXrqF%2Fuploads%2F4s5hOMmLeobxtPb2ax4f%2Fimage.png?alt=media&#x26;token=f87aa4c5-57cc-448a-8007-fd4edbcc4422" alt=""><figcaption><p>Sample verified contract view</p></figcaption></figure>
