matter-labs/hardhat-zksync

The version 0.2.0 of the verify package don't let me compile - @matterlabs/hardhat-zksync-verify

ogarciarevett opened this issue · 3 comments

Hi guys! I was updating my libs, at the moment that pushed the verify version from the 0.1.8 to the latest version **(0.2.0) ** the compile cmd throw me this error:

Screenshot 2023-10-14 at 20 39 38

This is the code of my config

import '@matterlabs/hardhat-zksync-solc';
import '@matterlabs/hardhat-zksync-deploy';
import '@matterlabs/hardhat-zksync-verify';

import defaultConfig from './configs/hardhat.config';
import { NetworkName } from './constants';
import { log } from '@helpers/logger';

const { PRIVATE_KEY } = process.env;
if (!PRIVATE_KEY) {
  throw new Error('MantleConfig: The private key is required');
}

log(`Using ZkSync config`);

defaultConfig.networks = {
  ...defaultConfig.networks,
  [NetworkName.ZkSync]: {
    url: 'https://mainnet.era.zksync.io',
    ethNetwork: 'mainnet',
    zksync: true,
    accounts: [PRIVATE_KEY],
    verifyURL: 'https://zksync2-mainnet-explorer.zksync.io/contract_verification',
  },
  [NetworkName.ZkSyncTestnet]: {
    url: 'https://zksync2-testnet.zksync.dev',
    ethNetwork: 'goerli',
    zksync: true,
    accounts: [PRIVATE_KEY],
    verifyURL: 'https://zksync2-testnet-explorer.zksync.dev/contract_verification',
  },
};

defaultConfig.zksolc = {
  version: 'latest',
  settings: {},
};

// empty to use the verifyURL from the network config
defaultConfig.etherscan = {};
export default defaultConfig;

Doing rollback to the 0.1.8 fix everything.

The problem is that @matterlabs/hardhat-zksync-verify from version 0.2.0 is dependent on @nomicfoundation/hardhat-verify instead of @nomiclabs/hardhat-etherscan. To avoid task conflicts we must delete the import @nomiclabs/hardhat-etherscan. I assume that you import @nomiclabs/hardhat-etherscan from './configs/hardhat.config'.

Nice, probably adding the "deps" to the package.json of the @matterlabs/hardhat-zksync-verify will avoid this confussions

Adding the dependencies to the verification file could improve the DEVX in this cases, thanks @kiriyaga for the debug!