松露部署错误:天然气资金不足*价格+价值

时间:2018-12-14 17:55:56

标签: truffle

错误:汽油资金不足*价格+价值。 我已经阅读了所有类似的问题,但仍然找不到解决方案。 需要帮助。

复制步骤

当我将合同部署到开发网络时,它就会成功。

ganache-cli truffle migrage --reset

预期行为

Using network 'development'.
Running migration: 1_initial_migration.js
Deploying Migrations...
  ... 0x1120e00f84f67f7b464f8d532f2cb9a6aaa9339615789dc8c47c9690e1e45486
  Migrations: 0xc9ab5eb6d7c870262e2c311b82773b783c2f6ecc
Saving successful migration to network...
  ... 0xe2f7a1ced7741e4a8709bbda3ec62ecedf1c0335e0b811c7c760de8e28f7bab6
Saving artifacts...
Running migration: 2_deploy_token.js
  Deploying MyToken...
  ... 0xfd2d6182f6e9ddf0f6c189cdc8f131739f0d44427a61428cc2d5939ed15d2254
  MyToken: 0xdc97f1927bbce8211ebf96123e06d6cdcf6b2c65
Saving successful migration to network...
  ... 0x5119cf6d6ee12fc25853a0d37417beebce8188d18ca6bf4e7ba0b66904a2bf18
Saving artifacts...

但是当我部署到rinkeby时,出现了错误。

geth --unlock  be255696870b84c69f6e2b902177cf2a2cb57b58 --rinkeby --rpc --rpcapi db,eth,net,web3,personal  
truffle migrate --network rinkeby

实际结果

Using network 'rinkeby'.

Running migration: 1_initial_migration.js
  Deploying Migrations...
  ... undefined
Error encountered, bailing. Network state unknown. Review successful transactions manually.
Error: insufficient funds for gas * price + value
    at Object.InvalidResponse (/Users/tmd/.nvm/versions/node/v8.9.4/lib/node_modules/truffle/build/webpack:/~/web3/lib/web3/errors.js:38:1)
    at /Users/tmd/.nvm/versions/node/v8.9.4/lib/node_modules/truffle/build/webpack:/~/web3/lib/web3/requestmanager.js:86:1
    at /Users/tmd/.nvm/versions/node/v8.9.4/lib/node_modules/truffle/build/webpack:/packages/truffle-migrate/index.js:225:1
    at /Users/tmd/.nvm/versions/node/v8.9.4/lib/node_modules/truffle/build/webpack:/packages/truffle-provider/wrapper.js:134:1
    at XMLHttpRequest.request.onreadystatechange (/Users/tmd/.nvm/versions/node/v8.9.4/lib/node_modules/truffle/build/webpack:/~/web3/lib/web3/httpprovider.js:128:1)
    at XMLHttpRequestEventTarget.dispatchEvent (/Users/tmd/.nvm/versions/node/v8.9.4/lib/node_modules/truffle/build/webpack:/~/xhr2/lib/xhr2.js:64:1)
    at XMLHttpRequest._setReadyState (/Users/tmd/.nvm/versions/node/v8.9.4/lib/node_modules/truffle/build/webpack:/~/xhr2/lib/xhr2.js:354:1)
    at XMLHttpRequest._onHttpResponseEnd (/Users/tmd/.nvm/versions/node/v8.9.4/lib/node_modules/truffle/build/webpack:/~/xhr2/lib/xhr2.js:509:1)
    at IncomingMessage.<anonymous> (/Users/tmd/.nvm/versions/node/v8.9.4/lib/node_modules/truffle/build/webpack:/~/xhr2/lib/xhr2.js:469:1)
    at emitNone (events.js:111:20)
    at IncomingMessage.emit (events.js:208:7)
    at endReadableNT (_stream_readable.js:1055:12)
    at _combinedTickCallback (internal/process/next_tick.js:138:11)
    at process._tickCallback (internal/process/next_tick.js:180:9)

truffle.js

module.exports = {
  networks:{
    development:{
      host:'127.0.0.1',
      port:8545,
      network_id:'*'
    },
    rinkeby: {
      host: "localhost",
      port: 8545,
      from: "0xBe255696870b84C69F6e2b902177Cf2a2cB57B58",
      network_id: 4,
      gas: 4700000,
    }
  },
  solc:{
    optimizer:{
      enabled: true,
      runs: 200
    }
  }
};

环境

  • 操作系统:mac ox
  • 以太坊客户端:
  • 松露版本(Truffle v4.1.5 (core: 4.1.5) Solidity v0.4.21 (solc-js)):
  • 节点版本(v8.9.4):
  • npm版本(6.4.1):

0 个答案:

没有答案