0
// contracts/OurToken.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

import "@openzeppelin/contracts/token/ERC20/ERC20.sol";

contract OurToken is ERC20 {
constructor(uint256 initialSupply) ERC20("tkname", "tkn") {
    _mint(msg.sender, initialSupply);
    }
 }

this are my helpful-scripts py

dependencies:
  - OpenZeppelin/openzeppelin-contracts@4.2.0
compiler:
  solc:
    remappinigs:
      - '@openzeppelin=OpenZeppelin/openzeppelin-contracts@4.2.0'
dotenv: .env
wallets:
  from_key: ${PRIVATE_KEY}

error ParserError: Source "@openzeppelin/contracts/token/ERC20/ERC20.sol" not found: File not found. Searched the following locations: "". --> contracts/OurToken.sol:5:1: | 5 | import "@openzeppelin/contracts/token/ERC20/ERC20.sol"; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

1 Answer 1

1

seems like you are simply just missing to install the OpenZeppelin library in your project. To fix the issue, you can simply run the following command

npm install @openzeppelin/contracts

Try to check whether you can find any @openzeppelin folder under node_modules. If there is, then the import should not fail.

Hope this helps~

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.