Guest User

Untitled

a guest
Dec 11th, 2018
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.63 KB | None | 0 0
  1. if (json.crypto.kdf === 'scrypt') {
  2. ^
  3. TypeError: Cannot read property 'kdf' of undefined
  4. at Accounts.decrypt
  5.  
  6. const Web3 = require('web3');
  7. const Tx = require('ethereumjs-tx')
  8. const web3 = new Web3(new Web3.providers.HttpProvider("https://mainnet.infura.io/v3/f..."));
  9. var fs = require('fs');
  10.  
  11. const contractAddress = "0x...";
  12. const sendingAccount = "0x...";
  13. const password = "...";
  14.  
  15. var abiArray = JSON.parse(getAbi());
  16. var contract = new web3.eth.Contract(abiArray,contractAddress);
  17.  
  18. const keystore = fs.readFileSync("UTC--...", 'utf8');
  19. const decryptedAccount =
  20. web3.eth.accounts.decrypt(JSON.parse(keystore), password);
Add Comment
Please, Sign In to add comment