Import "@openzeppelin/contracts/token/ERC20.sol" issue

Hello there! I am developing a smart contract but have the same issue with importing files for contract.sol. Someone, please, help me to understand about import. I am learning developer smart contract. I am using hardhat, react, solidity and openzeppeli. Thanks!

Source "@openzeppelin/contracts/token/ERC20/ERC20.sol" not found: File not found. Searched the following locations: "/home/lucasmoraes2024/web3/amoy/.", "/home/lucasmoraes2024/web3/amoy/node_modules", "/home/lucasmoraes2024/.vscode-server/data/User/globalStorage/ackeeblockchain.tools-for-solidity/wake-conda/lib/python3.10/site-packages/contracts".Wake(solc)(6275)

Hi, welcome to the community! :wave:

So have you installed the dependency? Try npm install @openzeppelin/contracts

I was using Hardhat so I tried on Foundry and the issue did not happen again, thanks!

1 Like