Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expose revert message when internal transaction fails and safeTxGas/gasPrice are 0 #715

Open
froggiedev opened this issue Dec 13, 2023 · 0 comments

Comments

@froggiedev
Copy link

Context / issue

As per #274, (explained here) will revert if the internal Safe transaction fails and both safeTxGas and gasPrice are set to 0.

In this case, it would be very helpful to expose the actual revert message of the failing transaction, so it can be debugged. Currently, the contract just reverts with GS013, which is not in fact helpful in this case.

Proposed solution

Expose the revert message using the following code, or similar:

success = execute(to, value, data, operation, gasPrice == 0 ? (gasleft() - 2500) : safeTxGas);
        
if (!success) {
    assembly {
           returndatacopy(0, 0, returndatasize())
           revert(0, returndatasize())
     }
 }

Alternatives

Use a different method to return the original revert string.

Additional context

Returning GS013 in the case where the internal transaction fails leads to a wild goose change that eventually leads users here. Once a user gets here, it is nearly impossible to find the actual reason for the transaction failing without a long game of guess-and-check.

@froggiedev froggiedev changed the title Expose revert message when Expose revert message when internal transaction fails and safeTxGas/gasPrice are 0 Dec 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant