[英]Ethereum. Insufficient funds for gas * price + value
I am trying to deploy smart contract to mint NFTs on mainnet, after successful tests on rinkeby.在 rinkeby 上成功测试后,我正在尝试部署智能合约以在主网上创建 NFT。 While trying to deploy to mainnet the folowing error occured:
尝试部署到主网时出现以下错误:
ValueError: insufficient funds for gas * price + value ValueError:gas * 价格 + 价值的资金不足
I'm using brownie with Infura ,and trying to mint ERC-721 tokens.我正在使用带有Infura 的巧克力蛋糕,并尝试铸造 ERC-721 令牌。
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?你的钱包里有足够的 ETH 来支付汽油吗? If you don't have enough ETH in your wallet, that means you cannot pay the gas fee when the scripts run.
如果您的钱包中没有足够的 ETH,则意味着您无法在脚本运行时支付 gas 费。 Place some ETH into your mainnet wallet and that will fix this issue.
将一些 ETH 放入您的主网钱包,这将解决此问题。
When deploying a smart contract, we need to pay the gas
because deployment is a transaction.在部署智能合约时,我们需要
pay the gas
因为部署是一个交易。 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.
除非您的 Ropsten 测试网帐户上已经有一些以太币,否则最简单的方法是在水龙头上请求一些测试以太币。
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.转到Thinklair Ropsten Ether Faucet网站并输入帐户地址(确保将地址值替换为您自己的地址),然后按“给我发送测试以太”按钮。
Alternatively, you can also use the Ropsten faucet to send some testing ether to your account.或者,您也可以使用Ropsten faucet向您的帐户发送一些测试以太币。 However, this faucet seems to have some latency at the time of writing this answer (03 January 2022).
但是,在撰写此答案时(2022 年 1 月 3 日),这个水龙头似乎有一些延迟。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.