I am using the ethers.js library, and am trying to code a transaction. Here is a snippet where I connect a wallet to a provider, connect to a contract I want to call a function in, and try to call the transfer function in the target contract, using the promise generated to sign the transaction with my wallet:

let mywallet =wallet.connect(providers)
let contract=new ethers.Contract(contractadd,abi,mywallet)
let signpromise=mywallet.sign(tx)

When I try to execute this, I get the following error:

invalid object key v

Why isn't the sign function working? Thanks.

  • 2
    i use web3js and not ether.js but probably you should sign the tx before sending it and not after :/
    – Majd TL
    Mar 27, 2020 at 14:19
  • Which provider are you using? Does it support signing transactions?
    – Ismael
    Mar 27, 2020 at 16:58
  • I'm not sure exactly how to signal this, but I believe this question is now clear enough to be reopened. Mar 29, 2020 at 15:52


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.