scaffold-eth / scaffold-eth-2

Open source forkable Ethereum dev stack
https://scaffoldeth.io
MIT License
1.41k stars 887 forks source link

Make verifying contracts possible not only for mainnet and mainnet testnets #965

Open rin-st opened 1 month ago

rin-st commented 1 month ago

To make verify possible on other networks/testnets, hardhat config should be updated like below

...
baseSepolia: {
      url: "https://sepolia.base.org",
      accounts: [deployerPrivateKey],
      verify: {
        etherscan: {
          apiUrl: "https://api-sepolia.basescan.org",
          apiKey: process.env.ETHERSCAN_API_KEY_BASE,
        },
      },
    },
...

so yarn verify --network baseSepolia will work.

Make the same for all other networks in hardhat config

note 1: we can verify contracts using flags yarn verify --network baseSepolia --api-url <API_URL> --api-key <API_KEY> but it's very inconvenient note 2: to make yarn hardhat:verify work, see docs . Better in separate PR

rin-st commented 3 weeks ago

Wait to this to be out of beta