[英]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.