TypeError: Cannot read properties of undefined (reading 'toHexString'), when trying to run w. alchemy #356
-
I am at the part in section 5 where we are using alchemy to get a fake address and run our deploy.js code. After copying the private key from alchemy and the rpc, when i try to run node delpoy.js i get this error = "TypeError: Cannot read properties of undefined (reading 'toHexString')" **const ethers = require("ethers"); async function main() { const currentFavoriteNumber = await contract.retrieve(); main() |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 4 replies
-
@armontej |
Beta Was this translation helpful? Give feedback.
@armontej
It is not getting the key properly, and you do not need a private key from Alchemy, you just need an RPC_URL from there, private key should be taken from MetaMask.