Avascan Knowledge Base
  • Get started
  • 📗How to use Avascan
    • Introduction
    • Homepage
    • Unified Transaction List
    • Blocks
    • Assets
    • Token page
    • Verified contracts
    • Marketcap
    • Network Activity
    • Avalanche Bridge
    • Transaction Details
    • Blockchains
    • X-Chain
    • C-Chain
    • Staking
    • Whale Transactions
    • Rich List
    • Hot dApps
    • Burned Fees
    • AVAX Genesis
    • Avalanche Market Cap
    • Keyboard shortcuts
    • Universal Search v0.1
    • Metamask configuration
  • Delegation
    • How to delegate
    • FAQs
    • How to choose a validator
    • Avascan validators
  • 🌟Programs
    • Validator Claim
    • Asset Claim
    • Address Claim
    • The Blue Badge
  • 👩‍💻Tutorial
    • How to verify smart contract
    • How to setup your token marketcap
    • Deploy and verify an ERC-20 token
  • 📖APIs
    • Documentation
    • /api/v1 (deprecated)
      • Supply (deprecated)
      • Statistics (deprecated)
      • Staking (deprecated)
      • Burned fees (deprecated)
      • GraphQL (deprecated)
    • /api/v2
Powered by GitBook
On this page

Was this helpful?

  1. Tutorial

How to verify smart contract

Submit your smart contract code for independent verification and publishing on Avascan

PreviousThe Blue BadgeNextHow to setup your token marketcap

Last updated 2 years ago

Was this helpful?

If you'd like to verify contracts via our website, you may do so using the page.

With the Etherscan Compatible Verify Contract API, verify smart contract on Avascan is now more easy than ever. There are few things you need to connect your favorite verify contract client with Etherscan compatibility:

  1. Define the networkId: mainnet, testnet

  2. Retrieve the chainId of the evm compatible blockchain. You can use the .

  3. Compose the Etherscan Compatible API endpoint: https://api.avascan.info/v2/network/:networkId/evm/:chainId/etherscan

The following endpoints are provided only as an example:

Blockchain
API Endpoint (https)

C-Chain

mainnet

api.avascan.info/v2/network/mainnet/evm/43114/etherscan

Swimmer

mainnet

api.avascan.info/v2/network/mainnet/evm/73772/etherscan

C-Chain

testnet

api.avascan.info/v2/network/testnet/evm/43113/etherscan

WAGMI

testnet

api.avascan.info/v2/network/testnet/evm/11111/etherscan

hardhat-etherscan

, is an hardhat plugin, that simplify the smart contract verification process on Etherscan. With the Etherscan Compatible Verify Contract API, you can use this tool to verify your smart contract on Avascan as well.

Let's say you want to verify your smart contract on wagmi, this is an example of hardhat.config.ts:

import { HardhatUserConfig } from "hardhat/config";
import "@nomicfoundation/hardhat-toolbox";
import "@nomiclabs/hardhat-etherscan";

const config: HardhatUserConfig = {
  etherscan: {
    apiKey: {
      wagmi: "avascan", // apiKey is not required, just set a placeholder
    },
    customChains: [
      {
        network: "wagmi",
        chainId: 11111,
        urls: {
          apiURL: "https://api.avascan.info/v2/network/testnet/evm/11111/etherscan",
          browserURL: "https://testnet.avascan.info/blockchain/wagmi"
        }
      }
    ]

  },
  networks: {
    wagmi: {
      url: 'https://subnets.avax.network/wagmi/wagmi-chain-testnet/rpc',
      accounts: [process.env.PRIVATE_KEY]
    },
  },
};

export default config;

Deploy

npx hardhat run scripts/deploy.ts --network wagmi

Verify

export PRIVATE_KEY=...
npx hardhat verify --network wagmi 0x...

If you need any support just ask in our or our .

👩‍💻
Verify Contract
all blockchains page
hardhat-etherscan
Discord server
Telegram group