blocknative / web3-onboard

Client library to onboard users to web3 apps
https://onboard.blocknative.com/
MIT License
827 stars 486 forks source link

Gnosis safe missing r error #1764

Open tiago138 opened 1 year ago

tiago138 commented 1 year ago

Current Behavior

I am using Ethers v6 Contract interface to send a transaction, but when calling contract.method.send it crashes with signature missing r after confirming on metamask.

I am getting the signer and provider as described in the docs.

Expected Behavior

The contract.method.send should return a valid signature.

Steps To Reproduce

import { ethers } from 'ethers'
import { useConnectWallet } from '@web3-onboard/react'
import ERC20ABI from '@/constants/abi/ERC20.json'

const Test = () => {
  const [{ wallet }] = useConnectWallet()
  async function fun() {
    if (wallet?.provider) {
      const ethersProvider = new ethers.BrowserProvider(wallet.provider, 'any')

      const signer = await ethersProvider.getSigner()
      const contract = new ethers.Contract(
        '0xca813266889e0FD141dF48B85294855616015fA4',
        ERC20ABI,
        signer
      )

      const txn = await contract.approve.send(
        '0x9E3feC2E3AEc12572242dd1376BEd5E1F5bb8200',
        1
      )

      const receipt = await txn.wait()
      console.log(receipt)
    }
  }

  return <button onClick={fun}></button>
}

export default Test

What package is effected by this issue?

@web3-onboard/gnosis

Is this a build or a runtime issue?

Runtime

Package Version

2.1.10

Node Version

16.20

What browsers are you seeing the problem on?

Chrome

Relevant log output

TypeError: missing r (argument="signature", value={ 
"blockHash": null, "blockNumber": null, "from": "0x528e843b6e8F54203f09d57f1eea845F7d46F5ea", "gas": 0, "gasPrice": "0x00", "hash": "0x524af03c02a8175e27cf2b4b5eb521b4269a3ff203f01d9ec029900da2b5f7a6", "input": "0x095ea7b30000000000000000000000009e3fec2e3aec12572242dd1376bed5e1f5bb8200ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff", "nonce": 0, "to": "0xca813266889e0fd141df48b85294855616015fa4", "transactionIndex": null, "value": "0" 
}, code=INVALID_ARGUMENT, version=6.4.2)

Anything else?

No response

Sanity Check

taylorjdawson commented 1 year ago

@Tiago138 Thank you for the detailed repro steps, we'll try and reproduce on our end to figure out why that is crashing for you!