# A problem deploying the ERC721 contract

**URL:** <https://forum.openzeppelin.com/t/a-problem-deploying-the-erc721-contract/37613>\
**Category:** Smart Contracts\
**Tags:** erc721\
**Created:** [August 25, 2023, 7:29pm UTC](https://forum.openzeppelin.com/t/a-problem-deploying-the-erc721-contract/37613 "2023-08-25T19:29:25Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![erfan5416](https://avatars.discourse-cdn.com/v4/letter/e/3ec8ea/32.png) [@erfan5416](https://forum.openzeppelin.com/u/erfan5416)\
**Post date:** [August 25, 2023, 7:29pm UTC](https://forum.openzeppelin.com/t/a-problem-deploying-the-erc721-contract/37613/1 "2023-08-25T19:29:25Z")

</div>

this is my contract:

```auto
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.17;

import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721URIStorage.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/Counters.sol";

contract Franklin is ERC721 , ERC721URIStorage , Ownable 
{
 using Counters for Counters.Counter;
 Counters.Counter private _tokenIdCounter;

 constructor() ERC721("Franklin","FRK"){}

  function _baseURI() internal pure override returns (string memory) {
        return "https://example.com/nft/";
    }
 
 function safeMint(address to, string memory uri) public onlyOwner {
        uint256 tokenId = _tokenIdCounter.current();
        _tokenIdCounter.increment();
        _safeMint(to, tokenId);
        _setTokenURI(tokenId, uri);
    }

     function _burn(uint256 tokenId) internal override(ERC721, ERC721URIStorage) {
        super._burn(tokenId);
    }

    function tokenURI(uint256 tokenId)
        public
        view
        override(ERC721, ERC721URIStorage)
        returns (string memory)
    {
        return super.tokenURI(tokenId);
    }

    function supportsInterface(bytes4 interfaceId) public view virtual override(ERC721,ERC721URIStorage) returns (bool) {
        return interfaceId == type(IERC165).interfaceId;
    }
}

```

and this is hardhat.config.js:

```auto
require("@nomicfoundation/hardhat-toolbox");

module.exports = {
  solidity: "0.8.17",
  networks: {
    mumbai: {
      url: "https://rpc-mumbai.maticvigil.com",
      accounts: ["my private key"]
    }
  }
};

```

and this is deploying file(deploy.js):

```auto
async function main()
{
  async function main() {

    const nft = await ethers.deployContract("Franklin",["FRK"]);
  
    await nft.waitForDeployment();
  
    console.log("SimpleStorage Contract Address:", await nft.getAddress());
  
    await nft.mint("https://ipfs.io/ipfs/QmWLSYkLAdFLL8UJeVST75V3sbuUwg5Jhs1eoFrnWr6BK7");
    console.log("NFT Success mint!");
  }
  
  main()
    .then(() => process.exit(0))
    .catch((error) => {
      console.error(error)
      process.exit(1)
    })
}

```

When I type the following code, my contract is not deployed and no error is given, and it is exactly as follows:

```auto
PS C:\Users\D-W\Desktop\franklin> npx hardhat run scripts/deploy.js
PS C:\Users\D-W\Desktop\franklin>

```

what's the solution?

---

<div class="post-metadata">

**Author:** ![sachin\_bisht](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.openzeppelin.com/sachin_bisht/32/17036_2.png) [@sachin\_bisht](https://forum.openzeppelin.com/u/sachin_bisht)\
**Post date:** [August 26, 2023, 9:25am UTC](https://forum.openzeppelin.com/t/a-problem-deploying-the-erc721-contract/37613/2 "2023-08-26T09:25:48Z")

</div>

```auto
  async function main() {

    const nft = await ethers.deployContract("Franklin",["FRK"]);
  
    await nft.waitForDeployment();
  
    console.log("SimpleStorage Contract Address:", await nft.getAddress());
  
    await nft.mint("https://ipfs.io/ipfs/QmWLSYkLAdFLL8UJeVST75V3sbuUwg5Jhs1eoFrnWr6BK7");
    console.log("NFT Success mint!");
  }

  main()
    .then(() => process.exit(0))
    .catch((error) => {
      console.error(error)
      process.exit(1)
    })

```
