# Verifying Smart Contracts

### Using Developer Tools <a href="#using-developer-tools" id="using-developer-tools"></a>

Most smart contract tooling has plugins for verifying your contracts easily on Blast chain explorer.

Blast Chain Explorer API:  [https://blastchain.org/api](https://blastchain.org/api-docs)

### Hardhat <a href="#hardhat" id="hardhat"></a>

Modify `hardhat.config.ts` to point to Blast Chain’s RPC and block explorer API.

For example, the config for Blast Chain will look like this:

```javascript
...

const config: HardhatUserConfig = {
  ...
  networks: {
    blastChain: {
      url: 'https://zkevmrpc.blastchain.org' || '',
      accounts:
        process.env.PRIVATE_KEY !== undefined ? [process.env.PRIVATE_KEY] : [],
    },
  },
  etherscan: {
    apiKey: {
      blastChain: <YOUR API KEY>,
    },
    customChains: [
      {
        network: 'blastChain',
        chainId: 238,
        urls: {
          apiURL: 'https://blastchain.org/api',
          browserURL: 'https://blastchain.org/',
        },
      },
    ],
  },
}

...
```

Now you can verify the smart contract by running the following command.

```
npx hardhat verify --network blastChain <contract address> <space separated constructor parameters>

```

For example, this is how a smart contract that receives two uint parameters in the constructor should look:

```
npx hardhat verify --network blastChain 0xD9885478bd717189cC3Fbe7B9020F27fae7Ac76F 123 456
```

{% hint style="warning" %}
You may receive an error stating `etherscan.apiKey.trim is not a function`. If so, you need to update `@nomiclabs/hardhat-etherscan` to be able to support custom chains. Try running `npm update @nomiclabs/hardhat-etherscan`
{% endhint %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.blastchain.org/verifying-smart-contracts.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
