trustwallet / wallet-connect-swift

WalletConnect Swift client SDK
MIT License
116 stars 131 forks source link

Issue using Wallet Connect #34

Closed anxolin closed 4 years ago

anxolin commented 4 years ago

Hello, for some reason TrustWallet seems to not work any more with Wallet Connect

We've received lot's of reports of issues that all they have Trust Wallet in common. The most common error we see of those is: gas required exceeds allowance (11720486) or always failing transaction (-32000)

Gnois Safe: image

Mesa: image

The two examples, are two dapps where is currently failing any transaction.

We thought at first it could be a bad "Gas Limit" estimation in Trust Wallet. But if we provide the gas information in the transaction config, we still get the same error. Even if we overestimate it.

I believe this was working on the past, so it must be something more or less recent. Can you help me with this issue?

hewigovens commented 4 years ago

Thanks for reporting, will debug it later, I had same error before (zero balance will cause gas estimate always failed)

hewigovens commented 4 years ago

@anxolin I tried http://mesa.eth.link/ with WETH approval tx:

https://etherscan.io/tx/0x3882fa0522df212423299cc486b6f9ce10ba128d6f9c000523593a332aff7154

The request was below, note no gas or gasLimit

{
    "id": 1593598816011953,
    "jsonrpc": "2.0",
    "method": "eth_sendTransaction",
    "params": [{
        "from": "0x7d8bf18c7ce84b3e175b339c4ca93aed1dd166f1",
        "to": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
        "gasPrice": "0x9c81e1442",
        "data": "0x095ea7b30000000000000000000000006f400810b62df8e13fded51be75ff5393eaa841fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"
    }]
}
anxolin commented 4 years ago

Hei @hewigovens!

Thanks for taking a look to this.

Yes, after creating the issue I was talking to @vikmeup. Sorry I forgot to report back here. We were aware we don't send the gasLimit. All the other wallets we use estimate, and I believe in the past either directly or indirectly (geth) I think Trust Wallet was estimating, because we didn't observe any issues some time ago.

We'll add soon the gas limit to ensure compatibility!

vikmeup commented 4 years ago

Hei @hewigovens!

Thanks for taking a look to this.

Yes, after creating the issue I was talking to @vikmeup. Sorry I forgot to report back here. We were aware we don't send the gasLimit. All the other wallets we use estimate, and I believe in the past either directly or indirectly (geth) I think Trust Wallet was estimating, because we didn't observe any issues some time ago.

We'll add soon the gas limit to ensure compatibility!

I suggest you never trust any providers to estimate anything for you, the more accurate you are the better.

Latest version of WalletConect does calculation, but we never advise to delegate this to the wallet side. You should not trust other providers - always trust your code instead.