web3-onboard: [Bug]: Gnosis Safe provider does not pick gas limit nor reports errors
Current Behavior
When using the Gnosis Safe provider, the app does not pick the predefined gas limit for the transaction nor it throws an error when the execution of the transaction fails. It didn’t use to be the case a few months ago.
Expected Behavior
I expect the Safe App to pick the predefined gas limit I have computed for that transaction and to throw an error whenever the transaction execution fails.
Steps To Reproduce
- I’m using:
"@web3-onboard/react": "2.3.2",
"@web3-onboard/gnosis": "^2.1.2",
- Go to https://gnosis-safe.io/ and create a safe for your app.
- Then connect using the
@web3-onboard/gnosis
provider. - Start a transaction.
- Notice the gas limit is not being picked up by the value you have computed before sending the transaction to the provider.
What package is effected by this issue?
Is this a build or a runtime issue?
Runtime
Package Version
2
Node Version
No response
What browsers are you seeing the problem on?
Chrome
Relevant log output
No response
Anything else?
The Safe App does report in the console the errors, however those are not surfaced to the application. I’m using ethers@^5.7.0
and calling await transaction.wait()
but the promise never resolves nor rejects.
Sanity Check
- If this is a build issue, I have included my build config. If this is a runtime issue, I have included reproduction steps and/or a Minimal, Reproducible Example.
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Comments: 36 (34 by maintainers)
Hey @Adamj1232, here is a summary of what we are doing to generate the transaction (simplified React code, it won’t work if you copy paste because of lifecycles):
After running that, see the gas limit is not being set to the amount specified:
Then, about the transaction failure not being reported. If I execute the same transaction but set the gas limit low enough to force the transaction to fail, I see these errors in the console but the
transaction.wait()
call never resolves:You can see the transaction failed on MetaMask:
And here is the transaction on explorer.
While trying this, I have also found that if I set the
Nonce
value on the Advanced Parameters dialog, the transaction prompt I’m getting on the wallet does not use it but rather uses the next available one:@mikhailxyz Agreed too, OpenSea being one of them as an example. The difference is that you are leaving place for dApp to make their own judgements and go for your recommendations or stick with theirs. As of right now, dApps are forced to follow your recommendations, which fall short for our business as an example. Hope this conversation makes you reconsider this topic or at least start a conversation about it internally. Thank you again for your help here 😁
We’ll check this. Agree the error message could be improved
@enzoferey Thanks for raising this issue! We’ll take a look this week and see what the issue is!