Skip to main content
The 2024 Developer Survey results are live! See the results

Questions tagged [hardhat]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0 votes
1 answer
9 views

Unable to Execute VRF 2.5 Function in solidity

Im building a candle auction smart contract for my internship assignment, for getting complete random end time of the auction I'm using random number generator from chainlink. However when executing ...
Rohit Jambhulkar's user avatar
0 votes
0 answers
13 views

Hardhat returning incorrect call results in chai tests

I'm currently facing a problem with hardhat tests, where the result of a call to a contract in the test returns incorrect results. The following contract is an example of where this might occur: // ...
Riley's user avatar
  • 1
0 votes
1 answer
9 views

Invalid value undefined for HardhatConfig.networks.sepolia.url - Expected a value of type string

the code is * @type import('hardhat/config').HardhatUserConfig **/ require ("dotenv").config(); require ("@nomiclabs/hardhat-ethers"); const { API_URL, PRIVATE_KEY } = process....
ritesh kumar's user avatar
0 votes
1 answer
15 views

Problem in contract deployment in testnet using hardhat

I am trying to deploy my smart contract in the bnb testnet in the deploy script, this is my deploy script: const { Web3 } = require('web3'); const artifacts = require('../artifacts/contracts/...
Ali's user avatar
  • 65
0 votes
0 answers
24 views

ERC721InsufficientApproval after using setApprovalForAll

In my Hardhat project, I'm trying to send an NFT between a bunch of different addresses (for fun). I've been doing it this way: const myAddress = "0x06b0ED5338e36623b859081B0692F7dE33aF67E5&...
Aaron's user avatar
  • 23
0 votes
1 answer
22 views

Error: VM Exception while processing transaction: reverted with reason string 'Insufficient balance'

contract functions function depositEarnest(uint nftId,bool rent) public payable { require(isListed[nftId],"Property is already sold"); require(tenant[nftId]==address(0),&...
soumyadeep.eth's user avatar
0 votes
1 answer
42 views

Error: Timeout of 900000ms exceeded. For async tests and hooks, ensure "done()" is called; if returning a Promise, ensure it resolves

I'm encountering a timeout error while running a unit test for my Lottery smart contract using Hardhat. The error occurs during the test case that involves picking a winner, resetting the lottery, and ...
ALISHA REDDY's user avatar
0 votes
1 answer
16 views

Error: call revert exception in Hardhat test for Lottery Contract

I'm encountering an issue while running unit tests for my Lottery smart contract using Hardhat. The error occurs during the "before each" hook, specifically when trying to call the '...
ALISHA REDDY's user avatar
0 votes
2 answers
16 views

TypeError: Cannot read properties of undefined (reading 'parseEther')

const { ethers } = require("hardhat") const { time } = require("@nomicfoundation/hardhat-network-helpers"); describe("Escrow", function () { let Escrow; let escrow; ...
soumyadeep.eth's user avatar
0 votes
1 answer
41 views

ZkSync contract deploy error execution reverted (unknown custom error)

I am trying to make a multisig contract account on zksync. Here is my AAFactory.sol // SPDX-License-Identifier: MIT pragma solidity ^0.8.20; import {DEPLOYER_SYSTEM_CONTRACT} from "@matterlabs/...
Extra_Caterpillar's user avatar
0 votes
1 answer
51 views

TypeError: unsupported addressable value (argument="target", value=null, code=INVALID_ARGUMENT, version=6.13.1)

I'm getting the following error while trying to test whether addresses. const { expect } = require('chai'); const { ethers } = require('hardhat'); const tokens = (n) => { return ethers.utils....
Chandima Maduwantha's user avatar
0 votes
1 answer
11 views

Error uploading file: Cannot read properties of undefined (reading 'add')

const ImgHash = `https://gateway.pinata.cloud/ipfs/${resFile.data.IpfsHash}`; // Correcting the contract call await contract.add(account, ImgHash); alert("...
Ankon Ahamed's user avatar
1 vote
0 answers
18 views

What are the most active open-source Ethereum blockchain projects suitable for beginner-level contributors?

I'm looking to get involved in the open-source Ethereum blockchain community and would love to contribute to active projects. As a beginner, I'm seeking projects that are not only welcoming to new ...
Harigovind M G's user avatar
0 votes
2 answers
55 views

Getting error of "InvalidConsumer()"

While trying to test the script it is giving me the following error: Error: VM Exception while processing transaction: reverted with custom error 'InvalidConsumer()' Here is the GitHub repo of my ...
Jimit's user avatar
  • 7
0 votes
1 answer
24 views

Localhost Hardhat price fetching

I’m trying to get the price during a hardhat test and I don't think it’s fetching the right address. What I want to do is to test that it’s actually getting the values. How can I do this? Is it even ...
Peponeto's user avatar
0 votes
1 answer
29 views

Getting Error "expected 0 constructor arguments, got 6"

While running the command yarn hardhat deploy it is giving me following error Error: expected 0 constructor arguments, got 6 Deploy Script const {network} = require("hardhat"); ...
Jimit's user avatar
  • 7
1 vote
0 answers
15 views

How do i deploy TransparentUpgradeableProxy in frontend?

I deployed the logic/implementation contract now I want to deploy TransparentUpgradeableProxy that points to the logic/implementation contract stack that I'm using Etherjs and VueJs I tried to do ...
Farrell's user avatar
  • 11
0 votes
1 answer
16 views

Hardhat error TS6046: Argument for '--module' option must be: 'none', 'commonjs', 'amd', 'system', 'umd', 'es6', 'es2015', 'es2020', 'esnext'

Im having a problem with a repository. Whenever i try and run any hardhat command i get the below error. user@users-MacBook-Pro internal-repo % node --version v16.20.2 user@users-MacBook-Pro internal-...
CathalMF's user avatar
  • 283
0 votes
1 answer
25 views

TypeError: chai.deployed is not a function

Error: PS D:\SimpleStorage> npx hardhat run scripts/deploy.js TypeError: chai.deployed is not a function at main (D:\SimpleStorage\scripts\deploy.js:11:16) PS D:\SimpleStorage> deploy.js: ...
Ankon Ahamed's user avatar
0 votes
0 answers
26 views

Can't set tokenURI for ERC721 token despite safeMint having the parameter

in my Solidity smart contract (MyNFT.sol), I have the following function: function safeMint(address to, string memory uri) public onlyOwner { uint256 tokenId = _nextTokenId++; ...
Aaron Shey's user avatar
0 votes
1 answer
104 views

Getting TypeError: invalid BytesLike value (argument="value", value=[ ], code=INVALID_ARGUMENT, version=6.13.1) while testing a function

Here is my github repo link: https://github.com/Jimit1512/Lottery. And, I'm getting the following error while trying to test whether the Raffle is open or not. Here' the code of my test file: const { ...
Jimit's user avatar
  • 3
0 votes
0 answers
41 views

Needs help running a Hardhat-based smart contract and it's test script on Hyperledger Besu

First, I am using the binary distribution of Hyperledger Besu on Ubuntu 22.04 LTS. Second, I do not want to use the quorum quickstart for Besu. The reason being, I need a minimum of 20 accounts with ...
Soumik Mandal's user avatar
0 votes
1 answer
34 views

How to bypass confirm prompt when deploying smart contracts through Hardhat Ignition?

I am deploying smart contracts using Hardhat Ignition , the new declarative way of deploying smart contracts using Hardhat. When calling npx hardhat ignition deploy ignition/modules/ERC2771Forwarder....
Gaurav Pant's user avatar
0 votes
1 answer
24 views

Error: invalid solidity type!: tuple

I have an error code while doing unit testing to a contract: Error: invalid solidity type!: tuple The line that throw the error is: const negotiation = await this.negotiations.allNegotiations("0&...
WP Smart Contracts's user avatar
0 votes
1 answer
17 views

Too Many Arguments Error in Hardhat Test for NFT Marketplace Contract

I'm encountering an issue with my Hardhat test for an NFT marketplace contract, where I'm getting this error while calling the buyItem function in my test file: Nft Marketplace Unit Tests ...
ragz's user avatar
  • 3
0 votes
1 answer
25 views

Error: VM Exception while processing transaction: reverted with reason string 'SafeERC20: low-level call failed'

// hardhat.config.js require("hardhat-deploy") require("dotenv").config() require("@nomicfoundation/hardhat-ethers"); require("@nomiclabs/hardhat-etherscan"); ...
Pratik Dubariya's user avatar
0 votes
0 answers
23 views

MAX TOTAL SUPPLY ON ETHERSCAN IS 0

I deployed my token to MetaMask and it did not reflect the token name or the decimal. I manually had to input it. After I deployed to etherscan it is showing MAX TOTAL SUPPLY: 0 HOLDERS 0 TOTAL ...
Kwesili Okafor's user avatar
0 votes
1 answer
43 views

hardhat upgradeProxy can not deploy new contract. implement contract is extreme old contract

When use upgradeProxy in some of chains(Polygon main, Manta etc) some of chains worked. They can upgrade and deploy a new implement contract. But sometimes, when I run upgradeProxy, my new implement ...
AndrewZzzz's user avatar
0 votes
1 answer
31 views

For hardhat-deploy, How to upgrade contract

I can upgrade my contract with hardhat/upgrades. However, if I want to upgrade my contract with hardhat-deploy. How to deal with it? I just want to upgrade my contract deployed before. const ...
AndrewZzzz's user avatar
0 votes
1 answer
29 views

Error: Cannot read properties of undefined (reading 'getBalance')

hello guys im running into an error Cannot read properties of undefined (reading 'getBalance') const { ethers, deployments, getNamedAccounts } = require("hardhat") const { expect, assert } = ...
vatsal sharma's user avatar
0 votes
0 answers
16 views

deployer not defined error in smartcontract

hello guys there is an error deployer not defined could you help me finding the error? I have defined deployer in hardhat.config.js whose code i have pasted below and i have commented where deployer ...
vatsal sharma's user avatar
0 votes
1 answer
47 views

AssertionError: Expected transaction to be reverted with reason 'ERC20: transfer amount exceeds balance', but it reverted with a custom error

it("Should fail if sender doesn't have enough tokens", async function () { const initialOwnerBalance = await polishToken.balanceOf(owner.address); // Try to send 1 token from ...
Afterthought's user avatar
0 votes
1 answer
41 views

TypeError: Cannot read properties of undefined (reading 'getSigner')

get this mistake by running the following: const signer = hardhat.provider.getSigner(); what could be the problem?
אליה שלמה's user avatar
0 votes
1 answer
13 views

How to get proper typesafe version from ethers.getContractAt or any other alternative method

I have a hardhat + typescript project , where I have a script like the below: import { ethers } from "hardhat"; import { diamond as diamondAddress } from "../../deploy/addresses.json&...
Somjit's user avatar
  • 265
0 votes
2 answers
73 views

How to specify an overloaded function for execution using a Hardhat Ignition Module?

I have the following module: function createPoap(m: IgnitionModuleBuilder) { const proxyAdminOwner = m.getAccount(0); const name = m.getParameter('name'); const symbol = m.getParameter('symbol'...
Falcon Stakepool's user avatar
0 votes
1 answer
20 views

Hardhat, problem with uninstalled dependencies

I can compile my contracts successfully. I had some problems with some of the hardhat functions so i installed Waffle and its dependencies. However it doesn't work and throws an error stating missing ...
אליה שלמה's user avatar
1 vote
0 answers
17 views

When does hardhat-deploy skip a function on the deploy script

When running this script for the second time, the hardhat-deploy library detects that it had already deployed the pool artifact so it skipped that part. It did not skip the pool initialisation. So ...
IBeFrogs's user avatar
1 vote
0 answers
49 views

How to debug <UnrecognizedContract>.<unknown>?

I'm getting errors while trying to mint a new position on Uniswap V3 with a fork networkI've already opened a question on Stack Overflow about that here I'm wondering how can I debug and maybe import ...
Nailu's user avatar
  • 11
0 votes
0 answers
8 views

Need Assistance Resolving ds-math-underflow Error in Liquidity Pool Transaction

I'm currently facing an issue while trying to lock my share of the liquidity pool on the blockchain. Despite successful tests in a Hardhat environment, the transaction is reverted when executed on the ...
Yazan Ali's user avatar
0 votes
1 answer
30 views

Error: Timeout of 2400000ms exceeded. For async tests and hooks, ensure "done()" is called; if returning a Promise, ensure it resolves

When I try run my unit test ("hh test" or "yarn hardhat test") in ethersV6, for some reason it doesn't enter in my Promise's test because even doesn't appear the console.log(). The ...
Tucan's user avatar
  • 3
0 votes
1 answer
29 views

Hardhat Ethers get Contract Deployed on a Specific Chain

I've deployed a contract(MyContract) on both ethereum sepolia and arbitrum sepolia testnets. async function getContractAddress() { const { deployer } = await getNamedAccounts(); const ...
MAYANK CHHIPA's user avatar
0 votes
0 answers
30 views

Error "DeserError" while running hardhat tests on an Anvil forking node

I have a hardhat setup for both deploying and running tests of smart contracts. I wrote my unit tests using chai library and executed it using hh test --network anvil. and after a successful ...
0xbeny's user avatar
  • 303
0 votes
1 answer
252 views

Facing the "factory runner does not support sending transactions" error while executing deploy script of Hardhat

When I run: npx hardhat run --network sepolia scripts/deployFlashLoan.js I am getting this error: factory runner does not support sending transactions (operation="sendTransaction", code=...
Udayarajan gauthaman's user avatar
0 votes
2 answers
75 views

"message": "Error: Transaction reverted: function returned an unexpected amount of data", ""message": "Error: Transaction reverted: funct

function createTransaction( uint256 _merchantId, uint256 _tokenAmount, address _tokenAddress ) public onlyActiveMerchants(_merchantId) { IERC20 token = IERC20(...
Anwar's user avatar
  • 51
0 votes
1 answer
32 views

How do I get a reverted transaction id from an AAVE flashloan request?

How do i get a reverted transaction receipt id from an AAVE flashloan request on the mainnet? The transaction fails and rollsback, but I don't see any tx receipt output for the failed transaction to ...
Ian Forsyth 's user avatar
0 votes
0 answers
25 views

How to solve constructor params missing issue?

This is my constructor code for the trading receiver constructor(address _staking, address _trading, address _lzEndpoint) NonblockingLzApp(_lzEndpoint) { liquidityI = ...
Vinit_2311's user avatar
0 votes
1 answer
273 views

Hardhat error - Unrecognized task 'ignition'

I try and run npx hardhat ignition deploy ignition/modules/myModule.js --network localhost get Error HH303: Unrecognized task 'ignition' I'm on 2.22.3 for hardhat versions... so no idea
thefett's user avatar
  • 3,910
1 vote
2 answers
71 views

provider.getBalance() always returns "0"

I'm trying to get the BUSD balance of a whale. However the getBalance() function always returns 0 and I get the following error when I run my tests: AssertionError: Expected "0" NOT to be ...
Christopherus's user avatar
0 votes
1 answer
122 views

Getting execution reverted: ERC20: transfer amount exceeds allowance code: UNPREDICTABLE_GAS_LIMIT method

Getting this error when attempting to call an external swap function in a contract I created on the Sepolia Test Network from Hardhat TypeScript. reason: 'execution reverted: ERC20: transfer amount ...
Ian Forsyth 's user avatar
0 votes
2 answers
19 views

reserve0/reserve1 price is different compared to boughtTokensAmount/requiredWeiAmount

I would start with a sample on exact UniswapV2 pair SHIB/WETH (SushiSwap). I use local hardhat node and there's no possibility of 3-rd party effect on LP. I have this toSwapTokensAmount = ...
dvcr's user avatar
  • 3

1
2 3 4 5
29