# \#hardhat

**URL:** https://forum.openzeppelin.com/tag/hardhat/56.md

[Latest](https://forum.openzeppelin.com/latest.md) · [Categories](https://forum.openzeppelin.com/categories.md) · [Tags](https://forum.openzeppelin.com/tags.md)

---

## [How to get 'exact code' verification for OpenZeppelin UUPS proxy contracts?](https://forum.openzeppelin.com/t/how-to-get-exact-code-verification-for-openzeppelin-uups-proxy-contracts/45037)

<div class="topic-metadata">

**Author:** [@m-elkhamisy](https://forum.openzeppelin.com/u/m-elkhamisy)\
**Replies:** 1\
**Last updated:** [October 29, 2025, 5:43pm UTC](https://forum.openzeppelin.com/t/how-to-get-exact-code-verification-for-openzeppelin-uups-proxy-contracts/45037 "2025-10-29T17:43:03Z")

</div>

Is there any way to get the “exact code” tag at the proxy? I am using hardhat “2.26.0” with “hardhat-verify” "2.0.1" :1234: Code to reproduce import { HardhatUserConfig } from "hardhat/config"; import "@nomicfounda…

---

## [prepareUpgrade with upgradeAndCall to upgrade proxy](https://forum.openzeppelin.com/t/prepareupgrade-with-upgradeandcall-to-upgrade-proxy/42787)

<div class="topic-metadata">

**Author:** [@matadorcro](https://forum.openzeppelin.com/u/matadorcro)\
**Replies:** 1\
**Last updated:** [January 8, 2025, 3:37pm UTC](https://forum.openzeppelin.com/t/prepareupgrade-with-upgradeandcall-to-upgrade-proxy/42787 "2025-01-08T15:37:58Z")

</div>

Hi using transparent proxy, and for example does upgrades plugin support upgrading to new implementation which is already deployed and address is known. I do not know if upgrades.prepareUpgrades is for this use-case? So …

---

## [Testing minting capabilities via Hardhat tests (npx hardhat test)](https://forum.openzeppelin.com/t/testing-minting-capabilities-via-hardhat-tests-npx-hardhat-test/41683)

<div class="topic-metadata">

**Author:** [@Izzy1](https://forum.openzeppelin.com/u/Izzy1)\
**Replies:** 5\
**Last updated:** [September 26, 2024, 12:02am UTC](https://forum.openzeppelin.com/t/testing-minting-capabilities-via-hardhat-tests-npx-hardhat-test/41683 "2024-09-26T00:02:59Z")

</div>

I created an ERC721A contract that imports OZ libraries to enhance my understanding of smart contracts using Hardhat and everything was smooth. The problem is in writing tests. I have been successful in writing tests for…

---

## [Deploying an ERC721 smart contract with 'address' constructor args using Hardhat](https://forum.openzeppelin.com/t/deploying-an-erc721-smart-contract-with-address-constructor-args-using-hardhat/41217)

<div class="topic-metadata">

**Author:** [@SherrKhaan](https://forum.openzeppelin.com/u/SherrKhaan)\
**Replies:** 5\
**Last updated:** [August 4, 2024, 9:28am UTC](https://forum.openzeppelin.com/t/deploying-an-erc721-smart-contract-with-address-constructor-args-using-hardhat/41217 "2024-08-04T09:28:34Z")

</div>

Hey guys, I am new to deploying contracts with constructor args. My problem: What should be passed as a constructor arg while using contracFactory.deploy() if my constructor contains an address type as an argument? In…

---

## [Upgradable contract deploying using hardhat ignition](https://forum.openzeppelin.com/t/upgradable-contract-deploying-using-hardhat-ignition/40372)

<div class="topic-metadata">

**Author:** [@nejmetm903](https://forum.openzeppelin.com/u/nejmetm903)\
**Replies:** 1\
**Last updated:** [May 3, 2024, 5:37pm UTC](https://forum.openzeppelin.com/t/upgradable-contract-deploying-using-hardhat-ignition/40372 "2024-05-03T17:37:50Z")

</div>

I have a contract like this: // SPDX-License-Identifier: MIT pragma solidity ^0.8.24; import "@openzeppelin/contracts-upgradeable/token/ERC721/ERC721Upgradeable.sol"; import "@openzeppelin/contracts-upgradeable/access/…

---

## [OpenZeppelin Upgrades: Step by Step Tutorial for Hardhat](https://forum.openzeppelin.com/t/openzeppelin-upgrades-step-by-step-tutorial-for-hardhat/3580)

<div class="topic-metadata">

**Author:** [@abcoathup](https://forum.openzeppelin.com/u/abcoathup)\
**Replies:** 39\
**Last updated:** [November 28, 2023, 9:54am UTC](https://forum.openzeppelin.com/t/openzeppelin-upgrades-step-by-step-tutorial-for-hardhat/3580 "2023-11-28T09:54:56Z")

</div>

OpenZeppelin Hardhat Upgrades Smart contracts deployed with the OpenZeppelin Upgrades plugins can be upgraded to modify their code, while preserving their address, state, and balance. This allows you to iteratively add…

---

## [My compiler says that the @openzeppelin contracts don't match the compiler!](https://forum.openzeppelin.com/t/my-compiler-says-that-the-openzeppelin-contracts-dont-match-the-compiler/22810)

<div class="topic-metadata">

**Author:** [@ShadowQueen639](https://forum.openzeppelin.com/u/ShadowQueen639)\
**Replies:** 5\
**Last updated:** [November 23, 2023, 1:22pm UTC](https://forum.openzeppelin.com/t/my-compiler-says-that-the-openzeppelin-contracts-dont-match-the-compiler/22810 "2023-11-23T13:22:34Z")

</div>

I'm trying to create my first smart contract. It's for ERC721 and I'm using Visual Studios. I have run into the same problem while trying to use 2 different programs (I tried to change programs when one wouldn't work and…

---

## [I cant log out my contract in a project](https://forum.openzeppelin.com/t/i-cant-log-out-my-contract-in-a-project/38230)

<div class="topic-metadata">

**Author:** [@Sanjidanahid\_Shorna](https://forum.openzeppelin.com/u/Sanjidanahid_Shorna)\
**Replies:** 9\
**Last updated:** [October 24, 2023, 3:33pm UTC](https://forum.openzeppelin.com/t/i-cant-log-out-my-contract-in-a-project/38230 "2023-10-24T15:33:00Z")

</div>

I am building web3 Todo app . I am building it using Next Js . I am trying to console log out my contract on console . So I have just build my smart contract . Now trying to make connection with my smart contract using w…

---

## [Hardhat upgrades not working because can't get pending block](https://forum.openzeppelin.com/t/hardhat-upgrades-not-working-because-cant-get-pending-block/37967)

<div class="topic-metadata">

**Author:** [@chrisr](https://forum.openzeppelin.com/u/chrisr)\
**Replies:** 1\
**Last updated:** [October 6, 2023, 10:16pm UTC](https://forum.openzeppelin.com/t/hardhat-upgrades-not-working-because-cant-get-pending-block/37967 "2023-10-06T22:16:26Z")

</div>

Hello, we are trying to deploy an upgradable contract to a private Polygon Edge node using @openzeppelin/hardhat-upgrades and we are getting the following error - fetching the pending header is not supported. When doing…

---

## [Setting nonce upon deployment in Hardhat](https://forum.openzeppelin.com/t/setting-nonce-upon-deployment-in-hardhat/37762)

<div class="topic-metadata">

**Author:** [@lalalei](https://forum.openzeppelin.com/u/lalalei)\
**Replies:** 2\
**Last updated:** [September 7, 2023, 9:20am UTC](https://forum.openzeppelin.com/t/setting-nonce-upon-deployment-in-hardhat/37762 "2023-09-07T09:20:19Z")

</div>

I created an ERC1155 with Hardhat v2.15 and deployed it to the mainnet. However, it got stuck in mempool due to very low gas price. I didn't notice I set it to 35 gwei when the network gas price was about ~200 gwei. Now…

---

## [Encountering BAD\_DATA when interacting with smart contract](https://forum.openzeppelin.com/t/encountering-bad-data-when-interacting-with-smart-contract/36712)

<div class="topic-metadata">

**Author:** [@lalalei](https://forum.openzeppelin.com/u/lalalei)\
**Replies:** 2\
**Last updated:** [June 16, 2023, 12:57am UTC](https://forum.openzeppelin.com/t/encountering-bad-data-when-interacting-with-smart-contract/36712 "2023-06-16T00:57:16Z")

</div>

I have an ERC-20 smart contract that I've created. I'm trying to deploy and interact with it locally using hardhat and ethers. Deployment is successful, however, I keep getting an error when interacting with it (scripts/…

---

## [I can't add liquidity from a router : Transaction has been reverted by the EVM](https://forum.openzeppelin.com/t/i-cant-add-liquidity-from-a-router-transaction-has-been-reverted-by-the-evm/36360)

<div class="topic-metadata">

**Author:** [@0xMente](https://forum.openzeppelin.com/u/0xMente)\
**Replies:** 5\
**Last updated:** [May 23, 2023, 3:03pm UTC](https://forum.openzeppelin.com/t/i-cant-add-liquidity-from-a-router-transaction-has-been-reverted-by-the-evm/36360 "2023-05-23T15:03:09Z")

</div>

Hello everyone, I tried to just copy-paste the UniswapV2 factory and UniswapV2 Router in order to learn how everything work but I have a problem : when I try to addLiquidity with 2 tokens, I can't... The error is : Tra…

---

## [How to handle two upgradable contracts in one repo?](https://forum.openzeppelin.com/t/how-to-handle-two-upgradable-contracts-in-one-repo/35763)

<div class="topic-metadata">

**Author:** [@Hirama](https://forum.openzeppelin.com/u/Hirama)\
**Replies:** 3\
**Last updated:** [April 24, 2023, 4:03pm UTC](https://forum.openzeppelin.com/t/how-to-handle-two-upgradable-contracts-in-one-repo/35763 "2023-04-24T16:03:04Z")

</div>

How to properly handle two upgradable contracts inside one repository. When I deploy both of them the Network Files are stored in one place. How to avoid such thing? :laptop: Environment Hardhat "@openzeppelin/contrac…

---

## [I can't add liquidity from the contract for testing with hardhat](https://forum.openzeppelin.com/t/i-cant-add-liquidity-from-the-contract-for-testing-with-hardhat/35799)

<div class="topic-metadata">

**Author:** [@0xMente](https://forum.openzeppelin.com/u/0xMente)\
**Replies:** 3\
**Last updated:** [April 19, 2023, 2:53pm UTC](https://forum.openzeppelin.com/t/i-cant-add-liquidity-from-the-contract-for-testing-with-hardhat/35799 "2023-04-19T14:53:39Z")

</div>

Hello everyone, I want to test some swap functions (swap my token for ETH). In order to do this, I want to test it using Hardhat. For swapping, it needs to have some liquidity so I have to provide liquidity and there is…

---

## [Cannot deploy ERC721 Upgradeable smart contract for NFT Marketplace](https://forum.openzeppelin.com/t/cannot-deploy-erc721-upgradeable-smart-contract-for-nft-marketplace/34885)

<div class="topic-metadata">

**Author:** [@Nirban](https://forum.openzeppelin.com/u/Nirban)\
**Replies:** 3\
**Last updated:** [March 9, 2023, 2:46pm UTC](https://forum.openzeppelin.com/t/cannot-deploy-erc721-upgradeable-smart-contract-for-nft-marketplace/34885 "2023-03-09T14:46:45Z")

</div>

Hello everyone I am trying to deploy my ERC721Upgradeable NFT Marketplace Smart Contracts in the local hardhat network but I am getting a error regarding it. I am using Openzeppelin's Upgradeable smart contracts to build…

---

## [How to call function of contract deployed to hardhat forking mainnet](https://forum.openzeppelin.com/t/how-to-call-function-of-contract-deployed-to-hardhat-forking-mainnet/33286)

<div class="topic-metadata">

**Author:** [@Turgay\_CABALAK](https://forum.openzeppelin.com/u/Turgay_CABALAK)\
**Replies:** 4\
**Last updated:** [January 11, 2023, 8:07am UTC](https://forum.openzeppelin.com/t/how-to-call-function-of-contract-deployed-to-hardhat-forking-mainnet/33286 "2023-01-11T08:07:42Z")

</div>

Hi everyone. I am trying to use my own contract's functions deployed to hardhat forking mainnet. To do that I have some steps like this: I added the forking configuration in hardhat.config.js networks: { hardhat: { …

---

## [OpenZeppelin contracts unable to import to HardHat using npm install @openzeppelin/contracts](https://forum.openzeppelin.com/t/openzeppelin-contracts-unable-to-import-to-hardhat-using-npm-install-openzeppelin-contracts/34021)

<div class="topic-metadata">

**Author:** [@GratefulZebra9](https://forum.openzeppelin.com/u/GratefulZebra9)\
**Replies:** 4\
**Last updated:** [December 31, 2022, 4:04am UTC](https://forum.openzeppelin.com/t/openzeppelin-contracts-unable-to-import-to-hardhat-using-npm-install-openzeppelin-contracts/34021 "2022-12-31T04:04:24Z")

</div>

I keep getting npm errors:

---

## [Error HH12: Trying to use a non-local installation of Hardhat, which is not supported. Please install Hardhat locally using npm or Yarn, and try again](https://forum.openzeppelin.com/t/error-hh12-trying-to-use-a-non-local-installation-of-hardhat-which-is-not-supported-please-install-hardhat-locally-using-npm-or-yarn-and-try-again/18880)

<div class="topic-metadata">

**Author:** [@Kelvin\_Okorie](https://forum.openzeppelin.com/u/Kelvin_Okorie)\
**Replies:** 7\
**Last updated:** [November 22, 2022, 10:05am UTC](https://forum.openzeppelin.com/t/error-hh12-trying-to-use-a-non-local-installation-of-hardhat-which-is-not-supported-please-install-hardhat-locally-using-npm-or-yarn-and-try-again/18880 "2022-11-22T10:05:24Z")

</div>

I've been working on a Hardhat project for sometime. After a while, when i run npx hardhat node to start the HH server, i get the error below. This is an image of the error I tried researching the error and found …

---

## [proposalVotes returns undefined](https://forum.openzeppelin.com/t/proposalvotes-returns-undefined/32975)

<div class="topic-metadata">

**Author:** [@Furkan\_Sezal](https://forum.openzeppelin.com/u/Furkan_Sezal)\
**Replies:** 3\
**Last updated:** [November 7, 2022, 5:08am UTC](https://forum.openzeppelin.com/t/proposalvotes-returns-undefined/32975 "2022-11-07T05:08:10Z")

</div>

I am building a dao by governance contract. When i making test, I make a propose everything worked great. After queue and execute first propose i start a second propose to undone what first propose do. This time i have …

---

## [How to manage the .openzeppelin file from a location other than the project root directory](https://forum.openzeppelin.com/t/how-to-manage-the-openzeppelin-file-from-a-location-other-than-the-project-root-directory/32163)

<div class="topic-metadata">

**Author:** [@bold](https://forum.openzeppelin.com/u/bold)\
**Replies:** 2\
**Last updated:** [October 6, 2022, 3:54pm UTC](https://forum.openzeppelin.com/t/how-to-manage-the-openzeppelin-file-from-a-location-other-than-the-project-root-directory/32163 "2022-10-06T15:54:30Z")

</div>

Hi, I'm part of an organization that runs private networks and use upgradeable contracts. Our smart contract dev environment uses hardhat, and the openzeppelin-upgrades plugin is great for checking for storage conflicts…

---

## [DeployProxy with HardHat on Local Network Error](https://forum.openzeppelin.com/t/deployproxy-with-hardhat-on-local-network-error/32178)

<div class="topic-metadata">

**Author:** [@fadzarie](https://forum.openzeppelin.com/u/fadzarie)\
**Replies:** 3\
**Last updated:** [October 4, 2022, 4:19pm UTC](https://forum.openzeppelin.com/t/deployproxy-with-hardhat-on-local-network-error/32178 "2022-10-04T16:19:49Z")

</div>

:laptop: Environment "@openzeppelin/hardhat-upgrades": "1.21.0", "hardhat": "^2.11.2" Hello Everybody, I'm trying to deploy my upgradeable contract using Hardhat/Ethers and Openzeppelin Upgrades and not able to deplo…

---

## [TransactionMinedTimeout \[Error\]: Timed out waiting for transaction](https://forum.openzeppelin.com/t/transactionminedtimeout-error-timed-out-waiting-for-transaction/22581)

<div class="topic-metadata">

**Author:** [@MGM](https://forum.openzeppelin.com/u/MGM)\
**Replies:** 4\
**Last updated:** [October 4, 2022, 1:48pm UTC](https://forum.openzeppelin.com/t/transactionminedtimeout-error-timed-out-waiting-for-transaction/22581 "2022-10-04T13:48:49Z")

</div>

Hey guys, I am getting the following error when trying to deploy my NFT.sol contract (It is basically an ERC721 with some added features) to mumbai testnet. I am working with hardhat: I have tried different gas sett…

---

## [Error: cannot estimate gas; transaction may fail or may require manual gas limit UNPREDICTABLE\_GAS\_LIMIT](https://forum.openzeppelin.com/t/error-cannot-estimate-gas-transaction-may-fail-or-may-require-manual-gas-limit-unpredictable-gas-limit/32166)

<div class="topic-metadata">

**Author:** [@luislucena](https://forum.openzeppelin.com/u/luislucena)\
**Replies:** 0\
**Last updated:** [September 30, 2022, 7:08pm UTC](https://forum.openzeppelin.com/t/error-cannot-estimate-gas-transaction-may-fail-or-may-require-manual-gas-limit-unpredictable-gas-limit/32166 "2022-09-30T19:08:27Z")

</div>

Hi guys, I have this error when I try to deploy with Fuji and also with a Subnet, but using Hardhat local node I have no problems. I have tried different options. Here is my hardhat.config.js with the configuration I hav…

---

## [Why \`transferOwnership\` is not a function since I also inherited \`Ownable\` in contract](https://forum.openzeppelin.com/t/why-transferownership-is-not-a-function-since-i-also-inherited-ownable-in-contract/31583)

<div class="topic-metadata">

**Author:** [@Rishabh](https://forum.openzeppelin.com/u/Rishabh)\
**Replies:** 3\
**Last updated:** [September 6, 2022, 8:16pm UTC](https://forum.openzeppelin.com/t/why-transferownership-is-not-a-function-since-i-also-inherited-ownable-in-contract/31583 "2022-09-06T20:16:49Z")

</div>

I am following the challenges from the speedrunEthereum and right now I am stuck on challenge 2 and not getting why the transferOwnership is not a function since I am also inheriting the Ownable from openzeppelin. pragm…

---

## [InvalidDeployment \[Error\]: No contract at address 0x9..... (Removed from manifest): Openzeppelin-hardhat-upgrades](https://forum.openzeppelin.com/t/invaliddeployment-error-no-contract-at-address-0x9-removed-from-manifest-openzeppelin-hardhat-upgrades/31201)

<div class="topic-metadata">

**Author:** [@Prometheo](https://forum.openzeppelin.com/u/Prometheo)\
**Replies:** 1\
**Last updated:** [August 16, 2022, 4:26pm UTC](https://forum.openzeppelin.com/t/invaliddeployment-error-no-contract-at-address-0x9-removed-from-manifest-openzeppelin-hardhat-upgrades/31201 "2022-08-16T16:26:45Z")

</div>

I am trying to deploy an upgradeable contract to the Aurora netowork with openzeppelin upgrades plugin, i am able to deploy successfully to the testnet, but i encounter the following error while trying to deploy on mainn…

---

## [Upgrades + hardhat-truffle5](https://forum.openzeppelin.com/t/upgrades-hardhat-truffle5/30883)

<div class="topic-metadata">

**Author:** [@arthurka.eth](https://forum.openzeppelin.com/u/arthurka.eth)\
**Replies:** 4\
**Last updated:** [August 11, 2022, 10:12pm UTC](https://forum.openzeppelin.com/t/upgrades-hardhat-truffle5/30883 "2022-08-11T22:12:54Z")

</div>

Hi everyone :wave: Hope you're having a great day. TL;DR: is it possible to use OpenZeppelin Upgrades plugin with @nomiclabs/hardhat-truffle5 and not make changes in tests? I'm working with a fork of some protocol. Pro…

---

## [What is this field in my rinkeby.json network file](https://forum.openzeppelin.com/t/what-is-this-field-in-my-rinkeby-json-network-file/25448)

<div class="topic-metadata">

**Author:** [@Maham\_Zaidi](https://forum.openzeppelin.com/u/Maham_Zaidi)\
**Replies:** 3\
**Last updated:** [July 11, 2022, 6:25pm UTC](https://forum.openzeppelin.com/t/what-is-this-field-in-my-rinkeby-json-network-file/25448 "2022-07-11T18:25:07Z")

</div>

Hi. I am using hardhat upgrades plugin to deploy my proxy, proxy admin and implementation contract. Afterwards, I use a script to extract the addresses of all the deployed contracts from the generated rinkeby.json file i…

---

## [Got an hardhat error while trying to upgrade contract](https://forum.openzeppelin.com/t/got-an-hardhat-error-while-trying-to-upgrade-contract/29651)

<div class="topic-metadata">

**Author:** [@Aratap](https://forum.openzeppelin.com/u/Aratap)\
**Replies:** 2\
**Last updated:** [June 18, 2022, 3:09pm UTC](https://forum.openzeppelin.com/t/got-an-hardhat-error-while-trying-to-upgrade-contract/29651 "2022-06-18T15:09:23Z")

</div>

I was following this article but i stuck at upgrading contract an got this error /Users/patarapichairat/Desktop/solidity/testupgrade/node\_modules/hardhat/src/internal/core/providers/http.ts:78 const error = new Pr…

---

## [How to call contract functions on the user's behalf with hardhat?](https://forum.openzeppelin.com/t/how-to-call-contract-functions-on-the-users-behalf-with-hardhat/29374)

<div class="topic-metadata">

**Author:** [@greentriangles1](https://forum.openzeppelin.com/u/greentriangles1)\
**Replies:** 3\
**Last updated:** [June 7, 2022, 8:51am UTC](https://forum.openzeppelin.com/t/how-to-call-contract-functions-on-the-users-behalf-with-hardhat/29374 "2022-06-07T08:51:46Z")

</div>

Eg, suppose I want to test the approve() functionality with hardhat. The function assumes the caller is the wallet owner - how can I call the function on behalf of another user?

---

## [Can't get balanceOf with deployed ERC20](https://forum.openzeppelin.com/t/cant-get-balanceof-with-deployed-erc20/29359)

<div class="topic-metadata">

**Author:** [@Matthias](https://forum.openzeppelin.com/u/Matthias)\
**Replies:** 2\
**Last updated:** [June 5, 2022, 10:12am UTC](https://forum.openzeppelin.com/t/cant-get-balanceof-with-deployed-erc20/29359 "2022-06-05T10:12:42Z")

</div>

Hello Everyone! I deployed an ERC20 contract and but I can't access balance with ERC20instance.balanceOf( ). To get an instance of the ERC20 contract I used: ERC20instance = new ethers.Contract(address, abi, signer) …

[Next page](https://forum.openzeppelin.com/tag/hardhat/56.md?match_all_tags=true&page=1&tags%5B%5D=hardhat)
