I am trying to send ethereum from 1 address to another using php, and everything looks fine but the transaction is not showing up on the network.
I am using this package to make a connection with infura: allmediaindo/infura
I am using this package to create & sign a transaction: web3p/ethereum-tx
This is the code I am currently using to create, sign and send the transaction:
use allmediaindo\Infura\Infura; use Web3p\EthereumTx\EIP2930Transaction; $transaction = new EIP2930Transaction([ 'nonce' => '0x01', 'from' => '0x70abb694597d4b902e4be55429599a703bd1c3bd', 'to' => '0x4be102722f7370ad987f82fbdfa19532141f8b70', 'gas' => '0x' . dechex(50000), 'gasPrice' => '0x' . dechex(20000000000), 'value' => '0x' . dechex(10000000000000000), //0.01eth 'chainId' => 1, 'accessList' => , 'data' => '' ]); $signedTransaction = '0x' . $transaction->sign($privateKey); $client = new Infura('mainnet', $infuraProjectID); $tx = $client->eth_sendRawTransaction($signedTransaction);
The signedTransaction outputs:
And this is the final hash:
I’ve tried using MyCrypto - Ethereum Wallet Manager to manualy send the signed transaction, everything looks good, but it doesn’t show up on the network.
I’m not sure if my gas & gasPrice is good, but if I’m right it is way over the recommended amount.
I am struggling with this for a couple of days now already, so any help would be more than welcome!
Have a good one