[英]Truffle deploy insufficient funds (despite using Truffle's total price estimates)
1. 试运行部署
Migrations dry-run (simulation)
.....
> Total deployments: 2
> Final cost: 0.058258696 ETH
那是 83.83 美元
3. 仔细检查 mainNet 配置 (truffle truffle-config.js
):
将这些数字插入:
mainnet: {
provider: () =>
new HDWalletProvider({
mnemonic: { phrase: process.env.MNEMONIC },
providerOrUrl: process.env.RPC_URL_1,
}),
network_id: 1,
from: process.env.DEPLOYERS_ADDRESS,
gas: 58258696000000000,
gasPrice: 105000000000,
confirmations: 2,
timeoutBlocks: 200,
skipDryRun: false,
},
4. 部署时间
truffle migrate --network mainnet
结果:
Error: *** Deployment Failed ***
"Migrations" could not deploy due to insufficient funds
所以,我已经...
我在这里有什么遗漏吗?
您的 Gas 值看起来不正确。 检查Dry Run Output ,您将看到> gas used: 4390736
(示例编号)或将合约部署到测试网络或https://remix.ethereum.org以了解使用的 gas,然后在truffle-config.js
中更新gas
。 truffle-config.js
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.