There should be a warning if we know that a Safe tx will fail
See original GitHub issueWhat is this feature about? (1 sentence)
This will display a warning in case the Safe knows that a tx will (most likely) fail.
Why is it needed? What is the value? For whom do we build it?
- If we know already, that a tx will fail, then we could save users gas costs.
- When executing transactions via MetaMask that will revert, MetaMask warns you before you execute the transaction. An easy example is trying to transfer more ERC20 tokens than the account holds to someone else.
- Because of implementation details the execution transaction for a Safe transaction will not fail, therefore MetaMask cannot warn you.
High-level overview of the feature
- Please check before submitting the execution transaction to the wallet if
execTransaction
returns true. - In case there will be an error, display that to the user. Something like “This transaction will most likely fail.”
- Note 1: This is only possible for the executor, i.e. when all signatures are present.
- Note 2: It should still be possible for the user to submit the tx. There are cases, where estimation is not possible
- Note 3: Please don’t implement the new signing flow design as part of this ticket. That should be done separate.
Misc
This is how Metamask displays this:
Updates
- Sep 30, Tobi: Add more context to this.
Issue Analytics
- State:
- Created 3 years ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
There should be a warning if we know that a Safe tx will fail
This will display a warning in case the Safe knows that a tx will (most likely) fail. Why is it needed? What is...
Read more >Practice - Guidelines - Texas Board of Nursing
APRNs must be aware of the limitations of their own level of knowledge and expertise and must refer appropriately as indicated. APRNs must...
Read more >Section 11 - Pre-trip Vehicle Inspection Test
During the pre-trip inspection, you must show that the vehicle is safe to drive. You may have to walk around the vehicle and...
Read more >About Proposition 65 - OEHHA - CA.gov
Proposition 65 requires businesses to provide warnings to Californians about significant exposures to chemicals that cause cancer, birth defects or other ...
Read more >NHTSA | National Highway Traffic Safety Administration
Get resources and info about staying safe on America's roads. And, find out if there's a recall on your car or how to...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hey @Agupane sorry for the late reply. So the simplest way I see right now using existing code is that you call the
estimateSafeTxGas
method and check if the returned value is0
. This method should only return0
if we cannot estimate the transaction which means that it will most likely fail.Even if this method returns
0
because something else fails, we should warn the user, as using0
forsafeTxGas
requires special attention (since you need to adjust the gas value manually)Hey @rmeissner we have a question about the feature:
Before we ask for the user’s signature we called
execTransaction
with the arguments of the ReviewTransaction modalAnd this returns the following error:
Are we doing something wrong? do you have any ideas about how we should verify if the tx will fail or not
cc: @nicosampler