0
$result = $client->callMethod('eth_sendTransaction', [array(
                    "from" => $address->address,
                    "to" => "0xac52822dde76b9c4cd701d5f4402acedb2a86cc1",
                    "value" => "0x" . strval(dechex($amount)),
                    "gasPrice" => "0x" . strval(dechex($gasPrice))
                )]);

Hi, when I call the function above I get this result:

{ ["jsonrpc"]=> string(3) "2.0" ["id"]=> int(1) ["error"]=> array(2) { ["code"]=> int(-32000) ["message"]=> string(70) "gas required exceeds allowance (9958635) or always failing transaction" } }

Could you please help me what is wrong? I've tried to increase gasLimit, but got the same result. Also I'm running geth light node if it helps.

Thanks for your help.

  • I'm not sure on how it works with php but why are you adding "0x" to the value and gasPrice? In javascript with web3.js you just assign those fields as integers not hexvalues – Conviley Apr 23 at 6:25
  • It's because default php convert function to hexadecimal convert number without 0x so I'm adding it later – Petr Marek Apr 24 at 17:12
  • This sounds like the from account doesn't have enough balance. How much does it have and is it less than the gasLimit multiplied by the gasPrice? – eth Apr 27 at 5:30
  • Balance is 0.05 and I'm sending 0.02 so balance should be ok – Petr Marek Apr 27 at 14:41

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.