Skip to content

Conversation

rmeissner
Copy link
Member

@rmeissner rmeissner commented Mar 23, 2021

Closes #274

Revert on failure if safeTxGas == 0 and gasPrice == 0

Notes:

  • If safeTxGas is set to 1 you get the previous behaviour

@rmeissner rmeissner requested a review from Uxio0 March 23, 2021 12:22
@@ -170,6 +170,8 @@ contract GnosisSafe
// We only substract 2500 (compared to the 3000 before) to ensure that the amount passed is still higher than safeTxGas
success = execute(to, value, data, operation, gasPrice == 0 ? (gasleft() - 2500) : safeTxGas);
gasUsed = gasUsed.sub(gasleft());
// If no safeTxGas and no gasPrice was set (e.g. both are 0), then the internal tx is required to be successful
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe it can be added to the comment that this behaviour is implemented due to the optimistic estimation of ethereum providers

@rmeissner rmeissner merged commit ac82f3a into development Mar 23, 2021
@rmeissner rmeissner deleted the feature/issue_274_revert_on_failure branch March 23, 2021 22:33
Saw-mon-and-Natalie pushed a commit to Saw-mon-and-Natalie/safe-contracts that referenced this pull request Nov 1, 2023
fdarian pushed a commit to fdarian/safe-contracts that referenced this pull request Jan 14, 2024
Update safe-ethers-adapters README
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

Successfully merging this pull request may close these issues.

If safeTxGas is 0 the tx should be reverted on failure
2 participants