简体   繁体   中英

Ethereum. Insufficient funds for gas * price + value

I am trying to deploy smart contract to mint NFTs on mainnet, after successful tests on rinkeby. While trying to deploy to mainnet the folowing error occured:

ValueError: insufficient funds for gas * price + value

I'm using brownie with Infura ,and trying to mint ERC-721 tokens.

I would be grateful for any help!

Here's my console output:

Brownie v1.16.2 - Python development framework for Ethereum

NftProject is the active project.

Running 'scripts/simple_collectible/deploy_simple.py::main'...
mainnet
File "/usr/local/lib/python3.8/dist-packages/brownie/_cli/run.py", line 49, in main
    return_value, frame = run(
  File "/usr/local/lib/python3.8/dist-packages/brownie/project/scripts.py", line 103, in run
    return_value = f_locals[method_name](*args, **kwargs)
  File "./scripts/simple_collectible/deploy_simple.py", line 10, in main
    SimpleCollectible.deploy({"from": dev}, publish_source=publish_source)
  File "/usr/local/lib/python3.8/dist-packages/brownie/network/contract.py", line 599, in __call__
    return tx["from"].deploy(
  File "/usr/local/lib/python3.8/dist-packages/brownie/network/account.py", line 508, in deploy
    receipt, exc = self._make_transaction(
  File "/usr/local/lib/python3.8/dist-packages/brownie/network/account.py", line 743, in _make_transaction
    exc = VirtualMachineError(e)
  File "/usr/local/lib/python3.8/dist-packages/brownie/exceptions.py", line 85, in __init__
    raise ValueError(exc["message"]) from None
ValueError: insufficient funds for gas * price + value```

Does your wallet have enough ETH on it to pay for gas? If you don't have enough ETH in your wallet, that means you cannot pay the gas fee when the scripts run. Place some ETH into your mainnet wallet and that will fix this issue.

When deploying a smart contract, we need to pay the gas because deployment is a transaction. So, we need to send some Ether to this account first. Unless you already have some Ether on your Ropsten testnet account, the easiest way is to request some testing Ether on the Faucet.

Go to Thinklair Ropsten Ether Faucet websites and type in the account address (make sure to replace the address value with your own) and press the “Send me test Ether” button.

Alternatively, you can also use the Ropsten faucet to send some testing ether to your account. However, this faucet seems to have some latency at the time of writing this answer (03 January 2022).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM