{
    "Function": "simulate",
    "File": "contracts/lib/safe-contracts/contracts/accessors/SimulateTxAccessor.sol",
    "Parent Contracts": [
        "contracts/lib/safe-contracts/contracts/base/Executor.sol"
    ],
    "High-Level Calls": [],
    "Internal Calls": [
        "returndatasize()",
        "returndatacopy(uint256,uint256,uint256)",
        "mload(uint256)",
        "gasleft()",
        "execute",
        "gasleft()",
        "mstore(uint256,uint256)",
        "onlyDelegateCall",
        "returndatasize()",
        "mstore(uint256,uint256)",
        "returndatasize()",
        "gasleft()"
    ],
    "Library Calls": [],
    "Low-Level Calls": [],
    "Code": "function simulate(\n        address to,\n        uint256 value,\n        bytes calldata data,\n        Enum.Operation operation\n    )\n        external\n        onlyDelegateCall()\n        returns (\n            uint256 estimate,\n            bool success,\n            bytes memory returnData\n        )\n    {\n        uint256 startGas = gasleft();\n        success = execute(to, value, data, operation, gasleft());\n        estimate = startGas - gasleft();\n        // solhint-disable-next-line no-inline-assembly\n        assembly {\n            // Load free memory location\n            let ptr := mload(0x40)\n            // We allocate memory for the return data by setting the free memory location to\n            // current free memory location + data size + 32 bytes for data size value\n            mstore(0x40, add(ptr, add(returndatasize(), 0x20)))\n            // Store the size\n            mstore(ptr, returndatasize())\n            // Store the data\n            returndatacopy(add(ptr, 0x20), 0, returndatasize())\n            // Point the return data to the correct memory location\n            returnData := ptr\n        }\n    }"
}