Trouble Testing OpenZeppelin ERC20 Smart Contract with Hardhat: Error HH700

Hello OpenZeppelin community,

I hope this message finds you well. I've been exploring the OpenZeppelin Contracts library and recently encountered a challenge while attempting to test one of their ERC20 smart contracts using the Hardhat testing suite.

Here are the steps I followed:

  1. Cloned the OpenZeppelin Contracts repository from GitHub.

  2. Ran the commands yarn install and yarn add @nomicfoundation/hardhat-verify@^1.0.0 "@types/mocha@>=9.1.0" "@typechain/ethers-v6@^0.4.0" "@typechain/hardhat@^8.0.0" "ethers@^6.4.0" "ts-node@>=8.0.0" "typechain@^8.2.0" "typescript@>=4.5.0"

  3. Navigated to the test/token/ERC20/ directory.

  4. Attempted to run the test with the command: npx hardhat test ERC20.test.js.

However, I encountered the following error:

Error HH700: Artifact for contract "$ERC20" not found

I've double-checked my steps and dependencies, but I can't seem to figure out what's causing this issue. Has anyone else experienced a similar problem or can provide guidance on how to resolve this artifact-related error?

Your assistance would be greatly appreciated!

Thank you in advance for your time and support

Executing npm run compile from the top-level directory of the project might solve the problem.

This is missing a lot of dependencies. In particular, $ERC20 is produced by hardhat-exposed

Note that the hardhat.config.js should not be happy with this plugin missing, and should give an error before the tests even start.