【发布时间】:2020-09-17 01:46:09
【问题描述】:
您好,我遇到了错误
Error: [ethjs-query] while formatting inputs '[{"0":false}]' for method 'getTransactionReceipt' error: Error: [ethjs-format] hex string '[object Object]' must be an alphanumeric 66 utf8 byte hex (chars: a-fA-F) string, is 0 bytes
at ethjs.min.js:11
at new Promise (<anonymous>)
at i.getTransactionReceipt (ethjs.min.js:11)
at i.e.<computed> [as getTransactionReceipt] (ethjs.min.js:11)
at ethjs.min.js:11
我正在调用智能合约投资功能:
function invest()public payable onlyAmount() firstExist returns(bool){
// balances[msg.sender]=msg.value;
invested[msg.sender]+= msg.value;
isInvested[msg.sender]=true;
users[msg.sender].creationTime=now;
commission=(msg.value.mul(10)).div(100);
forCreators(commission);
emit Invest(msg.sender,msg.value);
return true;
}
我在哪里像从 web3.js 调用函数一样
tokenContract.invest({
from: user_address,
gasLimit: web3.toHex(8000000),
gasPrice: web3.toHex(web3.toWei('10', 'gwei')),
value : web3.toHex( web3.toWei(0.25, 'ether'))
})
.then(txHash => eth.getTransactionSuccess(txHash)
.then(receipt => {
alert("Sigup Has been successful",receipt);
})
)
.catch((err) => {
alert("Error couldnot signUp");
console.log(err);
})
所有写入功能都显示此错误.. 读取工作正常。我以前从未遇到过这个错误。我尝试在 Ropsten 和 Rinkeby 上部署合同同样的错误。 这些合约功能在 etherscan 和 remix 上运行良好。 在 web3js 中,甚至 Metamask 也不会出现在事务中。可能是什么问题?
【问题讨论】:
-
我正在使用
标签: blockchain ethereum smartcontracts web3js