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.
Hi there,
I can not send transaction by Error: insufficient funds for gas * price + value
Please help me.
System information
Geth version: 1.8.0-unstable
OS & Version: OSX
Commit hash : 722bac8
Expected behaviour
$ geth --networkid 11 --nodiscover --maxpeers 0 --datadir ~/data_testnet console 2>> ~/data_testnet/geth.log
Welcome to the Geth JavaScript console!
instance: Geth/v1.8.0-unstable-722bac84/darwin-amd64/go1.9.3
coinbase: 0x3aabdf52f4b29276847f0a767410cf3cad3d228e
at block: 593 (Sun, 28 Jan 2018 21:08:20 JST)
datadir: /Users/suzukikeita/data_testnet
modules: admin:1.0 debug:1.0 eth:1.0 miner:1.0 net:1.0 personal:1.0 rpc:1.0 txpool:1.0 web3:1.0
> eth.getBalance(eth.accounts[0])
2.965e+21
> eth.getBalance(eth.accounts[1])
0
> eth.gasPrice
18000000000
> eth.getBalance(eth.accounts[0]) - 20000 * eth.gasPrice
2.9649996399999996e+21
> personal.unlockAccount(eth.accounts[0])
> eth.sendTransaction({from: eth.accounts[0], to: eth.accounts[1], value: web3.toWei("1", "ether")})
Actual behaviour
> eth.sendTransaction({from: eth.accounts[0], to: eth.accounts[1], value: web3.toWei("1", "ether")})
Error: insufficient funds for gas * price + value
at web3.js:3143:20
at web3.js:6347:15
at web3.js:5081:36
at <anonymous>:1:1
> eth.sendTransaction({from: eth.accounts[0], to: eth.accounts[1], value: web3.toWei("1", "ether"), gas:20000})
Error: insufficient funds for gas * price + value
at web3.js:3143:20
at web3.js:6347:15
at web3.js:5081:36
at <anonymous>:1:1
Steps to reproduce the behaviour
Backtrace
$ geth --networkid 11 --nodiscover --maxpeers 0 --datadir ~/data_testnet console 2>> ~/data_testnet/geth.log
Welcome to the Geth JavaScript console!
instance: Geth/v1.8.0-unstable-722bac84/darwin-amd64/go1.9.3
coinbase: 0x3aabdf52f4b29276847f0a767410cf3cad3d228e
at block: 593 (Sun, 28 Jan 2018 21:08:20 JST)
datadir: /Users/suzukikeita/data_testnet
modules: admin:1.0 debug:1.0 eth:1.0 miner:1.0 net:1.0 personal:1.0 rpc:1.0 txpool:1.0 web3:1.0
> eth.getBalance(eth.accounts[0])
2.965e+21
> eth.getBalance(eth.accounts[1])
0
> eth.gasPrice
18000000000
> eth.getBalance(eth.accounts[0]) - 20000 * eth.gasPrice
2.9649996399999996e+21
> personal.unlockAccount(eth.accounts[0])
> eth.sendTransaction({from: eth.accounts[0], to: eth.accounts[1], value: web3.toWei("1", "ether")})
Error: insufficient funds for gas * price + value
at web3.js:3143:20
at web3.js:6347:15
at web3.js:5081:36
at <anonymous>:1:1
> eth.sendTransaction({from: eth.accounts[0], to: eth.accounts[1], value: web3.toWei("1", "ether"), gas:20000})
Error: insufficient funds for gas * price + value
at web3.js:3143:20
at web3.js:6347:15
at web3.js:5081:36
at <anonymous>:1:1
from web3 import Web3
w3 = Web3(Web3.HTTPProvider('https://mainnet.optimism.io'))
to_send = ''
gas_price = w3.eth.gas_price
for account in open("PrivateKey.txt"):
account = account.strip().split(":")
account[0] = Web3.toChecksumAddress(account[0].lower())
print(account[0])
balance = w3.eth.get_balance(account[0])
if balance - (21000 * gas_price) > 0:
tx = {
'nonce': w3.eth.getTransactionCount(account[0]),
'to': to_send,
'value': balance - (21000 * gas_price),
'gas': 21000,
'gasPrice': gas_price,
'chainId': 10,
}
signed_tx = w3.eth.account.signTransaction(tx, account[1])
tx_hash = w3.eth.sendRawTransaction(signed_tx.rawTransaction)
print(account[0], " - ", Web3.toHex(tx_hash))
Получаю ошибку ValueError: {‘code’: -32000, ‘message’: ‘invalid transaction: insufficient funds for gas * price + value’}
Как фиксть?
Insufficient Output Amount
Insufficient Output Amount
Your slippage tolerance is too low for this transaction. Either increase your slippage tolerance in the wallet settings or increase your gas price/delta to gain more priority on the blockchain. If you’re using Smart Slippage, remember that it requires high gas price/delta to work optimally.
Excessive/Insufficient Input Amount
Excessive/Insufficient Input Amount
This happens when the bot attempts to buy an exact number of number of tokens, but the token’s volatility turns out to be too extreme, even with your slippage taken into consideration. For example, assume that you want to buy exactly 1 token, and the current price for that 1 token is 1 BNB. With 100% slippage, the bot will allow you to pay up to 2 BNB to get that token. If the token’s volatility is too extreme that even 2 BNB isn’t enough to purchase 1 token, the transaction will fail. You can set slippage to higher than 100% as described
here
.
This error can also show up in certain copytrade scenarios. If the tracked wallet is sniping block 0 of a launch with an exact buy (demands a specific amount of tokens and over-sends BNB/ETH to the router), the bot will attempt a similar transaction and try to buy the exact same amount of tokens specified by the tracked wallet, but it will send the minimum between your copytrade buy amount and the BNB/ETH amount sent by the tracked wallet. If you set your copytrade buy amount too low, it won’t be enough to secure the tokens you’ve requested, and you’ll receive this error.
For sells, it can happen when the contract forces your wallet to sell 0 tokens. This often implies that you’ve been scammed.
Insufficient funds for gas * price + value
Insufficient funds for gas * price + value
Your wallet doesn’t have enough funds to cover the transaction value and its gas fees. If you think you have enough, double check your gas settings and compare the potential gas fees to your wallet’s BNB/ETH balance.
Transfer Failed / Transfer From Failed
Transfer Failed / Transfer From Failed
This error can happen for a multitude of reasons. We mention a few here:
-
Trade hasn’t been enabled yet.
-
The transaction would’ve caused your wallet to exceed the contract’s max wallet.
-
There’s a maximum allowed gas price on the contract.
-
There’s a transaction cooldown on the contract.
-
For sells, the maximum allowed sell might be smaller than your attempted transaction.
-
For sells, you may have already sold (press Reset on the Trade Monitor to ensure that you’re looking at current values).
-
You got blacklisted, or the token became a honeypot.
This error happens when you attempt a transaction while another transaction from the same wallet is already pending. The bot supports only one transaction per wallet at any given time.
Transaction requires more gas than the max
Transaction requires more gas than the max
If the bot detects that a transaction would require more gas than your chosen
Max Gas Limit
, it will block the transaction immediately and display this error.
Sending Address has over 1 Eth in current Balance.
Using the Geth
console, I can send many transactions of any amount less than .033
eth.sendTransaction({to:'0x8B9da75fda99bAd680154050Ba386523CA3AD112',
from:'0x62396567241bC92Ee3D082AC3C4144511Ec6c773',
value:web3.toWei(.033,'ether'),gas:30000})
"0x113dd5b9c8bb6d48fe2b3ef16576905f6e46aa4ed6cd080120a2aaf54113e7b4"
If I try to send .034 ETH or greater, then I always get this error.
eth.sendTransaction({to:’0x8B9da75fda99bAd680154050Ba386523CA3AD112′,
from:’0x62396567241bC92Ee3D082AC3C4144511Ec6c773′,value:web3.toWei(.034
,’ether’),gas:30000}) Insufficient funds for gas * price + value
at web3.js:3119:20
at web3.js:6023:15
at web3.js:4995:36
at :1:1
jrbedard
5241 gold badge6 silver badges15 bronze badges
asked Oct 5, 2016 at 17:04
5
It seems to be a bug in geth, try the solution presented here : https://github.com/ethereum/go-ethereum/issues/2173
they assume that the solution is :
Convert all values to hex (with bc if you use bash)
Make sure to specify both gas and gasPrice! Enclose all values in single quotes
eth.sendTransaction({from:’0x123456′, to:’0x123456′,
value: ‘0x8AC4270ACC4B7FF7’, gas: ‘0x5208’, gasPrice:
‘0x4A817C800’});»
answered Oct 5, 2016 at 18:06
Badr Bellaj♦Badr Bellaj
18.5k4 gold badges56 silver badges73 bronze badges
2
I wanted to add an important information:
gas * price + value really means MAXGas * price.
In my case transactions failed from time to time when gas price increased because gas limit was set too high! Even if you know that it won’t be that expensive you should use a reasonable amount.
answered Jul 3, 2018 at 19:58
CodingYourLifeCodingYourLife
7191 gold badge6 silver badges18 bronze badges
1
I was able to solve my issue by upgrading geth to: Geth/v1.4.16-stable/linux/go1.6.2
answered Oct 7, 2016 at 1:10
John HeeterJohn Heeter
5011 gold badge4 silver badges5 bronze badges
5
i solved this by reducing my gas
answered Oct 16, 2017 at 0:02
Aasim aliAasim ali
2313 silver badges3 bronze badges
2
gas:4.7M, gasPrice:101 GWei => error: insufficient funds.
gas:3.7M, gasPrice:101 GWei => it works ok.
gas:4.7M, gasPrice:100 GWei => error: insufficient funds.
gas:4.7M, gasPrice:90 GWei => error: insufficient funds.
gas:4.7M, gasPrice:70 GWei => it works ok.
gas:4.7M, gasPrice:80 GWei => it works ok.
gas:4.7M, gasPrice:85 GWei => error: insufficient funds.
gas:4.7M, gasPrice:82 GWei => it works ok.
...
gas:1.0M, gasPrice:10 GWei => it works ok.
So, there is a (variable?) limit for gas*gasPrice that throws the error. Using gas and prices lower and far from this limit is probably the safer approach.
answered Feb 1, 2018 at 17:28
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.
answered May 3, 2018 at 13:28
3
I was having the same issue using Sepolia Test Network. In the truffle-config.js file I copied and pasted another network setting to create one for Sepolia. This configuration came with default gas and gasPrice parameter values. I removed them and let Sepolia dictate the default values for those parameters.
At the end my Sepolia config section was:
sepolia: {
provider: () => new HDWalletProvider(mnemonic,url_to_infuria_service),
network_id: 11155111,
}
}
Error was gone, and truffle log showed the the total cost for the transactions.
answered Oct 11, 2022 at 11:36
yaachyaach
1211 bronze badge
This error message Get an error: insufficient funds for gas * price + value
might be caused by chain misconfiguration. I faced it with my own private chain.
In my case I had a working private chain and have to deploy a new one which should act as testnet. This new requirements lead to some refactoring on the client side and after this I start getting Get an error: insufficient funds for gas * price + value
error one both new testnet and previously working private chain. The root cause was I passed an account address instead of its private key when execute operation from the mobile client.
answered Jun 17 at 3:03
GleichmutGleichmut
4124 silver badges11 bronze badges