Skip to content

Commit

Permalink
Catch ContractLogicError on gas estimation
Browse files Browse the repository at this point in the history
  • Loading branch information
Uxio0 committed Sep 12, 2024
1 parent a049c4b commit 31a3f0b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions safe_eth/safe/safe.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
from hexbytes import HexBytes
from web3 import Web3
from web3.contract import Contract
from web3.exceptions import Web3Exception
from web3.exceptions import ContractLogicError, Web3Exception
from web3.types import BlockIdentifier, TxParams, Wei

from safe_eth.eth import EthereumClient, EthereumTxSent
Expand Down Expand Up @@ -1050,7 +1050,7 @@ def estimate_tx_gas_with_safe(
accessible_data = simulator.functions.simulate(
accessor.address, simulation_data
).call(params)
except ValueError as e:
except (ValueError, ContractLogicError) as e:
raise CannotEstimateGas(f"Reverted call using SimulateTxAccessor {e}")
try:
# Simulate returns (uint256 estimate, bool success, bytes memory returnData)
Expand Down

0 comments on commit 31a3f0b

Please sign in to comment.