1

Code contract:

pragma solidity <0.7.0;

contract contr{

  function money()public payable{
     msg.sender.transfer(5 ether);
  }
}

ABI contract: [{"inputs":[],"name":"money","outputs":[],"stateMutability":"payable","type":"function"}]

I call the function from the geth console this way: contr.money.sendTransaction({from: eth.accounts[0], value: 50000000000000000000})

also called like this: contr.money.sendTransaction({from: eth.accounts[0], to: contr.address, value: 50000000000000000000}) The error does not chang

в

green_tea
  • 11
  • 2

1 Answers1

0

https://github.com/ethereum/go-ethereum/issues/20760#issue-580263987

You have to add "payable": "true" to the ABI.

cobordism
  • 146
  • 1