1

When I run the command "npx hardhat run scripts/deploy.js --network goerli" it gives me the error Error: insufficient funds for intrinsic transaction cost. More specifically looks like this:

  • reason: 'insufficient funds for intrinsic transaction cost',
  • code: 'INSUFFICIENT_FUNDS',
  • error: ProviderError: insufficient funds for gas * price + value

When I deploy it without "--network goerli"" it deploys it to an static address apparently which allows to make tests but I am not sure if it is the correct way to do it .

On my metamask account I have 0.0193 GoerliETH .

Deploy.js file looks like this.

const main = async () => {
  const transactionsFactory = await hre.ethers.getContractFactory("Transactions");
  const transactionsContract = await transactionsFactory.deploy();

  await transactionsContract.deployed();

  console.log("Transactions address: ", transactionsContract.address);
};

const runMain = async () => {
  try {
    await main();
    process.exit(0);
  } catch (error) {
    console.error(error);
    process.exit(1);
  }
};

runMain();

Hardhat.config.js looks like this where I specified the alchemy https and also the private key of my metamask account.


require('@nomiclabs/hardhat-waffle');

module.exports={
  solidity:'0.8.0',
  networks:{
    goerli:{
      url:'xxx',
      accounts:['xxx']
    }
  }
}
3
  • Your wallet doesn't have enough ether may be Check it Mar 15 at 13:17
  • @SolidityLearner you have any idea how many goeth are required to deploy a contract in goerli network ? Mar 15 at 14:08
  • It depends on the gas price. 0.1 eth is more than enough Mar 16 at 4:23

2 Answers 2

1

Going off what Lauri was saying, Goerli testnet is not worth testing on anymore. ETH Foundation has already started deprecating and is setting end of life date for Georli in Dec 2023: https://github.com/eth-clients/goerli

You should use Sepolia, no supply constraints:

Sepolia details:

Chain ID: 11155111

Currency: ETH

Block Explorer: https://sepolia.etherscan.io

RPC URL: https://eth-sepolia.g.alchemy.com/v2/your-alchemy-api-key

Public RPC Endpoint: https://eth-sepolia.g.alchemy.com/v2/demo

Sepolia Overview: https://www.alchemy.com/overviews/sepolia-testnet

Sepolia Faucet: https://sepoliafaucet.com

1
  • Some users have pointed out that if you keep posting Alchemy links, you should continue to add the disclaimer that you work for Alchemy (because people may not have read your other answer where you posted the disclaimer). Thank you
    – eth
    Mar 24 at 21:01
0

As mentioned in the comments already, your account simply doesn't have enough Ether to pay for the deployment.

Goerli should not be used for testing dapps anymore. And in any case, it's very badly suited for that nowadays, since getting Goerli ethers is a big pain in the ass. Also fees in Goerli are sometimes super high nowadays. Goerli is nowadays aimed only for testing protocol staking functionality.

Instead of Goerli you should use the Sepolia testnet. Much easier to get testnet ethers and it's aimed for dapp testing.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.