Truffle – SendTransaction to Contract Address Returns Revert

contract-developmentrevert-opcodetruffle

I have a contract address not a deployed contract instance in which i want to send ETH to but it fails giving Error: VM Exception while processing transaction: revert

MyContract.deployed()
  .then(async instance => {
 ...
var send = await web3.eth.sendTransaction({
    from: account[0],
    to: contract_addr, 
    value: weiSpend
  });
});

testRPC

 Transaction: 0xfe824090f7cc99d85041d4ad7dde7bf91f36587871546faf97ca33641ad08e73
  Gas usage: 21046
  Block Number: 27
  Block Time: Mon Jan 22 2018 11:49:03 GMT-0600 (CST)
  Runtime Error: revert

Best Answer

Fallback payable function was missing

function() payable{
}
Related Topic