New answers tagged

0 votes

hardhat-shorthand is not working

you can add yarn bin in PATH: yarn global dir # get yarn bin path
xx x's user avatar
  • 1
0 votes

Hardhat Chai expect fails on reversion

When you are expecting a revert, you should put the await before expect. Instead of: expect(await ERC20Contract.connect(user2).mint(user1.address, USERS_MINT)); There should be: await ...
David Dudas's user avatar
1 vote

Is it possible to run a validator node on a forked net?

Yes, it's possible to fork the Ethereum mainnet using Hardhat and set up a validator node on the fork for testing purposes on a website. This allows experimentation before deploying on the testnet. ...
Warner Kale's user avatar
0 votes

contract.deploymentTransection.wait(1) not working in ethers version 6.4.0

await simpleStorage.deploymentTransaction().wait(3); Note that deploymentTransaction is a function call, it requires the round parenthesis.
mariuss's user avatar
  • 101
0 votes

typeError: Cannot read properties of undefined (reading 'format')

TypeError: Cannot read properties of undefined (reading 'format') the variables are either undefined or not formatted proparly for the function to interpret the arguments. I think the problem either ...
Yann's user avatar
  • 21
0 votes

I am trying to display image on frontend using pinata and ipfs but facing this error

From the error it sounds like its more related to display(address) but let us know if you need more assistance with the upload part! We have some React examples here as well as an Next.js Template you ...
Steve Simkins's user avatar
0 votes

Error: factory runner does not support sending transactions DEPLOYMENT

In hardhat.config.js, you should use accounts instead of account require("@nomicfoundation/hardhat-toolbox"); require("dotenv").config(); const { INFURA_API_KEY, ...
flokapi's user avatar
0 votes

Hardhat says it deployed contract to 0x5FbDB2315678afecb367f032d93F642f64180aa3?

I was getting the same error with: npx run scripts/deploy.js --network sepolia. I forgot to add the hardhat command in. It should be: npx hardhat run scripts/deploy.js --network sepolia
Reno's user avatar
  • 131
0 votes

hardhat node problem

Using plain old hex values instead of abi encoded uint256 values solved this for me. ie 0x2 instead of 0x0000000000000000000000000000000000000000000000000000000000000002.
Bob's user avatar
  • 101
0 votes

ParseEther is getting undefined

If you are using ethers version 6 then you have to remove utils. you can directly use ethers.parseEther("") instead of ethers.utils.parseEther()
Vijay raj panchal's user avatar
0 votes

Error: factory runner does not support sending transactions (operation="sendTransaction", code=UNSUPPORTED_OPERATION, version=6.7.1)

Your hardhat.config.js: accounts: [`0x${PRIVATE_KEY}`], plural 'accounts', not singular 'account'
CITD com my's user avatar
2 votes

Unknown key "viaIR"

viaIR: true may require version 0.8.13 and higher.
EthanOK's user avatar
  • 391
0 votes

how to test all funds are withdrawn from a contract with hard hat

You can calculate the transaction gas fee. const balance = await ethers.provider.getBalance(owner.address); // owner balance const amount = await ethers.provider.getBalance(; // ...
Blue Captain's user avatar
1 vote

Cannot read properties of null (reading 'constructor') Etherjs error

Just change in the second line to const contract = new ethers.Contract so you'll call class constructor. And no need in await on second line as constructor in synchronous
crystalbit's user avatar
0 votes

Failing to deploy any Contract

I reinstalled the whole project folder - this led the compiler to accept certain changes which it didnt accept before (most notable change was the addition of constructor arguments for Ownable.sol) ...
PupSt4r's user avatar
  • 47
0 votes

How do I obtain a signer object from a named account address in a Hardhat project?

To obtain a signer object from a named account address in a Hardhat project with the hardhat-deploy plugin, you can use the ethers.getSigner method, which is designed to work with the addresses of the ...
MShakeG's user avatar
  • 1,418
0 votes

Exception When Calling Function In a Library that Returns an Array

if you are using a dynamic array then instead of assigning the index, just push into the array. pragma solidity ^0.8.4; library LibA { function getArray() public pure returns (uint[] memory) { ...
Rohit Goyal's user avatar
-1 votes

Problem with using OpenZeppeling contracts with Hard Hat - not found: File import callback not supported

There is a little bit difference between importing the code in solidity and hardhat code Solidity code import "@openzeppelin/contracts/ownership/Ownable.sol"; hardhat code import "@...
Rohit Goyal's user avatar
0 votes

How to run the hardhat fork in the separate terminal?

In a terminal you can do this: npx hardhat node --fork<key> It should open a network, leave it open until you finish testing everything. Then you can run ...
0xSanson's user avatar
  • 2,744
1 vote

Hardhat - HardhatEthersProvider.resolveName is not implemented

You are calling constructor on wrong way. constructor( address _lzEndpoint, string memory _name, string memory _symbol, uint8 decimal ) OFTWithFee(_name, _symbol, ...
Niraj Bhattarai's user avatar
1 vote

Error HH8: There's one or more errors in your config file: * Invalid account: #0 for network: sepolia - private key too short, expected 32 bytes

sepolia: { url: `${process.env.API_URL}`, accounts: [`0x${process.env.PRIVATE_KEY}`], //No need to concatenate '0x" } The issue is from the configuration above. Firstly, there's no need to ...
Okengwu's user avatar
  • 11

Top 50 recent answers are included