Questions tagged [hardhat]

The tag has no usage guidance.

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

Invalid API key sepolia network blockscout

I deployed a contract on sepolia network and I would like to verify my coin using hardhat. npx hardhat verify --network sepolia 0x44ED9AB9F4Ab72e4b1aBfEBaDf5A942617B90D18 I created an API key on ...
SolidityNewbie's user avatar
0 votes
0 answers
4 views

Scripts directory not installed

I am creating a smart contract where I have to run the script directory. But even after installing all the dependencies the directory is not getting added to the root folder.
Shravani Sawant's user avatar
1 vote
1 answer
22 views

Insufficient Liquidity after adding liquidity on Sepolia Uniswap V2

I created a token "TestMe" with 2 million tokens (18dec), minting the deployer address the whole stack. I used the "addLiquidityETH" function provided by uniswap router to add 500k ...
SolidityNewbie's user avatar
0 votes
0 answers
12 views

TypeError: isAddressable is not a function

before i start with question i looked at this answers first and second,but nothing helped. I am writhing some unit tests for my smart contracts using hardhat and keep getting error TypeError: ...
gojic's user avatar
  • 147
0 votes
0 answers
9 views

Hardhat Ignition Deployment

since I've started using hardhat ignition to deploy my contracts, the deployment process has been really really slow. Anyone else facing the same issue?
Vidhan Mangla's user avatar
0 votes
0 answers
4 views

Use a smart contract as signer in hardhat test

I have two smart contracts depend on each other contract A { function isOK() external bool view {...} } contract B { address _contractA; modifier onlyContractA() { if (msg.sender ...
seven7e's user avatar
  • 101
0 votes
1 answer
26 views

Insufficient Allowance ERC20 when adding liquidity to Uniswap V2 Pool

I am trying to create a contract with a Uniswap V2 Pair for my TestMe Token on Sepolia Testnet. Smart Contract: // SPDX-License-Identifier: MIT pragma solidity 0.8.24; import "lib/openzeppelin-...
SolidityNewbie's user avatar
0 votes
0 answers
4 views

SeatMap.js:21 Error fetching seats: Error: no matching fragment (operation="fragment", info={ "args": [ null ], "key": "seatsTaken" },

I have been try to see the values in my array from a function i created with solidity in my APP.js: mapping(uint256 => uint256[]) public seatsTaken; function getSeatsTaken(uint256 _matchID) public ...
jesse bonsu's user avatar
1 vote
0 answers
31 views

Contract bytecode generated by Hardhat is two times larger than generated by Foundry

I'm developing a contract using both hardhat and foundry. For some reason hardhat generates bytecode that is two times larger than the one generated in foundry. Why may it happen? Source code: // SPDX-...
Sergey Makovkin's user avatar
0 votes
1 answer
28 views

How to get the ETH balance after calling getSigners()

I have a single metamask address with a BNB balance on the BNB Chain Mainnet and an ETH balance on Arbitrum One. Calling my typescript script below: npx hardhat run scripts/deploy_prod.ts --network ...
Ian Forsyth 's user avatar
0 votes
1 answer
34 views

Why the method _castToPure in hardhat/console.sol can convert a view method to a pure one?

I have a question when read the console.sol. There is a method named _castToPure that can convert a view method _sendLogPayloadImplementation into a pure method. I cant understand the reason and ...
Alvan's user avatar
  • 11
0 votes
0 answers
17 views

I am using Hardhat ignition deployment and cannot obtain the actual transaction using the m.call method. I am trying to obtain its length, but it is 0

const subId = m.call(VRFCoordinatorV2Mock, "createSubscription", []); subscriptionId = subId.logs[0].args.subId;
edc wsx's user avatar
0 votes
1 answer
37 views

Large price discrepancy between swapExactTokensForTokens and official swap

I am testing performing swaps using solidity ^0.8.24 smart contracts with hardhat on Polygon and Quickswap exchange. But I am getting relatively large price discrepancies between my swap and one ...
SolTester's user avatar
1 vote
0 answers
16 views

Cannot read properties of undefined (reading 'length') when deploying Mock Aggregator

I am trying to deploy Mock Aggregator, but getting the error as TypeError: Cannot read properties of undefined (reading 'length') This error is from the internal module called hardhat deploy I went ...
Sam's Show's user avatar
0 votes
1 answer
56 views

Hardhat: Get contract address and pass as param to another contract to deploy

gm guys, I have a question about the InheritanceSubmission on the basecamp contract: I performed the following steps to deploy my contracts using Hardhat's Ignition: I deployed the Salesperson and ...
Jean's user avatar
  • 119
0 votes
1 answer
20 views

How is hardhat a dev dependency?

I know this is a beginner question, but I haven't grasped this particular package being a dev dependency. Aren't we including functions from hardhat in our deploy scripts? And I assume the main ...
Hossein Ebrahimi's user avatar
0 votes
1 answer
14 views

Reading Events from Implementation contract

I own a proxy contract as well as an implementation contract. The implementation contract's function emits an event, but it does not emit the event when it is called from the proxy contract. Using the ...
Bappa Banerjee's user avatar
0 votes
0 answers
35 views

I have no idea how to troubleshoot this: "execution reverted (no data present; likely require(false)" Help?

I'm trying to run an arbitrage bot via local fork using ethers.js and hardhat. I keep getting this error when I run the contract: error on trade instructions emitted V7: Error: execution reverted (no ...
Trent Kennelly's user avatar
0 votes
2 answers
394 views

I can't verify a proxy contract on polygon amoy testnet with Hardhat

how can I verify a proxy contract on polygon amoy testnet with Hardhat? When I run the verify command, I get the following error, so I can't verify: Etherscan API call failed with status 404, response:...
user1492006's user avatar
1 vote
1 answer
61 views

Full node on sepolia

I want to start testing my smart contract on an ethereum 2.0 testnet. I know there are different node providers like alchemy or quicknode but using these services I can incurr in rate limiting. The ...
ayman's user avatar
  • 15
0 votes
0 answers
18 views

Impossible to communicate with a deployed contract

I'm pretty new to blockchain, but I'd like to understand it more. I'd like to communicate with a deployed contract using Hardhat in order to solve a CTF challenge on HackTheBox. The challenge gives us ...
Fab_x's user avatar
  • 1
1 vote
1 answer
76 views

Execution Reverted due to UniswapV2-Pair creation in constructor

I am new to Blockchain development, so bear with me. I successfully deployed my first contract, but if I try to add a Uniswap V2 Pair creation inside the constructor, I always get the error "...
SolidityNewbie's user avatar
1 vote
0 answers
27 views

Unable to deploy Transparent Proxy contract to Polygon mainnet with Hardhat

I'm able to deploy this same contract to the Mumbai testnet and verify it and everything works fine. So I know that my script is working correctly. However each time I try to deploy to Polygon mainnet,...
BlackH3art's user avatar
1 vote
1 answer
32 views
+50

Hardhat doesn't recognize custom errors from inherited Contracts

I am trying to test TimelockController contract from Openzeppelin using their test. The timelockController imports Address.sol, which has a custom Error called FailedCall. Now for my case, I have ...
Zartaj Afser's user avatar
  • 3,754
1 vote
0 answers
27 views

Missing Revert Data (Hardhat/Ganache)

shortMessage: 'missing revert data', info: { error: { message: 'VM Exception while processing transaction: invalid opcode', stack: 'RuntimeError: VM Exception while processing ...
Kishor Kumar Paroi's user avatar
0 votes
2 answers
37 views

uniswapRouter.getAmountsOut returns less value of token B than present in reverses when provide full amounts of token A

I have the next code to get familiar with uniswap mechanics: create pair contract get reserves invoke getAmountsOut and provide all UNI token reserves const pairAddress = await _V2Factory.getPair(...
user133422's user avatar
0 votes
1 answer
31 views

How I can test smart contract which has logic based on chainId

Dear blockchain developers, I have a ERC20 with restriction of minting only on Polygon chain: // SPDX-License-Identifier: MIT pragma solidity 0.8.23; import "@openzeppelin/contracts/token/ERC20/...
Arkenstone's user avatar
0 votes
1 answer
142 views

The error message "TypeError: unsupported addressable value (argument="target", value=null, code=INVALID_ARGUMENT, version=6.11.1)" when run locally

I created a script that fetches the WETH interface and send some test ETH getWeth.js const { getNamedAccounts, ethers } = require("hardhat") const AMOUNT = ethers.parseEther("0.1")...
Raaghav Manivel's user avatar
0 votes
3 answers
30 views

Why doesn't `transfer` to owner change its balance?

I am building a contract to transfer ether to the contract's owner and test it via hardhat. I found that the owner's balance doesn't change after the transfer. below is the contract code: contract ...
Joey Yi Zhao's user avatar
0 votes
0 answers
16 views

npx hardhat test "Timeout of 40000ms exceeded" when repaying flash loan

I am trying to follow along with a youtube tutorial that teaches you how to make a basic uniswap flash loan application. I have copied every piece of code, line by line, from the video as instructed. ...
ChewyCorndog's user avatar
0 votes
2 answers
669 views

Unable to verify contracts on polygon Amoy testnet

I have deployed some contracts on amoy testnet. To verify I followed this doc and I have also used the same approach for other chains as well. But in this case I am getting the following error: Error ...
Solidity Nerd's user avatar
1 vote
0 answers
18 views

Solidity: getStudentNotifications Retrieves notifications to other metamask account instead of one metamask account

I have two metamask accounts, one is Vamshi (student) and Mike(University). I use Vamshi's account to call the function sendRecordsToUniversity and the university address, I use here is Mike's. so the ...
Robert Downey Jr.'s user avatar
1 vote
0 answers
182 views

uniswap not working on sepolia network

I am trying to swap two ERC20 tokens using uniswap v3 and in hardhat test its working correctly but its not working on sepolia testnet. this is the smart contract : // SPDX-License-Identifier: GPL-2.0-...
unni krishnan's user avatar
0 votes
2 answers
34 views

Error: incorrect number of arguments to constructor

Someone could help me. Despite the similar questions i read, i don't see what is wrong. Thanks in advance, Claude Here is detailed information about error imac-de-claude:TransactionContract ...
cvan85's user avatar
  • 3
1 vote
2 answers
38 views

Object value modified by function

I'm using hardhat using solidity compiler v0.8.22 in VSCode. I'm building a user database. I have a UserData struct which has a string userName. I want to allow the username to maintain case when ...
Technically Web3's user avatar
0 votes
1 answer
65 views

i got an critical error when i deploy my contract in hardhat

Error: The specified module could not be found. \\?\E:\codings\elonNft\node_modules\@nomicfoundation\edr-win32-x64-msvc\edr.win32-x64-msvc.node at Object.Module._extensions..node (node:internal/...
vasanth's user avatar
0 votes
1 answer
43 views

Problem with Hardhat reading a forked Ethereum Mainnet address - getting error in getSigners() function

I created a forked mainnet off Ethereum mainnet using my alchemy address and created the fork using Hardhat, I was able to see the fake contracts in the forked mainnet. I'm running the following code ...
FuzzShak's user avatar
1 vote
0 answers
104 views

MetaMask - RPC Error: The method "eth_maxPriorityFeePerGas" does not exist / is not available

beginner here. I understand that Hardhat does not support eth_maxPriorityFeePerGas anymore, which is why I am getting the following error: VM4452:1 MetaMask - RPC Error: The method "...
Mars Rav's user avatar
0 votes
1 answer
11 views

Timeleft() function not displaying in frontend (speedrunethereum quest 2)

I'm kinda new here. Started speedrun ethereum. I finished the code for quest 2, but timeleft() is not displaying at the front end. It just shows "0" everytime, even redeploying and changing ...
Patok's user avatar
  • 1
1 vote
1 answer
20 views

Hardhat impersonateAccount returns an empty "whale" wallet

I am impersonating a whale wallet so that I transfer ETH from that wallet to my flashloan contract for the sake of performing an example flash loan using my test script. I check the address to make ...
ChewyCorndog's user avatar
0 votes
0 answers
28 views

How to resolve hardhat solidity-coverage error: Could not instrument

When I'm trying to use the plugin solidity-coverage (in hardhat), it returns the following error: Error in plugin solidity-coverage: TypeError: Could not instrument: libraries\BigNumber.sol. (Please ...
Pacdac's user avatar
  • 80
0 votes
1 answer
36 views

Does hardhat-trace work on localhost?

I'm trying to troubleshoot my hardhat project's smart contract, but every time I run npx hardhat trace --hash [transaction hash] I get the error Transaction not found on rpc. This has me wondering if ...
Trent Kennelly's user avatar
1 vote
1 answer
37 views

Deploying a Safe locally ERROR: [SafeProxy was not deployed correctly]

I Everyone ! I'm currently trying to deploy a safe using hardhat and Safe Protocol Kit SDK Basically what I did was: Cloning the Smart contracts repo => Deploy them on hardhat local node Using the ...
Joshua's user avatar
  • 11
0 votes
1 answer
27 views

How to write unit test with Timestamp base function?

I writing a contract for Staking Token to earn Token. It's similar to pancake MasterChef. The requirement is based on timestamp (not block). When I test the contract with hardhat, I call the deposit ...
MadTik's user avatar
  • 21
0 votes
0 answers
13 views

Is Remix Hardhat documentation outdated?

In Chrome on Mac (the problem does not happen on Firefox), I'm trying to fully integrate a Hardhat project in a Remix IDE project, in order to compile the project in the same way, with both Remix's &...
Alexander Herranz's user avatar
0 votes
1 answer
149 views

NotImplementedError: Method 'HardhatEthersProvider.resolveName' is not implemented

I'm trying to implement meta transactions for my web app. I'm currently testing the smart contracts using hardhat but keep running into this error in my NodeManager.ts file. The error below 1) ...
Zhi's user avatar
  • 11
1 vote
1 answer
101 views

Transaction reverted: function returned an unexpected amount of data when requesting Institution Data

I am trying to request for Institution details which returns two or more data but getting these error. Error: Transaction reverted: function returned an unexpected amount of data at Institution....
Nikhil Raj's user avatar
0 votes
0 answers
34 views

Cannot read properties of undefined (reading 'deployContract')

const hre = require("hardhat"); async function main() { const userstorage = await hre.ethers.deployContract("userstorage"); await userstorage.waitForDeployment(); console....
Achal Jhawar's user avatar
0 votes
0 answers
52 views

Error: contract runner does not support sending transactions (operation="sendTransaction", code=UNSUPPORTED_OPERATION, version=6.11.1) [duplicate]

Error: contract runner does not support sending transactions (operation="sendTransaction", code=UNSUPPORTED_OPERATION, version=6.11.1) i got this error what should i do ?
Thejeshwar's user avatar
0 votes
1 answer
50 views

Contract compilation problem with hardhat

hello I'm trying to compile a contract with hardhat but I get the following error HH409:Trying to import @openzeppelin/contracts/access/ownable.sol from contracts/SimpleStorage.sol, but it has an ...
Devop86's user avatar

1
2 3 4 5
28