{
    "Function": "execTransaction",
    "File": "contracts/lib/safe-contracts/contracts/GnosisSafe.sol",
    "Parent Contracts": [
        "contracts/lib/safe-contracts/contracts/base/GuardManager.sol",
        "contracts/lib/safe-contracts/contracts/common/StorageAccessible.sol",
        "contracts/lib/safe-contracts/contracts/base/FallbackManager.sol",
        "contracts/lib/safe-contracts/contracts/interfaces/ISignatureValidator.sol",
        "contracts/lib/safe-contracts/contracts/common/SecuredTokenTransfer.sol",
        "contracts/lib/safe-contracts/contracts/common/SignatureDecoder.sol",
        "contracts/lib/safe-contracts/contracts/base/OwnerManager.sol",
        "contracts/lib/safe-contracts/contracts/base/ModuleManager.sol",
        "contracts/lib/safe-contracts/contracts/base/Executor.sol",
        "contracts/lib/safe-contracts/contracts/common/SelfAuthorized.sol",
        "contracts/lib/safe-contracts/contracts/common/Singleton.sol",
        "contracts/lib/safe-contracts/contracts/common/EtherPaymentFallback.sol"
    ],
    "High-Level Calls": [
        "GnosisSafeMath",
        "GnosisSafeMath",
        "Guard",
        "Guard"
    ],
    "Internal Calls": [
        "gasleft()",
        "getGuard",
        "encodeTransactionData",
        "gasleft()",
        "handlePayment",
        "gasleft()",
        "checkSignatures",
        "require(bool,string)",
        "require(bool,string)",
        "execute",
        "gasleft()",
        "execute",
        "keccak256(bytes)"
    ],
    "Library Calls": [
        "max",
        "sub"
    ],
    "Low-Level Calls": [],
    "Code": "function execTransaction(\n        address to,\n        uint256 value,\n        bytes calldata data,\n        Enum.Operation operation,\n        uint256 safeTxGas,\n        uint256 baseGas,\n        uint256 gasPrice,\n        address gasToken,\n        address payable refundReceiver,\n        bytes memory signatures\n    ) public payable virtual returns (bool success) {\n        bytes32 txHash;\n        // Use scope here to limit variable lifetime and prevent `stack too deep` errors\n        {\n            bytes memory txHashData =\n                encodeTransactionData(\n                    // Transaction info\n                    to,\n                    value,\n                    data,\n                    operation,\n                    safeTxGas,\n                    // Payment info\n                    baseGas,\n                    gasPrice,\n                    gasToken,\n                    refundReceiver,\n                    // Signature info\n                    nonce\n                );\n            // Increase nonce and execute transaction.\n            nonce++;\n            txHash = keccak256(txHashData);\n            checkSignatures(txHash, txHashData, signatures);\n        }\n        address guard = getGuard();\n        {\n            if (guard != address(0)) {\n                Guard(guard).checkTransaction(\n                    // Transaction info\n                    to,\n                    value,\n                    data,\n                    operation,\n                    safeTxGas,\n                    // Payment info\n                    baseGas,\n                    gasPrice,\n                    gasToken,\n                    refundReceiver,\n                    // Signature info\n                    signatures,\n                    msg.sender\n                );\n            }\n        }\n        // We require some gas to emit the events (at least 2500) after the execution and some to perform code until the execution (500)\n        // We also include the 1/64 in the check that is not send along with a call to counteract potential shortings because of EIP-150\n        require(gasleft() >= ((safeTxGas * 64) / 63).max(safeTxGas + 2500) + 500, \"GS010\");\n        // Use scope here to limit variable lifetime and prevent `stack too deep` errors\n        {\n            uint256 gasUsed = gasleft();\n            // If the gasPrice is 0 we assume that nearly all available gas can be used (it is always more than safeTxGas)\n            // We only substract 2500 (compared to the 3000 before) to ensure that the amount passed is still higher than safeTxGas\n            success = execute(to, value, data, operation, gasPrice == 0 ? (gasleft() - 2500) : safeTxGas);\n            gasUsed = gasUsed.sub(gasleft());\n            // If no safeTxGas and no gasPrice was set (e.g. both are 0), then the internal tx is required to be successful\n            // This makes it possible to use `estimateGas` without issues, as it searches for the minimum gas where the tx doesn't revert\n            require(success || safeTxGas != 0 || gasPrice != 0, \"GS013\");\n            // We transfer the calculated tx costs to the tx.origin to avoid sending it to intermediate contracts that have made calls\n            uint256 payment = 0;\n            if (gasPrice > 0) {\n                payment = handlePayment(gasUsed, baseGas, gasPrice, gasToken, refundReceiver);\n            }\n            if (success) emit ExecutionSuccess(txHash, payment);\n            else emit ExecutionFailure(txHash, payment);\n        }\n        {\n            if (guard != address(0)) {\n                Guard(guard).checkAfterExecution(txHash, success);\n            }\n        }\n    }"
}