Skip to content

Add simulateTransaction Function for Static Safe Transaction Simulation #788

@mshakeg

Description

@mshakeg

Context / issue

IMU Safe contract does not currently have the functionality to simulate a safe transaction without requiring the threshold of owner signatures. This limitation makes it difficult to estimate gas usage or verify if a transaction would succeed without actually executing it. As a result, users and developers face challenges in performing pre-execution checks especially on chains not supported by Tenderly(not too sure how tenderly gets around this issue).

Proposed solution

To address this issue, I propose adding a new function, simulateTransaction, to the Safe contract. This function will allow for the simulation of transactions in a secure manner without requiring the threshold of owner signatures. To enable this the Safe will have to delegatecall to a new contract that does Executor.execute but immediately afterwards reverts to undo any state changes. This feature will enable users to eth_call the simulateTransaction function to obtain transaction success status, gas used, and the transaction hash, enhancing the ability to perform pre-execution checks. This external contract should be immutably configured somewhere, perhaps singularly in the Safe implementation contract.

Alternatives

Do what Tenderly does, though not sure what they do and if it's generally achievable across EVM chains, if so, then ideally this simulation should be exposed via a function in the ts sdk.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions