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
LogoLogo

Privacy and Terms

  • Privacy Notice
  • Terms and Conditions

Copyright © Blockscout Limited 2023-2024

On this page
  • Workflow
  • Standard JSON
  • Response
  • Success Response Outcomes
  • Multi-part verification
  • Additional Info
  • List of supported chains
  • List of supported compiler versions

Was this helpful?

Export as PDF
  1. About BlockScout
  2. Partners & Integrations
  3. Vera: Verifier Alliance

Programmatic verification via the API

Last updated 11 months ago

Was this helpful?

The uses a proxy-verifier service as an underlying backend. This service retrieves contract details for verification and sends them to the Ethereum bytecode database, which then writes them to the Verifier Alliance (Vera) database if verification succeeds.

The API provided by the proxy-verifier can be used to verify smart contracts. All endpoints are synchronous, meaning they wait for the operation to complete before returning any result.

All endpoints were originally designed for use by a frontend application. Currently there are no special endpoints for verification tools, but these may be developed in the future.

Workflow

There are 2 ways to verify Solidity and Vyper contracts using the service.

  1. Providing a standard JSON input. This option is preferred, and it is recommended for use by automatic verification scripts.

  2. Explicitly providing multiple files (multi-part).

Swagger documentation:

Standard JSON

Solidity: POST https://blockscout.github.io/api/v1/solidity/sources:verify-standard-json

Vyper: POST https://blockscout.github.io/api/v1/vyper/sources:verify-standard-json

Both Solidity and Vyper have the same standard JSON verification request and response structures.

Request

{
  "contracts": [
    {
      "chainId": "string",
      "address": "string"
    }
  ],
  "compiler": "string",
  "input": "string"
}
Name
Description

contracts

List of contracts to be verified. For each contract specify chainId and address.

chainId

address

0x address of the contract to be verified

compiler

Compiler version. This can be retrieved via: Solidity:GET https://proxy-verifier.services.blockscout.com/api/v1/solidity/compilers

input

Response

// Response (only a single response is returned, the other two will not be included)
  "contractValidationResults": {
    "items": [
      {
        "message": "string",
        "status": "VALID/INVALID/INTERNAL_ERROR"
      }
    ]
  },
  "compilationFailure": {
    "message": "string"
  },
  "contractVerificationResults": {
    "items": [
      {
        "message": "string",
        "status": "PARTIALLY_VERIFIED/FULLY_VERIFIED/FAILURE/INTERNAL_ERROR"
      }
    ]
  }
}
{
  "error": "BAD REQUEST"
}

Success Response Outcomes

A successful response has 3 different outcomes; one is always returned:

  • contractValidationResults - indicates that some (at least one) of the contracts do not support verification. This may mean that the address is not a contract, or that the contract at the given address self-destructed. For each provided contract, the corresponding VALID / INVALID statuses with descriptions are returned in the same order the contracts were provided.

  • compilationFailure - returned when the given source inputs cannot be compiled. This failure is ubiquitous and is not related to any particular provided contract. This means that the user provided invalid contract details during verification.

  • contractVerificationResults - indicates that all provided contracts are valid and verification requests for each of them have been sent to the eth-bytecode-db service. The verification may result in partial or full matches, or verification failure if the contract cannot be verified with the provided source details. The results are returned in the same order as the provided contracts.

{
    "contractValidationResults": {
        "items": [
            {
                "message": "Ok",
                "status": "VALID"
            },
            {
                "message": "Address is not a smart-contract",
                "status": "INVALID"
            },
            {
                "message": "Smart-contract was self-destructed",
                "status": "INVALID"
            }
        ]
    }
}
{
    "compilationFailure": {
        "message": "Compilation error: [\"No input sources specified.\"]"
    }
}

// Another example
{
    "compilationFailure": {
        "message": "content is not a valid standard json: missing field `optimizer` at line 1 column 54"
    }
}
{
    "contractVerificationResults": {
        "items": [
            {
                "message": "https://eth-sepolia.blockscout.com/address/0x5ad88296ac87a138100e8793722a021f32e212d9",
                "status": "PARTIALLY_VERIFIED"
            },
            {
                "message": "No contract could be verified with provided data",
                "status": "FAILURE"
            }
        ]
    }
}

Multi-part verification

Multi-part verification accepts source files explicitly along with some (the most common) configuration options. These options are limited, and in general, the standard JSON option is preferred.

Solidity

POST https://blockscout.github.io/api/v1/solidity/sources:verify-multi-part

{
  "contracts": [
    {
      "chainId": "string",
      "address": "string"
    }
  ],
  "compiler": "string",
  "evmVersion": "string",
  "optimizationRuns": 0,
  "sourceFiles": {
    "filePath1": "string", // content of the file
    "filePath2": "string"
  },
  "libraries": {
    "libName1": "string", // 20 bytes hex encoded address
    "libName2": "string" 
  }
}

The optimizationRuns option, if omitted, corresponds to the optimizer with enabled: false setup. If present, it should be a correct u32 value and result in runs: {optimizationRuns} setup with enabled: true.

sourceFiles is a mapping from file paths to corresponding contents.

libraries is a mapping from library names to their hex-encoded addresses.

Vyper

POST https://blockscout.github.io/api/v1/vyper/sources:verify-multi-part

{
  "contracts": [
    {
      "chainId": "string",
      "address": "string"
    }
  ],
  "compiler": "string",
  "evmVersion": "string",
  "sourceFiles": {
    "additionalProp1": "string",
    "additionalProp2": "string",
    "additionalProp3": "string"
  },
  "interfaces": {
    "additionalProp1": "string",
    "additionalProp2": "string",
    "additionalProp3": "string"
  }
}

sourceFiles is a mapping from file paths that should be specified inside the sources standard JSON option to corresponding contents.

interfaces is a mapping from file paths that should be specified inside the interfaces standard JSON option to corresponding contents.

Additional Info

List of supported chains

GET http://proxy-verifier.services.blockscout.com/api/v1/chains

// Response
{
  "chains": [
    {
      "id": "string",
      "name": "string",
      "iconUrl": "string"
    }
  ]
}

Returns the list of supported chains with corresponding details. For verification purposes, only the id is important. These are the chain IDs supported by the service and allowed to be used during contract verification.

List of supported compiler versions

GET https://proxy-verifier.services.blockscout.com/api/v1/solidity/compilers

GET https://proxy-verifier.services.blockscout.com/api/v1/vyper/compilers

Returns the list of supported compiler and corresponding EVM versions. Only one of these compiler and EVM (if the multi-part option is used) versions are allowed to be specified during contract verification.

{
  "compilers": [
    {
      "version": "string",
      "evmVersions": [
        "string"
      ]
    }
  ]
}

Numeric ID of chain List of supported chain IDs is available via: GET https://proxy-verifier.services.blockscout.com/api/v1/chains

Vyper: GET https://proxy-verifier.services.blockscout.com/api/v1/vyper/compilers Only one compiler version can be specified during verification. EVMVersions is only used for .

Standard JSON input encoded as a string - More info available here:

compiler and evmVersion must be valid and chosen from the. Otherwise, a 400 BAD REQUEST error will be returned.

compiler and evmVersion must be valid and chosen from the . Otherwise, a 400 BAD REQUEST error will be returned.

💡
Vera application
https://blockscout.github.io/swaggers/services/proxy-verifier/index.html#/
list of supported compilers and EVM versions
list of supported compilers and EVM versions
https://docs.soliditylang.org/en/latest/using-the-compiler.html#input-description
More info
multi-part verification
More info