Request for Assistance with Testing ERC20 Smart Contract Using OpenZeppelin Test Suite

Hello,
I am reaching out to seek your assistance with a technical issue I encountered while attempting to test a classic ERC20 smart contract using the test suite provided by OpenZeppelin in the openzeppelin-contracts/test/token/ERC20/ directory.

To give it a try, I cloned the repository and installed the necessary dependencies, including @openzeppelin/test-helpers, @nomiclabs/hardhat-web3, and web3. However, I am currently facing the following error:

"TypeError: Web3 is not a constructor" in the file openzeppelin-contracts/node_modules/@nomiclabs/hardhat-web3/src/index.ts

I have been unable to identify the root cause of this error and resolve it on my own. As a result, I am kindly seeking guidance from the knowledgeable members of this forum who may have encountered a similar issue or possess expertise in working with OpenZeppelin and hardhat-web3.

If anyone has successfully tested ERC20 contracts using OpenZeppelin's test suite and has insights into troubleshooting this particular error, I would greatly appreciate your assistance. Any advice, recommendations, or steps to resolve the issue would be invaluable to me.

Thank you in advance for your time and support

Did you run yarn install or npm install from the path of your local folder?

Looking for complicated solutions I forgot the simplest one, thanks!

2 Likes