0

I am trying to verify my deployed contract from truffle and getting "Etherscan has no support for network sepolia with chain id 11155111" error. So I am working with Etherscan and I deployed my contract on sepolia testnet.

How can I solve this problem?

My truffle-config.js


const apikeys = require("./chains/apikeys");
const keys = require("./keys.json");

module.exports = { 
  
  plugins: ["truffle-plugin-verify"],
  api_keys:{
    etherscan: "myApiEtherScan"
  },
  contracts_build_directory: "./public/contracts",
  networks: {
    
     development: {
      host: "127.0.0.1",    
      port: 7545,            
     network_id: "*",     
     },
    sepolia: {
      provider: () => 
      new HDWalletProvider(
        keys.PRIVATE_KEY,
        keys.INFURA_SEPOLIA_URL,       
      ),
      network_id: 11155111,
      gas:5221975,
      gasPrice:20000000000,
      confirmations: 3,
      timeoutBlocks:200,
      skipDryRun: true
    }
  },

  compilers: {
    solc: {
      version: "0.8.16",
      settings: {
        optimizer: {
        enabled: true, // Default: false
        runs: 1000 // Default: 200
        }
        }       
    }
  },

 
};

1 Answers1

0

Plugin truffle-plugin-verify doesn't have Sepolia chain support

I added the sepolia api url and etherscan url to constants and it works

const API_URLS = {
...
11155111: 'https://api-sepolia.etherscan.io/api',
...
}

const EXPLORER_URLS = {
...
11155111: 'https://sepolia.etherscan.io/address',
...
}

https://github.com/tafonina/truffle-plugin-verify