How to Verify Your Smart Contract with the Blockscout UI

Learn how to verify smart contracts using Hardhat and the Blockscout UI. Ensure transparency, build user trust, and unlock full read-write interaction across EVM chains with Blockscout’s smart contract tools.

smart contract verification, verify smart contract, EVM contract verification, Hardhat deployment, verify contracts Hardhat, Blockscout verification, EVM explorer

Verifying smart contracts is a vital step in ensuring transparency and trust in blockchain applications. Through verification, users can review the source code of deployed contracts, fostering confidence and facilitating deeper interaction with decentralized systems.

Blockscout simplifies this process across various EVM-compatible chains and this is just one of the features that Blockscout offers for comprehensive smart contract coverage, along with advanced capabilities for reading, writing, and interacting with contracts and proxies. In this article, we’ll guide you through verifying your smart contracts directly through the Blockscout UI using Hardhat to deploy the contracts.

smart contract explorer, blockchain transparency, verify Solidity contract, Hardhat contract verify, Blockscout UI

Step 1. Set up Project with Hardhat.

Before proceeding, ensure that you have Node Package Manager (NPM) installed.

1. Initialize a new project using npm.

Enter the root directory of your system and run.

npm init -y

mart contract source code, blockchain trust, smart contract audit, open source contracts, EVM smart contracts

2. Install Hardhat

npm install -- save-dev hardhat

decentralized application contracts, contract ABI, contract bytecode, contract metadata, contract proxy verification, verify proxy contract, Hardhat plugin

3. Run the setup wizard

npx hardhat

Etherscan alternative, Blockscout explorer, multichain verification, contract interaction tools, read smart contract, write smart contract, smart contract tools, dapp developer tools, Hardhat deploy, verify on Blockscout

4. Install hardhat toolbox

npm install --save-dev hardhat @nomicfoundation/hardhat-toolbox

public blockchain explorer, contract security, blockchain UX, verify contract tutorial, Hardhat config, contract verification guide

Go to your hardhat.config.ts file and add;

import "@nomicfoundation/hardhat-toolbox";

EVM chain support, open source blockchain tools, developer blockchain tools

Step 2. Setup your Config file

First let's install dotenv to save our private keys

npm install dotenv

Add your private key and your network URL to the .env file in your editor.

erify smart contract, EVM contract verification, Hardhat deployment, verify contracts Hardhat, Blockscout verification, EVM explorer, smart contract explorer, blockchain transparency, verify Solidity contract, Hardhat contract verify, Blockscout UI, smart contract source code, blockchain trust, smart contract audit

Deploy using Hardhat ignition

pen source contracts, EVM smart contracts, decentralized application contracts, contract ABI, contract bytecode, contract metadata, contract proxy verification, verify proxy contract, Hardhat plugin, Etherscan alternative

Step 3. Verify on Blockscout UI

Paste the deployed contract address on the search bar and click on the details. Next click the Verify and publish button

Blockscout UI, smart contract source code, blockchain trust, smart contract audit, open source contracts, EVM smart contracts, decentralized application contracts, contract ABI, contract bytecode, contract metadata, contract proxy verification, verify proxy contract, Hardhat plugin, Etherscan alternative, Blockscout explorer, multichain verification, contract interaction tools, read smart contract, write smart contract

You will be directed to the verification page; fill in the details of your smart contract.

verify proxy contract, Hardhat plugin, Etherscan alternative, Blockscout explorer, multichain verification, contract interaction tools, read smart contract, write smart contract, smart contract tools, dapp developer tools, Hardhat deploy

Contract License

This is a legal notice declared at the very top of a smart contract file using the SPDX-License-Identifier.

Verification method

Blockscout provides up to nine methods for verifying your contracts.

verify on Blockscout, public blockchain explorer, contract security, blockchain UX, verify contract tutorial, Hardhat config, contract verification guide, EVM chain support, open source blockchain tools, developer blockchain tools
  • Solidity (Single file) - Can be used for unverified contracts

  • Solidity (Stardard Json Output) - Can be used for partially verified contracts.

  • Solidity (Sourcify) - Used for contracts verified with sourcify

  • Solidity (Multi-part files) - Can be used for unverified contracts

  • Soldidty (Hardhat) - Used for contracts verified with harhat

  • Solidity (Foundry) - Used for contracts deployed with foundry

  • Vyper (contract) - Can be used for unverified vyper contracts

  • Vyper (Multipart files) - Can be used for unverified multiple vyper contracts

  • Vyper (Stardard Json Output) - Can be used for partially verified vyper contracts.

💡
Use the JSON file for partially verified contracts. Single/Multi file Methods do not work with partial verification.

Selecting a verification method will generate a set of configuration options based on the chosen method. For example, when using Solidity Standard JSON Output, you need to import your JSON file and select your compiler version.

verify Solidity contract, Hardhat contract verify, Blockscout UI, smart contract source code, blockchain trust, smart contract audit, open source contracts, EVM smart contracts, decentralized application contracts, contract ABI, contract bytecode, contract metadata, contract proxy verification, verify proxy contract, Hardhat plugin

Click on the Verify and publish button.

⚠️
If hardhat is used to deploy contracts, the standard json may be obtained from artifacts/build-info/{build_hash}.json file
Blockscout verification, EVM explorer, smart contract explorer, blockchain transparency, verify Solidity contract, Hardhat contract verify, Blockscout UI, smart contract source code, blockchain trust, smart contract audit, open source contracts, EVM smart contracts, decentralized application contracts, contract ABI, contract bytecode, contract metadata, contract proxy verification, verify proxy contract, Hardhat plugin, Etherscan alternative, Blockscout explorer, multichain verification, contract interaction tools, read smart contract, write smart contract, smart contract tools, dapp developer tools, Hardhat deploy, verify on Blockscout

Conclusion

Verifying smart contracts through the Blockscout UI is an easy and effective way to enhance transparency, trust, and credibility in your decentralized applications. Making your source code public allows users and developers to inspect, audit, and interact with your contracts more confidently. 

Blockscout’s support for multiple verification methods streamlines the process across various EVM-compatible networks, and its user-friendly interface, combined with advanced tools for interacting with both contracts and proxies, gives developers a significant edge over manual or CLI-based verification methods.