Verify through Hardhat

This guide covers Hardhat 2.x for deploying and verifying smart contracts on SocialScan-supported chains (Monad, Pharos, etc.).

Hardhat is a smart contracts development tool, perfect if you're familiar with Javascript/Typescript.

circle-info

SocialScan doesn't require an API key for contract verification.

Quick Start

Option 1: Use This Example Project

Clone this repository:

git clone https://github.com/HemeraProtocol/hardhat-verify-example.git                                                                                     
cd hardhat-verify-example                                                                                                                            
npm install      

Copy .env.example to .env and add your settings:

cp .env.example .env
# Edit .env with your private key and RPC URLs

Option 2: Add to Your Existing Project

If you already have a Hardhat 2.x project, follow the installation and configuration steps below.

Install

Via npm:

For upgradeable contracts (optional):

Config

In hardhat.config.ts, import the plugins:

Create .env:

Deploy and Verify (using Hardhat Ignition)

Deploy to Monad Testnet:

Deploy to Pharos Testnet:

Verify an Existing Contract

With constructor arguments:

Upgradeable Contracts (UUPS)

First, add the upgrades plugin to your config:

Deploy Proxy

Create scripts/deploy-proxy.ts:

Deploy:

Upgrade Proxy

Create scripts/upgrade-proxy.ts:

Upgrade:

Proxy Verification Limitations

Important: The proxy contract itself (ERC1967Proxy from OpenZeppelin) cannot be automatically verified using the Hardhat verify plugin.

What gets verified:

  • ✅ Implementation contracts (BoxV1, BoxV2, etc.) - Automatically verified

  • ✅ All your business logic is visible to users

What doesn't get verified:

  • ⚠️ The proxy contract (ERC1967Proxy)

Why this happens:

  • The proxy contract is in node_modules/@openzeppelin/contracts/

  • Hardhat verify plugin doesn't handle library contracts well

  • This is a plugin limitation, not SocialScan-specific

Why this is acceptable:

  • Users can see all source code via the verified implementation

  • The proxy is a standard, audited OpenZeppelin contract

  • Functionality is completely unaffected

Live Examples

Monad Testnet:

Pharos Atlantic Testnet:

Last updated