14

While deploying contract on blockchain, on adding transaction it gives error insufficient funds for

gas *price +value

What is that mean?

Pardeep Jain
  • 84,110
  • 37
  • 165
  • 215
jatin agarwal
  • 153
  • 1
  • 1
  • 5

5 Answers5

9

Value is the amount of Ether set to be transferred with the transaction. E.g. "Send 10 ETH to Contract X."

Gas is the transaction verification fee; basically units of network computing required to execute the transaction. E.g. "30,000 gas estimate".

Price is the bid for Gas, priced in Ether. E.g. "0.0001 ETH/gas". While the gas requirement depends on the complexity of the transaction, the bid for gas is under the sender's control, with higher gas bids incentivizing miners to prioritize the transaction.

Altogether, something like "Send 10ETH to the contract with 30,000 gas in processing at 0.0001 ETH/gas" = total transaction funding required, and it exceeds the sending account balance. Meaning, insufficient funds.

Hope it helps.

Rob Hitchens
  • 1,049
  • 10
  • 14
  • 4
    can you please explain what to write in code to avoid this error ? because this is bit confusuing – Pardeep Jain Oct 30 '17 at 13:49
  • @rob-hitchens If the contract seems to be deployed, but the migration, seems, was not saved "Saving migration to chain.insufficient funds for gas * price + value" , should I re-deploy the contract again? – Svitlana Jul 28 '20 at 12:06
  • Should point *Value* somewhere in code, e.g: truffle.js? – Svitlana Jul 28 '20 at 12:34
  • 1
    Start with `truffle networks` to get a sense of how successful it was. Maybe good maybe not. – Rob Hitchens Jul 28 '20 at 16:03
2

In my private Ethereum Blockchain network, I resolved the issue by changing the chainId variable in my genesis block code to any random number except 0.

Please find the code for my genesis block below:

{
"config":{
        "chainId": 45,
        "homesteadBlock": 0,
        "eip155Block": 0,
        "eip158Block": 0,
        "byzantiumBlock": 12
    },
  "alloc"      : {},
  "coinbase"   : "0x0000000000000000000000000000000000000000",
  "difficulty" : "0x20000",
  "extraData"  : "",
  "gasLimit"   : "0x2fefd8",
  "nonce"      : "0x0000000000000042",
  "mixhash"    : "0x0000000000000000000000000000000000000000000000000000000000000000",
  "parentHash" : "0x0000000000000000000000000000000000000000000000000000000000000000",
  "timestamp"  : "0x00"
}

I hope it might be helpful for you.

Manas Agrawal
  • 111
  • 1
  • 4
2

If you are a Chainlink node operator, to fix this error you will need to fund your oracle account OR the oracle contract.

The oracle contract is what you "deploy" in remix. The oracle account is the page you can log into. See here for more info.

If you are a contract creator, the node operator you are trying to hit may have insufficient ETH in their address, or your contract is not funded properly.

See the example walkthrough for more information on hitting a node.

Jonas Hals
  • 381
  • 2
  • 7
Patrick Collins
  • 5,621
  • 3
  • 26
  • 64
1

I encounter this error for a while. and for those who still have the same issue here are some suggested solution:

  1. make sure you have enough ether in the account provided to the send method.
  2. make sure you provided the send method with the folowing properties : from , gas , gasPrice like so : .send({ from: accounts[0], gas: '0xF4240', gasPrice: '0x4A817C800'})
  3. make sure the gas and gasPrice are hexadecimal.
abdo
  • 11
  • 2
1

in https://dashboard.alchemyapi.io/ go to :

enter image description here

  1. Apps
  2. select your app
  3. Edit App
  4. select chain Ethereum
  5. select network Ropsten

make sure to change the network on Meta Mask from Main Net to Ropstn Test Network. enter image description here

Make sure to have balance in Ropsten network, you can use this url to transfer some Ether to your wallet https://faucet.ropsten.be/

that set.

bara batta
  • 1,002
  • 8
  • 8