> ## Documentation Index
> Fetch the complete documentation index at: https://docs.abs.xyz/llms.txt
> Use this file to discover all available pages before exploring further.

# Hardhat - Verifying Contracts

> Learn how to verify smart contracts on Abstract using Hardhat.

## Verifying Contracts

<Steps>
  <Step title="Get an Etherscan API key">
    Follow the [Etherscan documentation](https://docs.etherscan.io/getting-started/viewing-api-usage-statistics) to get an API key.
  </Step>

  <Step title="Update Hardhat configuration">
    Add the below `etherscan` configuration object to your Hardhat configuration file.

    Replace `<your-etherscan-api-key-here>` with your Etherscan API key from the previous step.

    ```typescript hardhat.config.ts {8} theme={null}
    import { HardhatUserConfig } from "hardhat/config";
    import "@matterlabs/hardhat-zksync";

    const config: HardhatUserConfig = {
      etherscan: {
        apiKey: {
          abstractTestnet: "your-etherscan-api-key-here",
          abstractMainnet: "your-etherscan-api-key-here",
        },
        customChains: [
          {
            network: "abstractTestnet",
            chainId: 11124,
            urls: {
              apiURL: 'https://api.etherscan.io/v2/api',
              browserURL: "https://sepolia.abscan.org/",
            },
          },
          {
            network: "abstractMainnet",
            chainId: 2741,
            urls: {
              apiURL: 'https://api.etherscan.io/v2/api',
              browserURL: "https://abscan.org/",
            },
          },
        ],
      },
    };

    export default config;
    ```
  </Step>

  <Step title="Verify a contract">
    Run the following command to verify a contract:

    ```bash theme={null}
    npx hardhat verify --network abstractTestnet <contract-address>
    ```

    Replace `<contract-address>` with the address of the contract you want to verify.
  </Step>
</Steps>

## Constructor Arguments

To verify a contract with constructor arguments, pass the constructor arguments to the `verify` command after the contract address.

```bash theme={null}
npx hardhat verify --network abstractTestnet <contract-address> <constructor-arguments>
```
