Hardhat upgrades issues

< im getting this error when trying to deploy and compile my ERC721UUPS upgradbale contract in hardhat
im running
npx hardhat run scripts/deploy.js --network localhost
Error HH404: File @openzeppelin/contracts/security/ReentrancyGuard.sol, imported from contracts/NFTV1.sol, not found.

For more info go to https://hardhat.org/HH404 or run Hardhat with --show-stack-traces
PS C:\Users\dillo\hardhatupgradesnewest> -->

:1234: Code to reproduce

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.20;

import "@openzeppelin/contracts-upgradeable/token/ERC20/ERC20Upgradeable.sol";
import "@openzeppelin/contracts-upgradeable/token/ERC20/extensions/ERC20BurnableUpgradeable.sol";
import "@openzeppelin/contracts-upgradeable/token/ERC20/extensions/ERC20PausableUpgradeable.sol";
import "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol";
import "@openzeppelin/contracts-upgradeable/token/ERC20/extensions/ERC20PermitUpgradeable.sol";
import "@openzeppelin/contracts-upgradeable/token/ERC20/extensions/ERC20VotesUpgradeable.sol";
import "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";
import "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol";

contract ERC20V1 is Initializable, ERC20Upgradeable, ERC20BurnableUpgradeable, ERC20PausableUpgradeable, OwnableUpgradeable, ERC20PermitUpgradeable, ERC20VotesUpgradeable, UUPSUpgradeable {

    /// @custom:oz-upgrades-unsafe-allow constructor
    constructor() {

    function initialize(address initialOwner) initializer public {
        __ERC20_init("Version1", "V1");

        _mint(msg.sender, 1000 * 10 ** decimals());

    // Minting function allows the owner to create new tokens and assign them to a specific address.
    function mint(address to, uint256 amount) public onlyOwner {
        _mint(to, amount);

    // A function for transferring ownership of the contract.
    function transferOwnership(address newOwner) public override onlyOwner {

    // Pause and unpause the token transfers, useful for emergency situations.
    function pause() public onlyOwner {

    function unpause() public onlyOwner {

    // Override the upgrade authorization function to allow only the owner to upgrade.
    function _authorizeUpgrade(address newImplementation) internal onlyOwner override {}

    // The following functions are overrides required by Solidity.
    function _update(address from, address to, uint256 value) internal override(ERC20Upgradeable, ERC20PausableUpgradeable, ERC20VotesUpgradeable) {
        super._update(from, to, value);

    function nonces(address owner) public view override(ERC20PermitUpgradeable, NoncesUpgradeable) returns (uint256) {
        return super.nonces(owner);
module.exports = {
  solidity: {
    version: "0.8.22", // Add other versions as needed
    settings: {
      outputSelection: {
        "*": {
          "*": ["*"],
  paths: {
    sources: "./contracts", // This should point to your "contracts" directory.
  networks: {
    localhost: {
      chainId: 31337, // Set the chain ID to 31337 for your local network.
     songbird: {
      gas: "auto",
      gasPrice: "auto",
      gasMultiplier: 1,

      url: "https://sgb.ftso.com.au/ext/bc/C/rpc",
      chainId: 19,

      accounts: [ACCOUNT],
    goerli: {
      gas: "auto",
      gasPrice: "auto",
      gasMultiplier: 1,

      url: "https://ethereum-goerli.publicnode.com",
      chainId: 5,

      accounts: [ACCOUNT],
  "name": "hardhatupgradesnewest",
  "version": "1.0.0",
  "description": "",
  "main": "index.js",
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1"
  "keywords": [],
  "author": "",
  "license": "ISC",
  "devDependencies": {
    "@nomicfoundation/hardhat-ethers": "^3.0.4",
    "@openzeppelin/hardhat-upgrades": "^2.3.3",
    "ethers": "^6.8.1",
    "hardhat": "^2.19.0"
  "dependencies": {
    "@openzeppelin/contracts-upgradeable": "^5.0.0"
const { ethers, upgrades } = require("hardhat");

async function main() {
  try {
    // Deploying the initial contract
    const Box = await ethers.getContractFactory("NFTV1");
    console.log("Creating a contract factory for Test", await Box );

    const box = await upgrades.deployProxy(Box, ["0x2546BcD3c84621e976D8185a91A922aE77ECEc30"], { kind: 'uups' });
    console.log("Deploying proxy contract for Test");

    await box.waitForDeployment();
    console.log("Box deployed to:", await box.getAddress());

  } catch (error) {
    console.error("Error:", error);


:computer: Environment

Hi, you got this issue is because your smart contract is ERC20V1 and you tried to get a contract with name NFTV1, either you use const Box = await ethers.getContractFactory("ERC20V1"); or change the name of your contract from ERC20V1 to NFTV1

In your package.json, you have specified @openzeppelin/contracts-upgradeable as a dependency

However, you don't have @openzeppelin/contracts specified. Since 5.0.0, @openzeppelin/contracts-upgradeable has a peer dependency on @openzeppelin/contracts. You probably ignored a warning about this missing dependency.

Just adding "@openzeppelin/contracts": "^5.0.0" to your dependencies will probably fix the issue.