Questions tagged [hardhat]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0 votes
0 answers
4 views

Data Fetching from an Aave subgraph

Hi guys I am writing a dApp which deals with liquidations flash loans etc, The 1st step of development is to receive the user addresses who have borrowed more than zero from 'The Graph' I use hardhat....
NeoRusI's user avatar
  • 11
0 votes
1 answer
19 views

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

As the question says - is it possible to fork mainnet with hardhat and run/setup a validator node on the fork? There are some things I'd like to try out before testing it on testnet (I don't even have ...
rawk's user avatar
  • 101
0 votes
1 answer
11 views

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

I am getting this error whenever I run my hardhat deploy script for uniswap pool contract : TypeError: Cannot read properties of undefined (reading 'format') at Function.from (/home/abdulaleem/token/...
Abdul Aleem's user avatar
0 votes
0 answers
5 views

ethers.utils.solidityKeccak256 in hardhat test file

Here is a test file. ethers.getSigners() works fine ethers.deployContract() works fine for some reason, ethers.utils.solidityKeccak256 keeps breaking the code with this error: ' TypeError: Cannot read ...
Jesse Jacob's user avatar
1 vote
0 answers
20 views

Foundry or Hardhat: I'm really confused about which one should I use?

Hello everyone I'm new in the smart contract and Dapp development and I'm so confused about choosing a framework. my questions are dumb but I couldn't find the answers by myself. Here is my problem: I ...
emtothed's user avatar
0 votes
0 answers
8 views

How Remix IDE compiles smart contract code to ABI and bytecode?

I am building a DApp where user uploads his smart contract code file and his smart contract gets deployed using his private key ( After he connects his metamask account to the DApp ) . How RemixIDE is ...
Gaurav Pant's user avatar
0 votes
0 answers
12 views

Gas reporter does not report gas usage for low level calls

I am using npx hardhat test command to get the gas usages analysis. My configuration to get the report is like below. In my tests. I have tests for deployment, functions calls, but also some other ...
Ferda-Ozdemir-Sonmez's user avatar
0 votes
0 answers
25 views

Swap functions seems to not swap?

I have deployed a smart contract on a local network and I am trying to do swaps from a metamask account. I have allocated a quantity of tokens to the smart contract so it can use it using the approve ...
guiflam's user avatar
0 votes
0 answers
3 views

How to put .opezeppelin folder at desired directory in hardhat?

I am using Openzeppelin upgradable with hardhat. By default the plugin store .openzeppelin folder at root but I have running multiple environments so would like to set .openzeppelin folder at the ...
Ajay Yadav's user avatar
1 vote
0 answers
20 views

How to I solve fetch has been blocked by CORS policy when fetch data from contract

I'm trying to fetch campaign data and display it to the user. I'm using Nextjs in the front-end and solidity & hardhat in the back-end. The contract data seems to be fetched but when being ...
Kihiu's user avatar
  • 11
0 votes
0 answers
72 views

unsupported addressable value (argument="target") - [email protected] and @openzeppelin/[email protected]

When I create an OpenZeppelin ERC721 Smart Contract using OpenZeppelins Smart Contract wizard builder, I get an error when trying to deploy the smart contract to my local network using hardhat. I have ...
Eric B's user avatar
  • 11
0 votes
1 answer
25 views

Unknown key "viaIR"

Unknown key "viaIR" Error HH600: Compilation failed I'm encountering the above error when I try to compile. Here is my hardhat.config.ts import { HardhatUserConfig } from "hardhat/...
Ruwaifa Tahir's user avatar
0 votes
0 answers
25 views

Getting error when I trying to test my contract

I started coding project and I got error when trying to test him. When I trying to call some contract function from js tester i got error: Error: call revert exception [ See: https://links.ethers.org/...
Victor's user avatar
  • 13
0 votes
0 answers
18 views

How to run a hardhat node in the cloud

I have a set of tests i run locally using hardhat and mocha. However, I would like to run these tests on every push to prod. How can I start a hardhat node in the cloud for the testing.
Ibra's user avatar
  • 137
0 votes
0 answers
29 views

Hardhat MetaMask Error: Transaction decoding is not available for chainId 31337

I created a Real-Estate Decentralized Contract and connected it with Vite-React using ethers.js. I'm using Meta Mask and HardHat local network for Hardhat free Ether. I import 5 wallets of Hardhat to ...
Huzaifa Ahmed's user avatar
0 votes
1 answer
16 views

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

I am trying to interact with a deployed contract at Sepolia in a hardhat test. Here's how I do it: const provider= new ethers.providers.JsonRpcProvider(process.env.ALCHEMY_API_KEY); const ...
Rishabh Raghwendra's user avatar
0 votes
1 answer
11 views

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

In my Hardhat project, I'm using the hardhat-deploy plugin to manage named accounts, and I need to obtain signer objects associated with these named account addresses to interact with my smart ...
MShakeG's user avatar
  • 1,408
1 vote
0 answers
73 views

Could not decode result data

I have an issue when trying deploy contract // SPDX-License-Identifier: ISC pragma solidity ^0.8.19; contract SimpleStorage { uint256 favoriteNumber; struct People { uint256 favoriteNumber; ...
Victor's user avatar
  • 13
0 votes
1 answer
27 views

How to run the hardhat fork in the separate terminal?

I want to interact with the contracts in the mainnet, i used hardhat fork to fork the arbitrum mainnet, forking is done but after that my contracts getting deployed according to the script and the ...
Aviroxi's user avatar
0 votes
0 answers
18 views

how to access to a public mapping from test script

i'm in hardhat i'v this public mapping mapping (address user => uint[] commentIds) public userComments; and i'm trying to call it inside my test Script console.log(`user1 comments: ${...
Yassine's user avatar
  • 11
0 votes
0 answers
6 views

How to fix `str is undefined` nft dapp upload picture problem?

I'm trying to do an example in a tutorial, I tried to run this, but I get an error that "Upload errorTypeError: str is undefined". How can I solve this? I tried: -> deleting artifacts and ...
Kayhan's user avatar
  • 1
0 votes
1 answer
50 views

Error while deploying on sepolia network

hardhat.config.js -> require("@nomicfoundation/hardhat-toolbox"); require("@nomicfoundation/hardhat-ethers"); require("dotenv").config(); console.log("1"); ...
Indul's user avatar
  • 9
0 votes
1 answer
31 views

Error deploying contracts: Error: incorrect number of arguments to constructor at ContractFactory.getDeployTransaction

const hre = require("hardhat"); // async function main(){ // const RPSLS = await hre.ethers.getContractFactory("RPSLS"); // const RPSLSF = await RPSLS.deploy(); // await ...
Indul's user avatar
  • 9
0 votes
1 answer
4 views

How to Ensure TypeScript Type-Checking in a Hardhat Project Before Execution?

I'm working on a Hardhat project with TypeScript enabled. Currently, I can run my TypeScript scripts even if there are type errors, presumably due to the use of ts-node. I would like to enforce type ...
MShakeG's user avatar
  • 1,408
1 vote
1 answer
48 views

How to deploy a Safe on Hardhat

I am developing a Safe Module and would like to use Hardhat to test it. However, I have been so far unable to deploy a Safe using Hardhat. Does anyone have experience doing this? Even when I set my ...
Liam's user avatar
  • 38
0 votes
0 answers
121 views

"Error happened while trying to execute a function inside a smart contract" after trying to call smart contract function with fork ethereum chain

I am forking Ethereum blockchain using Alchemy's api. Below is my chain config module.exports = { solidity: { compilers :[ {version : "0.8.17"}, {version: "0.8.4"}...
Rohit Goyal's user avatar
0 votes
1 answer
18 views

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

import { HardhatUserConfig } from "hardhat/config"; import "@nomicfoundation/hardhat-toolbox"; require('dotenv').config(); const {API_URL, PRIVATE_KEY} = process.env; const ...
Indul's user avatar
  • 9
0 votes
1 answer
24 views

When deploying a contract on a custom blockchain using hardhat, i get BroadcastedTxDifferentHash error?

I am trying to deploy a contract to a custom EVM chain using hardhat and i get the following error BroadcastedTxDifferentHash: Expected broadcasted transaction to have hash '...
master chief's user avatar
0 votes
2 answers
33 views

Failing to deploy any Contract

I am unable to deploy any contract, including the example contract shown below: // contracts/Box.sol // SPDX-License-Identifier: MIT pragma solidity ^0.8.4; // Import Ownable from the OpenZeppelin ...
PupSt4r's user avatar
  • 47
0 votes
1 answer
33 views

I have problem with deploying my token to Goerli testnet

I have an issue with deploying smart contract on Goerli network. When I trying to run the contract I get Error Error HH100: Network goerli doesn't exist Here is example of my code // SPDX-License-...
Victor's user avatar
  • 13
0 votes
1 answer
38 views

hardhat ethers.provider.listAccounts()

This JavaScript test code is from a course I'm undertaking: before(async () => { const Collectible = await ethers.getContractFactory("Collectible"); collectible = await ...
HankCa's user avatar
  • 115
0 votes
1 answer
21 views

whitelist contract's address showing undefined without showing any error message

I am following this tutorial here to learn developing whitelist contract. My node verion is 18.12.1 and testnet is sepolia. I am currently on windows11 OS. whitelist.sol: //SPDX-License-Identifier: ...
swarna islam's user avatar
0 votes
1 answer
34 views

Cant make conection with my Smart Contract using web3

I cant get my contract instance using web3 . I am making todo app using web3 . I cant get my contract instance in js file . I am new to web3 development and everyday I am trying my best improve my ...
Shorna's user avatar
  • 13
1 vote
1 answer
18 views

Does geth or parity in development chain mode support methods like hardhat_setSorageAt or is there a way to manipulate EOA?

I wan’t to create more sustainable test network for my develop project. Hardhat node gets slowed down with the time and even crashes. I am wondering is there a modified geth rpc client supporting some ...
Hristo Todorov's user avatar
0 votes
0 answers
15 views

Installing hardhat on an Amzon EC2 instance or on any live server

I want to deploy and maintain contracts from an ec2 instance, didn't choose lambda for time constraints reasons. I could translate everything to ethers js except contract verification which proves a ...
Ionut Țiplea's user avatar
0 votes
0 answers
5 views

Pool Prices Not Updating in Forked Hardhat Mainnet

Why do pool prices remain static in my forked Hardhat mainnet environment during swaps? What steps can I take to troubleshoot and ensure that pool prices accurately reflect the expected changes in ...
Asim Hayat's user avatar
0 votes
1 answer
26 views

Send Function is not working in test file using ethers.js

I write a wallet smart contract in which one address can send ethers to other addresses. I'm using the HardHat framework and this package. when i use await addr1.sendTransaction( {to: addr2, value: ...
Huzaifa Ahmed's user avatar
0 votes
1 answer
64 views

HardhatError: HH700: Artifact for contract "Lock" not found

If I run yarn hardhat test. I'm getting this error: yarn run v1.22.19 warning ../../../package.json: No license field $ /Users/deepak/Desktop/Etherium/hardhat-fund-me-fcc/node_modules/.bin/hardhat ...
Deepak Chaudhary's user avatar
0 votes
0 answers
16 views

before each" hook for "sets the aggregator addresses correctly": TypeError: (0 , ethers_1.getAddress) is not a function

I am getting TypeError: (0 , ethers_1.getAddress) is not a function when i run yarn hardhat test on the first part of unit testing here is FundMe.tets.js const { deployments, ethers, getNamedAccounts ...
kartik's user avatar
  • 1
0 votes
1 answer
49 views

NFT transfer to a contract in ERC1155 standard

NFTS transfer from minter to contract isn't working, below is the detailed problem. NFT.sol // SPDX-License-Identifier: UNLICENSED pragma solidity ^0.8.19; import {ERC1155} from "@openzeppelin/...
Shubham's user avatar
  • 13
0 votes
0 answers
18 views

eth_estimateGas calling random function

I'm testing my Ethereum smart contract with Hardhat and Metamask. In Metamask if I try to send zero tokens it reverts, as expected (the transfer function reverts if token amount is zero). If I look at ...
Rick's user avatar
  • 91
1 vote
2 answers
272 views

Calling smart contract function from frontend is not working

I've created a twitter profile contract and a function called contract Twitter { //Struct for user profile struct Profile { string name; string username; string bio; ...
Santhosh's user avatar
1 vote
1 answer
21 views

Property 'zkUpgrades' does not exist on type 'HardhatRuntimeEnvironment'.ts(2339)

I have a test file for testing an upgradable smart contract on zkSync by looking at the docs here. I'm getting a typescript error on this line await hre.zkUpgrades.deployProxy(deployer.zkWallet, ...
stuckoverflow's user avatar
0 votes
1 answer
16 views

Hardhat deploy same contract to multiple addresses fails

I need to deploy the same contract to multiple wallets and I have this shell script. #!/bin/bash set -x contractName=MyContract network=sepolia npm cache clean --force yarn hardhat clean yarn hardhat ...
pigfox's user avatar
  • 125
0 votes
0 answers
12 views

Good extensions for both Foundry & Hardhat

Hello i'am looking for good vscode extension for both foundry & hardhat. Thank you for your feedback !
PandaKungFuu's user avatar
0 votes
1 answer
64 views

TypeError: ethers.provider.getStorageAt is not a function

I have deployed the contract and I'm trying to get the address at each storage slot module.exports = async ({ getNamedAccounts, deployments }) => { const { deploy, log } = deployments ...
MD AZAD's user avatar
0 votes
1 answer
35 views

How to properly test my flashloan bot

I am building a simple flashloan bot as shown below: Flashloan from Aave -> lend it on Lending protocol A -> Borrow tokens from protocol A -> Lend borrowed to protocol B -> Borrow from ...
Rishabh Raghwendra's user avatar
0 votes
0 answers
97 views

How do I get Wagmi useWaitForTransaction to wait for Metamask (running on Hardhat)?

I am using Wagmi's useWaitForTransaction together with Metamask, running on local Hardhat node. When I sign a transaction it almost immediately returns successful on the front end, but on Metamask it ...
holangun's user avatar
0 votes
0 answers
18 views

Dockerized zkSync testing environment image fails with error Solidity 0.8.19 is not fully supported yet

I'm setting up a dockerized local zksync testing environment according to this guide here. When I run the ./start.sh command, it runs all three images but the local-setup-zksync-1 image exits with ...
stuckoverflow's user avatar
0 votes
1 answer
43 views

Undefined contract address with simple deployment

I'm trying to get the address of a deployed contract, but I'm getting undefined. This is how I'm deploying: const Init = await hre.ethers.getContractFactory("InitUpgradeV2"); const init = ...
dNyrM's user avatar
  • 711

1
2 3 4 5
26