GEB Docs
  • Quick Start
  • GEB Consensus
    • Mother Consensus
    • Sub Consensus(Agere)
  • Learn
    • BitAgere Guide
      • Auditor Reference Concepts
      • Executor Reference Concepts
  • Build
    • Validator
      • Wasm Operation
      • L-BTC Validator Operation
    • BitAgere
      • RelayAgere
      • Agere Auditor
      • Agere Executor
  • Use
    • Wasm Wallet
    • Earn $GEB
      • Stake L-BTC
        • What is L-BTC?
        • Download and Run LND Desk
        • Config LND
        • Node Asset Management
          • Open Channel(Get L-BTC)
          • L-BTC ⇌ BTC (on GEB chain)
        • Stake L-BTC Earn $GEB
      • Stake GEB on Agere
    • Earn $BTC
      • Claim and Other Operations
      • Transfer BTC to EVM
    • Bridge
      • Official Bridge
        • BEVM Mainnet
        • BEVM Canary
      • Third-Party Bridge
        • BEVM Mainnet
          • Swap from EVM to BEVM Mainnet
        • BEVM Canary
          • Swap from EVM to BEVM Canary
          • Other assets
            • Bridge PCX from BEVM Canary to Chainx
      • Transfer(EVM<-->Wasm)
  • EVM Development
    • Fee Calculation
      • GEB Mainnet
      • BEVM Canary
    • Smart Contract
      • Write a Contract
        • Set Up the Metamask Configuration
        • Deploy Smart Contract on GEB Signet
        • Deploy Smart Contract on BEVM Canary
      • Foundry
        • Deploy and verify contract by Foundry
      • Contract Verification (BlockScout)
      • ThirdWeb
    • Integrations
      • Oracle
        • Supra
        • DIA
      • Indexer
        • SubQuery
      • Account Abstraction
        • Particle Network
    • Libraries
      • ethereum-list/chains
      • Wagmi
      • Multicall3
    • Canonical contracts
    • Finality
  • Tokenomics
  • The Journy of GEB
  • Audit Reports
  • Community
Powered by GitBook
On this page
  • Command Api for Different Network
  • Smart Contract Verification with Blockscout
  • Solidity (Flattened source code)
  • Solidity (Standard JSON input)
  • Via Sourcify: Sources and metadata JSON file
  • Vyper Contract
  • Troubleshooting
  1. EVM Development
  2. Smart Contract

Contract Verification (BlockScout)

Partially Forked from BlockScout Docs

PreviousDeploy and verify contract by FoundryNextThirdWeb

Last updated 1 year ago

Verifying your deployed contract using flattened source code, JSON input, Sourcify and more. Once verified, a smart contract or token contract's source code becomes publicly available and verifiable, creating transparency and trust. Verification is available for both Solidity and Vyper contracts. Currently, there are 7 methods for verification using the Blockscout UI. To learn more about the smart contract verification Rust microservice and verification algorithm .

If preferred you can verify directly from your Hardhat dev environment.

  • ​​

  • ​

​If preferred you can verify directly from your Foundry dev environment.

Command Api for Different Network

Network
Api URL

BEVM Mainnet

https://scan-mainnet-api.bevm.io/api

BEVM Testnet

https://scan-testnet-api.bevm.io/api

BEVM Canary

https://scan-canary-api.bevm.io/api

BEVM Canary Testnet

https://scan-canary-test-api.bevm.io/api

Smart Contract Verification with Blockscout

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

2) Enter 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 (Multi-part files)

  • Vyper (Multi-part files)

  • Vyper (Standard JSON input)

Solidity (Flattened source code)

  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.

If you use BEVM Canary and BEVM Canary TestNet, The highest supported Solidity version is 0.8.13.

  1. 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.

  2. 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.

  3. Click the Verify and Publish button.

  4. 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)

  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.

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

Via Sourcify: Sources and metadata JSON file

Vyper Contract

  1. Contract Name: Name assigned to the contract.

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

  3. Contract Code: Copy and paste the contract code

  4. 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.

Troubleshooting

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

1) Double-check 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

Solidity (​

Solidity ()

Solidity ()

​)

EVM Version: Select the correctif known, otherwise use default.

Enter the Solidity Contract Code: You may need to flatten your solidity code if it utilizes a library or inherits dependencies from another contract. We recommend or the .

​.

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

See the page for details.

The supports BlockScout. You can also choose to use the to verify with Sourcify from your hardhat environment.

Flattened source code)
Standard JSON input
Sourcify
Vyper (Contract
EVM version
hardhat
POA solidity flattener
More information on JSON input is available here
format
Contract Verification via Sourcify
Hardhat verification plugin
Sourcify plugin
see this page for developers
Hardhat Verification Plugin
Sourcify Plugin for Hardhat
Foundry Verification Command