Closed woniesong92 closed 6 years ago
I am getting this same error using truffle-contract
with MetaMask and Ganache for a local network.
EDIT: In addition to this, I have gotten my logic working on Ropsten Testnet with MetaMask. This seems to be a problem with Ganache
@drewstone It looks like the problem is with the Ganache mac app. I solved this by using ganache-cli instead
Shouldn't it default to the sendTransaction()
method for payable
truffle contract functions?
During testing (with Ganache) it sometimes defaults to sendTransaction()
and othertimes to sendRawTransaction()
:(
Resetting my Ganache accounts in Metamask worked for me https://github.com/trufflesuite/ganache/issues/333. Go to Metamask sidebar >> settings >> reset account
x-posting from https://stackoverflow.com/questions/48498958/sending-a-transaction-fails
I am using web3.js v1.0 with solidity ^0.4.17 with Ganache v1.1.0. I am trying to call a send transaction and it fails with the error message below.
Returned error: Error: Error: [ethjs-query] while formatting outputs from RPC 'undefined' for method 'sendRawTransaction' Error: [ethjs-format] hex string 'undefined' must be an alphanumeric 66 utf8 byte hex (chars: a-fA-F) string, is 0 bytes
MyContract.sol
App.js
Google search results with the error message pointed me to the following issues, but they weren't helpful in my case:
Any help will be appreciated. Feel free to close the issue if it isn't relevant to web3. The contract's function works fine in
truffle console
so I thought I should try here for help. Thank you!