U2U Network Documentations
  • Introduction
    • Our Vision
    • Litepaper
      • Overview
        • U2U Network Diagram
        • U2U Network with DEPIN and Web3 Eco System
      • Consensus
  • Services
    • RPC
      • RPC Endpoints
      • Ethereum API Methods
        • eth_blockNumber
        • eth_call
        • eth_chainId
        • eth_estimateGas
        • eth_feeHistory
        • eth_gasPrice
        • eth_getBalance
        • eth_getBlockByHash
        • eth_getBlockByNumber
        • eth_getBlockTransactionCountByHash
        • eth_getBlockTransactionCountByNumber
        • eth_getCode
        • eth_getLogs
        • eth_getProof
        • eth_getStorageAt
        • eth_getTransactionByBlockHashAndIndex
        • eth_getTransactionByBlockNumberAndIndex
        • eth_getTransactionByHash
        • eth_getTransactionCount
        • eth_getTransactionReceipt
        • eth_getUncleByBlockHashAndIndex
        • eth_getUncleByBlockNumberAndIndex
        • eth_getUncleCountByBlockHash
        • eth_getUncleCountByBlockNumber
        • eth_maxPriorityFeePerGas
        • eth_sendRawTransaction
        • eth_subscribe
        • eth_unsubscribe
        • net_version
        • net_listening
        • net_peerCount
        • web3_clientVersion
        • web3_sha3
        • debug_traceTransaction
      • DAG API Methods
        • dag_getEvent
        • dag_getEventPayload
        • dag_getHeads
        • eth_currentEpoch
      • Trace API Methods
        • trace_block
        • trace_get
        • trace_transaction
        • trace_filter
    • Explorer
      • Explorer URLs
      • Explorer API
        • Account
        • Block
        • Contract
        • Logs
        • Stats
        • Token
        • Transaction
      • GraphQL
      • Explorer RPC API
      • Smart Contract Verification
        • Via explorer
        • Via hardhat plugin
      • Testnet Faucet
    • Wallets
      • Metamask
      • Wallet Connect
      • Coinbase Wallet
      • U2U Super App
        • Policy
    • Staking
      • How To Stake?
      • FAQ
    • The Graph
      • Deploy a Graph Node
      • Deploy a Subgraph
    • Bridge
      • Smart Contracts & EOA
    • Oracle
      • Smart Contracts & EOA
  • Network
    • Node Types
    • Requirements
    • Build Dependencies
    • Run Normal Node
      • Mainnet Normal Node
      • Testnet Normal Node
      • Run via Docker
    • Run Validator Node
      • Mainnet Validator Node
      • Testnet Validator Node
    • Run A Local Test Network
    • Troubleshooting
  • SUBNET
    • Overview
    • Subnet Node Type
    • Requirements
    • NFT Digital License
    • Subnet Node Setup
      • Master Node
      • Verifier Node
      • Edge Node CLI
  • For Developers
    • SDK
    • Smart Contract Development
      • What are smart contracts?
      • What is gas?
      • Structure of a smart contract
      • Your first smart contract
      • Test your smart contract
      • Deploy your smart contract
      • Submit your contract to explorer
      • Interact With Your Smart Contract
      • Integrate Your Smart Contract With a Frontend
      • Additional Resources
    • Smart Contract Deployment
      • Deploy with Remix
      • Deploy with Hardhat
Powered by GitBook
On this page
  • Contract details
  • Verification methods
  • Solidity (Flattened source code)
  • Solidity (Standard JSON input)
  • Solidity (Multi-part files)
  • Troubleshooting
  1. Services
  2. Explorer
  3. Smart Contract Verification

Via explorer

You could directly use U2U Chain blockchain explorer to verify your contract's source code at u2uscan.xyz.

PreviousSmart Contract VerificationNextVia hardhat plugin

Last updated 11 months ago

Contract details

At the contract details page, select Contract tab. If the contract has not verified, you will see the Verify & publish button as in below example:

Click on Verify & publish button to start verifying your contract source code. There are multiple methods for verification using the blockchain explorer UI - all are cataloged below:

Verification methods

Solidity (Flattened source code)

  1. Contract Address: The 0x address supplied on contract creation.

  2. Contract Name: Name of the class whose constructor was called in the .sol file. For example, in contract MyContract {.. MyContract is the contract name.

  3. Include Nightly Builds: Yes 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. Optimization enabled: If you enabled optimization during compilation, check yes. 200 is the Solidity Compiler default value. Only change if you changed this value while compiling.

  6. 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 the or the .

  7. Try to fetch constructor arguments automatically: If similar contracts exist these may be available.

  8. ABI-encoded Constructor Arguments: .

  9. Add Contract Libraries: Enter the name and 0x address for any required libraries called in the called in the .sol file.

  10. Click the Verify & publish button.

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

Solidity (Standard JSON input)

  1. Contract Name. There are several options:

    1. Leave blank.

    2. Enter contract name: MyContract.

    3. Enter path to the contract and it's name: path/to/file.sol:MyContract (path should match what is written in your JSON file).

  2. Include nightly builds. You can select depending on your compiler.

  3. Compiler. Choose the compiler version used to compile your smart contract.

  4. Standard Input JSON. Attach your Standard Input JSON file. File should follows solidity and all the sources must be in Liternal Content format, not an URL.

After filling the form click the Verify & publish button and wait for the response.

Solidity (Multi-part files)

  1. Include nightly builds: Yes if you want to show nightly builds.

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

  3. Optimization enabled: If you enabled optimization during compilation, check yes. 200 is the Solidity Compiler default value. Only change if you changed this value while compiling.

  4. Sources *.sol or *.yul files: Select your contract files.

  5. Add contract libraries: Enter the name and 0x address for any required libraries called in the called in the .sol file.

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.

EVM Version: See .

EVM Version: See .

evm-version-information
evm-version-information
Solidity (Flattened source code)
Solidity (Standard JSON input)
Solidity (Multi-part files)
Contract details page, tab "Contract" - Click the "Verify & publish" button