question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

There should be a warning if we know that a Safe tx will fail

See original GitHub issue

What 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 execTransactionreturns 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: image.png

Updates

  • Sep 30, Tobi: Add more context to this.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
rmeissnercommented, Dec 3, 2020

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 is 0. This method should only return 0 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 using 0 for safeTxGas requires special attention (since you need to adjust the gas value manually)

0reactions
Agupanecommented, Dec 3, 2020

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 modal

await safeInstance.methods
      .execTransaction(...args)
      .call()

And this returns the following error:

{
  "originalError": {
    "code": 3,
    "data": "0x08c379a00000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000001a4861736820686173206e6f74206265656e20617070726f766564000000000000",
    "message": "execution reverted: Hash has not been approved"
  }
}

Are we doing something wrong? do you have any ideas about how we should verify if the tx will fail or not

cc: @nicosampler

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found