Skip to content

JSON RPC Signer fails on erc20_contract.transfer #1667

Answered by zemse
SleepingProgrammer asked this question in Q&A
Discussion options

You must be logged in to vote

You can only do the following if you are using a node that contains your private key. Supported backends could be using geth/parity containing accounts as well as exposed over RPC API, metamask or ganache / hardhat network.

const jsonRpcProvider = new ethers.providers.JsonRpcProvider(jsonRpcProviderURI);
var jsonRpcSigner = jsonRpcProvider.getSigner(signerAddress);

But from your error it appears that you're using infura. And infura doesn't support having remote accounts (private key on the node). So jsonRpcProvider.getSigner(signerAddress) won't immediately error but when you go ahead and use it (when you are doing contract.writeMethod), it would fail.

So do you have private key to signe…

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@SleepingProgrammer
Comment options

@zemse
Comment options

zemse Jun 14, 2021
Collaborator

@SleepingProgrammer
Comment options

Answer selected by zemse
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants