【发布时间】:2018-11-06 00:23:54
【问题描述】:
我正在尝试在 rinkeby 测试网上使用以下代码部署联系人:
const result = await new web3.eth.Contract(JSON.parse(interface))
.deploy({data: bytecode, arguments: [100, accounts[0]]})
.send({gas: 1000000, from: accounts[0]});
Attempting to deploy from acount 0xBE80D3f83530f2Ed1214BE5a7434E0cd32177047
(node:3862) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): Error: The contract code couldn't be stored, please check your gas limit.
When I increase the gas limit to 10000000
I get below error. Not able to understand what is wrong with the deployment
Attempting to deploy from acount 0xBE80D3f83530f2Ed1214BE5a7434E0cd32177047
(node:3870) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): Error: exceeds block gas limit
【问题讨论】:
-
你能出示你的合同吗?这个gas限制似乎太低了。
标签: mocha.js solidity web3 truffle