Guest User

Untitled

a guest
Nov 21st, 2018
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.09 KB | None | 0 0
  1. $fromAddress = '0x0a2E9bBA44b58841174115b4859297D86d6e8eB0'; // My wallet
  2. $fromPassword = '0x...'; // My pkey
  3. $toAddress = '0x7665822efbd0fde3a4f3f57eccaecdc99b8a64a4'; // A contract address
  4.  
  5. $transaction = new Transaction([
  6. 'nonce' => '0x14',
  7. 'from' => $fromAddress,
  8. 'to' => $toAddress,
  9. 'gas' => '0x5208',
  10. 'gasPrice' => '0x00',
  11. 'value' => '0x016345785d8a0000' // 0.1 eth
  12. ]);
  13.  
  14. <?
  15. require_once('vendor/autoload.php');
  16. use Web3pEthereumTxTransaction;
  17.  
  18. $transaction = ... <the code above>
  19.  
  20. $signedTransaction = $transaction->sign($fromPassword);
  21. ?>
  22.  
  23. 0xf8671480825208947665822efbd0fde3a4f3f57eccaecdc99b8a64a488016345785d8a00008023a0b21679034fd6304c1058a5d7505e284630fec38a0f8d3551261e9c45f056859aa041b397f49f566ce12fec2de93934987d119ab7ced2b0916ddb993b0879707d05
  24.  
  25. 0xf8671480825208947665822efbd0fde3a4f3f57eccaecdc99b8a64a488016345785d8a0000802aa0f0dd7d6e244b43b2ca138fef989c38f40bac304f50f4c052ef0c4175eaffeac3a038cb792e21016c171355afefc821fe9ec3b7accce9a094e7a6f5a9129c34b5ac
  26.  
  27. invalid argument 0: json: cannot unmarshal invalid hex string into Go value of type hexutil.Bytes
Add Comment
Please, Sign In to add comment