如何解决“gas *价格+价值资金不足”的问题?

5 ethereum solidity smartcontracts truffle erc20

windows 10 Home x64
bignumber.js@^7.2.1
openzeppelin-solidity@1.10.0
React@16.4.1
React-dom@16.4.1
truffle@4.1.13
web3@1.0.0-beta.34
完整版本参考:
https ://github.com/tooploox/ethereum-ico-examples/blob/master/package.json

我做了很多研究。我找到了很多来源,但没有一个找到解决方案,并且某些线程不再更新,或者可能他们已经找到答案但没有发布。有些人设法在 Mac 中修复它,但我使用的是 Windows。5个月前有人修好了,但当我尝试时,它没有成功,买来把油调高一点,然后再次运行。6 Ether我的 Ropsten 帐户中也有。

这是我的truffle.js

ropsten: {
  provider: new HDWalletProvider(mnemonic, "https://ropsten.infura.io/"+infura_apikey),
  network_id: 3,
  gas: 4000000
},  
Run Code Online (Sandbox Code Playgroud)

当我truffle migrate --network ropsten

it triggers this error:   
Running migration: 1_initial-migration.js
  Deploying Migrations...
Error encountered, bailing. Network state unknown. Review successful transactions manually.
insufficient funds for gas * price + value
Run Code Online (Sandbox Code Playgroud)

Github 参考:
https://github.com/tooploox/ethereum-ico-examples
指令参考:
https://www.tooploox.com/blog/create-and-distribute-your-erc20-token-with-openzeppelin

Har*_*rsh 4

尝试在 truffle.js 文件中设置 Gas Price。

    gasPrice: 10000000000 // Something price like this
Run Code Online (Sandbox Code Playgroud)

来源

希望这可以帮助!