Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $fromAddress = '0x0a2E9bBA44b58841174115b4859297D86d6e8eB0'; // My wallet
- $fromPassword = '0x...'; // My pkey
- $toAddress = '0x7665822efbd0fde3a4f3f57eccaecdc99b8a64a4'; // A contract address
- $transaction = new Transaction([
- 'nonce' => '0x14',
- 'from' => $fromAddress,
- 'to' => $toAddress,
- 'gas' => '0x5208',
- 'gasPrice' => '0x00',
- 'value' => '0x016345785d8a0000' // 0.1 eth
- ]);
- <?
- require_once('vendor/autoload.php');
- use Web3pEthereumTxTransaction;
- $transaction = ... <the code above>
- $signedTransaction = $transaction->sign($fromPassword);
- ?>
- 0xf8671480825208947665822efbd0fde3a4f3f57eccaecdc99b8a64a488016345785d8a00008023a0b21679034fd6304c1058a5d7505e284630fec38a0f8d3551261e9c45f056859aa041b397f49f566ce12fec2de93934987d119ab7ced2b0916ddb993b0879707d05
- 0xf8671480825208947665822efbd0fde3a4f3f57eccaecdc99b8a64a488016345785d8a0000802aa0f0dd7d6e244b43b2ca138fef989c38f40bac304f50f4c052ef0c4175eaffeac3a038cb792e21016c171355afefc821fe9ec3b7accce9a094e7a6f5a9129c34b5ac
- invalid argument 0: json: cannot unmarshal invalid hex string into Go value of type hexutil.Bytes
Add Comment
Please, Sign In to add comment