Blockscout
SupportWebsiteGithubDiscord
  • Blockscout Open-Source Explorer
  • 💡About BlockScout
    • Features
      • Ethereum Bytecode Database Microservice
      • Blockscout Redesign
    • Chains Using Blockscout
    • Partners & Integrations
      • RaaS Providers
      • Vera: Verifier Alliance
        • Adding your chain to the Vera database
        • Programmatic verification via the API
    • News & Media
      • Newsletter & Blog
    • Funding
      • L2 Funding Proposal
        • Aux Funding Images
    • Roadmap
  • 🙎Using Blockscout
    • Getting Started
      • Glossary of Terms
      • Main Menu
      • Blocks
      • Transaction Types
      • Beacon Chain Withdrawal Views
    • My Account
      • Watch list
      • Private tags
      • Public tags
      • API keys
      • Custom ABI
      • Verified addresses
        • Copy and Sign Message
      • For developers
    • Dappscout Apps Marketplace
      • DApp Integration
    • Swapscout
      • Earn Merits when using Swapscout
    • Revokescout
    • Autoscout Explorer Launchpad
    • CSV Exports
    • Token Support
      • ERC-1155 Support
    • Merits
      • Streak rewards
      • Activity Pass
      • Leaderboard
      • Badges
      • FAQs
  • 👩‍💻Developer Support
    • For Web3 Developers
    • Link to Blockscout
    • Blockscout APIs
      • Requests & Limits
      • REST API Endpoints
        • Stats API
        • Interpreter API
      • JSON RPC & ETH Compatible RPC Endpoints
        • Account
        • Block
        • Contract
        • Logs
        • Stats
        • Token
        • Transaction
        • ETH RPC API
      • GraphQL in Blockscout
    • Smart Contract Verification
      • Blockscout UI
      • Blockscout smart-contract verification API
      • Hardhat Verification Plugin
        • Sourcify Plugin for Hardhat
      • Foundry Verification
      • Sourcify Verification
      • OpenZeppelin Contract Verification
      • Automate verifications with Catapulta
      • Verification via thirdweb
      • Interacting with Smart Contracts
    • Integrate Merits
    • Chainscout chains list
  • 🏃‍♂️Setup and Run Blockscout
    • General Overview
      • Separate Indexer, Web App, and API
      • Umbrella Project Organization
      • Indexer Architecture Overview
      • ShareLock
      • EVM Version Information
    • Requirements
      • General Backend Requirements / Blockscout Backend Prerequisites
      • Backend/Frontend Compatibility Matrix
      • Hardware & Hosting Requirements
      • Database Storage Requirements
      • Client Setting Requirements
      • Node Tracing / JSON RPC Requirements
      • L2 -> L1 JSON-RPC Method Requests
    • ☑️ENV Variables
      • Backend ENVs: Common
      • Backend ENVs: Chain-Specific
      • Backend ENVs: Integrations
      • Frontend ENVs: Common
        • ENVs
        • Deprecated ENVs
      • Deprecated Backend ENVs
        • Previous ENV Variable Home Page
    • Deployment
      • ⭐Manual Deployment Guide
        • Ubuntu Setup
        • MacOS setup
      • ⭐Docker-compose Deployment
      • ⭐Kubernetes Deployment
      • Rollup Deployment
      • 🌟Cosmos-based chains
      • 🍀Upgrade Guide (v7.0 & v8.0)
      • Frontend Migration
        • All-In-One Container
        • Separate Frontend
        • Customized Backend
        • Proxy Setup
        • FAQs
      • Manual Deployment (backend + old UI)
        • Manual cleaning an instance from the previous deployment
      • Terraform Deployment
      • Ansible Deployment (AWS Cloud)
        • Overview
        • Prerequisites
        • AWS Permissions & Settings
          • Creating a Secret Key Pair
          • Login with AWS CLI
          • Creating an AWS certificate for SSL
          • Manually Cleaning Terraform Related Instances
        • Variables
        • Deploying the Blockscout Infrastructure
        • Deploying Blockscout
        • Destroying Provisioned Infrastructure
        • Common Additional Tasks
        • Common Errors and Questions
        • AWS Marketplace (deprecated)
          • Overview
          • CloudFormation Template
          • Prerequisites & Install Parameters
          • Install from AWS Marketplace
          • AWS EC2 archive node setup with OpenEthereum (formerly Parity)
          • Updating & Redeploying in AWS
          • Customizing CSS
    • Microservices
      • Blockscout ENS (BENS) Name Service Integration
      • Smart Contract Verification
    • Configuration Options
      • Automating Restarts
      • Branding Configs
      • Circle CI Updates
      • Charts and Stats
      • CSS Configuration & Presets
      • Exchange Rates
      • Front-end Config Files
      • haproxy Settings for Blockscout.com
      • Internationalization
      • Logger Configs
      • Memory Usage
      • Metrics
      • My Account Settings
      • Sorting and Pagination
      • Tracing
      • Reown Project ID for contract Read/Write
    • Indexing
      • How do I fix indexer timeouts?
      • How do I update memory consumption to fix indexer memory errors?
    • Testing
    • DB schema
  • FAQs
    • User FAQs
    • Developer FAQs
  • 🧩Resources
    • EaaS: Hosting with Blockscout
    • Contributing to Blockscout
    • Bug Bounty Program
    • Media kit
    • Release Notes
      • v5.3.0: 10/23/23
      • v5.2.0: 6/20/23
      • v5.1.0: 2/13/23
      • v5.0.0: 1/11/23
    • Discord Channel
    • Discussion
    • GitHub Repo
Powered by GitBook
On this page
  • Smart Contract Verification with Blockscout
  • Solidity (Flattened source code)
  • Solidity (Standard JSON input)
  • Via Sourcify: Sources and metadata JSON file
  • Solidity (Multi-part files)
  • Vyper Contract
  • Vyper Multi-part files and standard json input
  • Troubleshooting
  • Verification in a dev environment

Was this helpful?

Export as PDF
  1. 👩‍💻Developer Support
  2. Smart Contract Verification

Blockscout UI

Last updated 4 months ago

Was this helpful?

LogoLogo

Privacy and Terms

  • Privacy Notice
  • Terms and Conditions

Copyright © Blockscout Limited 2023-2024

Verification is available for both Solidity and Vyper contracts. Currently, there are 7 different type of inputs you can use for verification using the Blockscout UI.

👷🏻‍♂️ If preferred you can verify directly from your Hardhat or Foundry dev environment.

  • Hardhat Verification Plugin

  • Foundry Verification

To learn more about the smart contract verification Rust microservice and verification algorithm see this page for developers.

Smart Contract Verification with Blockscout

1) Go to the Verify contract page (Other -> Verify contract)

2) Enter in the contract address you received during deployment. The dropdown will show you several available verification options. Select the one you would like to use and continue.

  • Solidity (Standard JSON input)

  • Solidity (Sourcify)

  • Solidity (Multi-part files)

  • Vyper (Multi-part files)

  • Vyper (Standard JSON input)

Solidity (Flattened source code)

This verification method is recommended only for a single-file smart contract without any imports. For verification of contracts containing more that 1 file, a different verification method is recommended.

  1. Contract Address: The 0x address supplied on contract creation (added above)

  2. Is Yul contract: Select if the contract is coded in Yul for efficiency.

  3. Include Nightly Builds: Select if you want to show nightly builds.

  4. Compiler: derived from the first line in the contract pragma solidity X.X.X. Use the corresponding compiler version rather than the nightly build.

  5. EVM Version: Select the correct EVM version if known, otherwise use default.

  6. Optimization Enabled: If you enabled optimization during compilation, select and enter the run value. 200 is the Solidity Compiler default value. Only change if you changed this value while compiling.

  7. Enter the Solidity Contract Code: Copy-paste the source code of your smart contract as is.

  8. Add Contract Libraries: Enter the name and 0x address for any required libraries called in the .sol file. You can add multiple contracts with the "+" button.

  9. Click the Verify and Publish button.

  10. If all goes well, you will see a checkmark ✅ next to Code in the code tab, and an additional tab called Read Contract. The contract name will now appear in BlockScout with any transactions related to your contract.

Solidity (Standard JSON input)

More information on JSON input is available here.

  1. Include nightly builds. You can choose Yes or No depending on your compiler.

  2. Compiler. Choose the compiler version used to compile your smart contract. If you selected yes for nightly builds, use the compiler version rather than the build.

  3. Standard Input JSON. Upload your Standard Input JSON file. File should follows solidity format and all the sources must be in Literal Content format, not a URL.

Click the Verify & publish button and wait for the response.

Via Sourcify: Sources and metadata JSON file

See the Contract Verification via Sourcify page for details.

Solidity (Multi-part files)

See the above settings. You will upload all of the .sol or .yul files you used for your contract. This method requires at least 2 files - if you have a single file use the flattened source code method.

Vyper Contract

  1. Contract Name: Name assigned to the contract.

  2. Compiler: Select the compiler version used in the source code.

  3. EVM Version: Select the correct EVM version if known, otherwise use default.

  4. Contract Code: Copy and paste the contract code

  5. Click the Verify and Publish button.

If all goes well, you will see a checkmark ✅ next to Code in the code tab, and an additional tab called Read Contract. The contract name will now appear in BlockScout with any transactions related to your contract.

Vyper Multi-part files and standard json input

See the information above.

Troubleshooting

If you receive the dreaded There was an error compiling your contract message this means the bytecode doesn't match the supplied sourcecode. Unfortunately, there are many reasons this may be the case. Here are a few things to try:

1) Double check the compiler version is correct.

Check all version digits - for example 0.5.1 is different from 0.5.10

2) Check that an extra space has not been added to the end of the contract. When pasting in, an extra space may be added. Delete this and attempt to recompile.

3) Copy, paste, and verify your source code in Remix. You may find some exceptions here.

Verification in a dev environment

The Hardhat verification plugin supports BlockScout. You can also choose to use the Sourcify plugin to verify with Sourcify from your hardhat environment. Foundry supports blockscout verification with Forge.

Solidity (

)

Flattened source code)
Vyper (Contract