Questions tagged [hardhat-deploy]
The hardhat-deploy tag has no usage guidance.
262
questions
0
votes
0
answers
8
views
IMPORTING ACC ON METAMASK FROM MY LOCALLY CREATE ACC ADDRESS
Im currently creating a basic connect and fund contract where I will be able to fund an address using hardhat and ethers.js. I currently have a local mock created in my terminal with dummy accounts ...
0
votes
0
answers
19
views
Has the way to access public member variables in solidity through deployed contracts changed?
I have a public contract member defined like this, which is later assigned a value in the constructor
AggregatorV3Interface public priceFeed;
I want to access this variable's value and I am trying ...
1
vote
0
answers
55
views
Hardhat public network fork: Error calling view functions with ethers.js on browser
I have my hardhat network configured as a fork of Binance Smart Chain like this:
const config: HardhatUserConfig = {
solidity: {
version: "0.8.0",
settings: {
optimizer: {
...
1
vote
1
answer
14
views
What is the right way to import a contract type that uses an interface in hardhat?
I have a contract with an interface that I want to test with hardhat
the contract looks like this
interface IGame {
function play(uint guess) external;
}
contract Test {
address private owner;...
2
votes
1
answer
23
views
It is safe to use allowUnlimitedContractSize: true?
I'm trying to deploy with Hardhat a Smart Contract which has too much code, even after refactoring and using libraries. The only solution would be a total refactor following the diamond pattern, or ...
0
votes
1
answer
14
views
Invalid account: #0 for network: sepolia - private key too long, expected 32 bytes
require('dotenv').config();
require("@nomiclabs/hardhat-ethers");
const { API_URL, PRIVATE_KEY } = process.env;
module.exports = {
solidity: "0.7.3",
defaultNetwork: "...
1
vote
2
answers
18
views
Can we add network param to run function to verify contract on specific network?
I am trying to create a task for deploying and verifying any contract from my project..
task below successfully deployed contract but it is not able to verify..
How can i tell hre.run function to run ...
1
vote
1
answer
30
views
Calling performUpkeep(zeroBytes) results in 'function returned an unexpected amount of data'
I'm doing the blockchain course by Patrick Collins on FreeCodeCamp and I'm really enjoying it. Unfortunately I got stuck at my unit test in lesson 9 and after reading a lot of discussions on Github, I ...
0
votes
0
answers
12
views
When I run the yarn hardhat test the console only shows 0passing(0ms) and the test didn't run
When I run the yarn hardhat test the console only shows 0passing(0ms), which means the test didn't run.
const { assert, expect } = require("chai")
const { ethers, deployments, ...
1
vote
2
answers
77
views
How to compile contracts independently with Hardhat?
I'm facing the following error, when compiling my contracts in Hardhat:
Warning: Contract code size exceeds 24576 bytes (a limit introduced in Spurious Dragon). This contract may not be deployable on ...
1
vote
2
answers
113
views
How to get address of deployed smart contract in hardhat
I have two files, Token.sol and Token.js for Testing:-
Token.sol
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.19;
import "hardhat/console.sol";
contract Token{
string ...
1
vote
1
answer
133
views
Property 'address' does not exist on type 'BaseContract'
I have TimeLock contract that extends TimelockController from OpenZeppelin contracts:
contract TimeLock is TimelockController {
constructor(
uint256 minDelay,
address[] memory proposers,
...
0
votes
0
answers
23
views
Not able to test view functions in hardhat
Solidity code
pragma solidity ^0.8.7;
import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import "@chainlink/contracts/src/v0.8/interfaces/AggregatorV3Interface.sol";
...
0
votes
0
answers
35
views
Deploying smart contracts on Polygon mainnet using Hardhat-Deploy
I have been working on Polygon Mumbai testnet for several months now. It is time to deploy to mainnet and I have setup my deployment with hardhat-deploy plugin. I set up the dependencies and all the ...
0
votes
0
answers
65
views
Error HH604: Error running JSON-RPC server: Connect Timeout Error
I'm facing an error while running the command "yarn hardhat node"
ERROR:
Error HH604: Error running JSON-RPC server: Connect Timeout Error
For more info go to https://hardhat.org/HH604 or ...
0
votes
0
answers
14
views
Getting a "TypeError: Cannot read properties of null (reading 'sendTransaction')"
I run the following command to run the project
npx hardhat run scripts/deploy.js --network mumbai
then I get the folloing error massage
TypeError: Cannot read properties of null (reading '...
0
votes
0
answers
153
views
I am trying to deploy this contract but facing this error
const hre = require("hardhat");
// Returns the ether balance of a given address.
async function getBalance(address) {
const balanceBigInt = await hre.ethers.provider.getBalance(address);
...
1
vote
1
answer
360
views
Error: factory runner does not support sending transactions DEPLOYMENT
Hi im tyring to deploy my contract bug following error
Deploying TaskContract...
Error: factory runner does not support sending transactions (operation="sendTransaction", code=...
0
votes
0
answers
117
views
how to write test for upgradeable smart contract in hardhat
I'm writing a Hardhat test for my contract.
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.18;
import "@openzeppelin/contracts-upgradeable/token/ERC721/ERC721Upgradeable.sol";
import &...
0
votes
0
answers
202
views
"TypeError: (0 , ethers_1.getAddress) is not a function" when writing tests in hardhat with typescript
i get this error when i run this test:
typescript
import { expect } from "chai";
import { ethers } from "hardhat";
import { Ballot } from "../typechain-types";
const ...
0
votes
1
answer
88
views
contract.deploymentTransection.wait(1) not working in ethers version 6.4.0
Error is in this line
const deploymentReceipt = await contract.deploymentTransection.wait(1);
Entire code I am using to deploy contract and wait
const { ethers, run, network } = require("hardhat&...
0
votes
1
answer
73
views
error in hardhat basic example (deploy.ts)
deploy.ts 👇
import { ethers } from "hardhat";
async function main() {
const currentTimestampInSeconds = Math.round(Date.now() / 1000);
const unlockTime = currentTimestampInSeconds + 60;...
1
vote
2
answers
623
views
TypeError: no matching function (argument="key", value="address", code=INVALID_ARGUMENT, version=6.6.2)
Deployment Contract
const { network } = require("hardhat");
const { verify } = require("../utils/verify");
module.exports = async ({ getNamedAccounts, deployments }) => {
...
0
votes
2
answers
91
views
Hardhat Verify contract issue
I tried to verify contract in polygon mumbai!
Harhat version: ^2.15.0
const hre = require("hardhat");
const ETHERSCAN_API_KEY = ""
async function deploy(){
const ...
0
votes
2
answers
344
views
TypeError: deployer.getBalance is not a function
I want to know the balance in the account but am facing the error that getBalance is not a function.
Deploy.js
const main = async () => {
const [deployer] = await hre.ethers.getSigners();
const ...
0
votes
1
answer
83
views
Script is not getting deployed on local hardhat network due to some type error
// imports
const { ethers, run, network } = require("hardhat")
// async main
async function main() {
const SimpleStorageFactory = await ethers.getContractFactory("SimpleStorage")...
1
vote
0
answers
29
views
How to deploy a contract to the same address in testnet?
My code for deploying a contract
import { ethers } from "hardhat";
async function main() {
const CF = await ethers.getContractFactory('abc');
const c = await CF.deploy();
await c....
0
votes
0
answers
17
views
Hardhat not connecting error
Hello all i am building a fileuploader using ipfs.when i try to connect to my wallet using hardhat local network i am getting hardhat cant connect error and option to switch network.My hardhat is ...
0
votes
2
answers
268
views
Fixed - Hardhat Deploy Error
[Fixed] hardhat-tools change deployment's functions. For hardhat-tools 3.0.0:
deploy() is now deployContract()
deployed() is now awaitForDeployment()
We can downgrade hardhat-tools or use the new ...
2
votes
0
answers
92
views
Compilation error in deploying a contract on zksync, using deploy zksync
I'm trying to compile the code but I keep getting an error. Here is the hardhat.config.ts code:
import "@matterlabs/hardhat-zksync-deploy";
import "@matterlabs/hardhat-zksync-solc";...
0
votes
0
answers
22
views
I was trying to deploy contract for pinata ipfs Image and getting error
I was trying to deploy contract for pinata ipfs and getting error
Nothing to compile
Local network detected! Deploying mocks...
deploying "VRFCoordinatorV2Mock" (tx: ...
0
votes
0
answers
125
views
Cannot read properties of undefined (reading '0')
I am following FreeCodeCamp's javascript Blockchain/SmartContract course. Facing issue at lesson 9 staging test. Contract deployment and unit tests are running fine. Running mocha test on sepolia ...
0
votes
0
answers
86
views
Trying Uniswap V3 Swap Example - Error: Transaction reverted: function call to a non-contract address
Have been getting bellow error message:
SwapExamples
swapExactInputSingle:
Error: Transaction reverted: function call to a non-contract account
at SwapExamples.swapExactInputSingle (contracts/...
0
votes
1
answer
348
views
Error: invalid contract address or ENS name (argument="addressOrName", value=undefined, code=INVALID_ARGUMENT, version=contracts/5.7.0)
I am trying to test the contract but getting error:
Basic NFT Unit Tests
Constructor
1) "before each" hook for "Initializes the NFT Correctly."
0 passing (2s)
1 ...
1
vote
0
answers
18
views
Contract is not deploying locally while testing for testcases
I am trying to write test cases for my code, here the MockV3Aggregator is supposed to run locally, upon deploying it works fine but when I try to only run the test case it seems that the ...
0
votes
0
answers
103
views
I am Getting this error ProviderError: Must be authenticated!
ProviderError: Must be authenticated!
at HttpProvider.request (/workspaces/Decentralized-Voting-Application-on-Ethereum-Blockchain/node_modules/hardhat/src/internal/core/providers/http.ts:88:21)
...
0
votes
1
answer
65
views
Deployment Issue in Hardhat using `module.exports.tags`
I can't seem to deploy my "deploy-mocks.js" file using yarn hardhat deploy --tags mocks. Here's my code if you want to take a look. I have searched everywhere but can't find the answer. Any ...
0
votes
0
answers
61
views
Error: CONNECTION ERROR: Couldn't connect to node http://localhost:8545
Acutally I create a smart contract that the user create an auctions for things, so whenever some buyer come in website and see the acutions if he want to buy then he will create an offer. Same as if ...
0
votes
0
answers
7
views
POST request doesn't work with Hardhat task
I'm using Hardhat on NextJS.
And I don't know how to run Hardhat task from my API
My API:
//pages/api/verify/index.ts
import type { NextApiRequest, NextApiResponse } from "next";
import { ...
1
vote
2
answers
65
views
Facing issue with deploying safe contracts on mumbai testnet
I downloaded the safe contract latest release from https://github.com/safe-global/safe-contracts/releases/tag/v1.4.0 and i am trying to deploy the contract . I am trying to run npx hardhat --network ...
0
votes
0
answers
54
views
How to verify smart-contract via function?
how to verify smart-contract via function?
I try to use this:
https://era.zksync.io/docs/api/hardhat/hardhat-zksync-verify.html#verify-smart-contract-programmatically. My code:
await hre.run("...
1
vote
2
answers
186
views
Solidity low-level call and fallback function failed in hardhat-deploy
I am using examples in soliditylang.org special functions
My simple contracts are extracted from the link
// SPDX-License-Identifier: GPL-3.0
pragma solidity >=0.6.2 <0.9.0;
contract ...
0
votes
0
answers
50
views
From web3/Javascript to zkSync-web3/Typescript
I am trying to port some javascript tests targeting the Ethereum mainnet to the new zkSync testnet. This was not a problem with my standard javascript hardhat testing. Moving to typescript/zkSync, I ...
5
votes
1
answer
2k
views
Error HH210: Redefinition of task verify failed. Unsupported operation adding positional param definitions in an overridden task
hardhat.config.js
require("@nomicfoundation/hardhat-toolbox")
require("dotenv").config()
require("@nomicfoundation/hardhat-verify")
require("@nomiclabs/hardhat-...
0
votes
1
answer
115
views
TypeError: Cannot read properties of undefined (reading '11155111')
PS C:\Users\BISHOP\Desktop\blockchain_fcc\hardhat-fundme-project> npx hardhat deploy --network sepolia
Nothing to compile
An unexpected error occurred:
Error: ERROR processing C:\Users\BISHOP\...
0
votes
2
answers
74
views
Issue verifying proxy contract with linked library
I am experiencing a weird issue when verifying a Proxy Contract on Etherscan. I am using hardhat, @openzeppelin/hardhat-upgrades, and @nomiclabs/hardhat-etherscan.
The issue
Error in plugin @...
1
vote
2
answers
291
views
How to use multiple networks inside a Hardhat Script?
I have a piece of code that deploys a contract. I would like to deploy this contract to two networks (lets say Goerli and MainnetEthereum). Inside a loop in hardhat script I can change the network ...
1
vote
1
answer
1k
views
Error: could not detect network (event="noNetwork", code=NETWORK_ERROR, version=providers/5.7.2), why can't I deploy to mainnet
require("@nomiclabs/hardhat-ethers");
require ("dotenv").config();
/** @type import('hardhat/config').HardhatUserConfig */
module.exports = {
solidity: "0.8.10",
...
1
vote
1
answer
143
views
I encountered this error when deploying contracts using hardhat and ethers: "TypeError: btc_eth.deployed is not a function". Please help me!
That's my 01-deploy-main.js
const { network, ethers } = require("hardhat")
const { developmentChains } = require("../helper-hardhat-config")
const { relayNetworks } = require("...
0
votes
1
answer
140
views
Deployed smart contract works perfectly on Goerli, gives error when deployed to Mainnet
I deployed my contract to goerli many times, and it runs perfectly, all functions are working, but on the Mainnnet deployment, I'm getting an
We were not able to estimate gas. There might be an error ...