LayerZeroFault
ERC-4337 & Safe CODE: GS013 Reviewed & Verified:

Safe Multisig Error GS013: Transaction Failed Execution Revert

Verified by Victor Vance • Lead Technical Analyst & Systems Researcher
Quick Diagnostic Answer (Executive Summary) GSC Snippet Verified

Safe multisig error GS013 "Safe transaction failed" is emitted by the Gnosis Safe contract when an inner contract call executed via execTransaction reverts. Because Safe encapsulates transactions inside an internal call, the outer multi-sig execution succeeds up to the failure point, and the Safe contract throws GS013 to indicate the target interaction failed. Simulate the transaction with Tenderly or Foundry to inspect the underlying revert reason.

# Root Cause & Technical Architecture

Inside `GnosisSafe.sol`, `execTransaction` executes the transaction payload using low-level `call` or `delegatecall`: `success = execute(to, value, data, operation, ...); require(success, "GS013")`. If the target contract reverts (due to slippage, missing ERC-20 allowance, paused state, or insufficient gas), the low-level call returns `success = false`, and Safe reverts with `GS013`, masking the real sub-call revert reason.

# 4-Step Actionable Diagnostic Protocol

Step-by-Step Resolution
01

Simulate Safe Transaction via Tenderly or Foundry

Export the Safe transaction payload and simulate it in an execution sandbox to view the internal call stack and original revert reason.

02

Check Token Allowances and Balances of Safe Address

Ensure the Safe contract address (not the signer address) holds the required asset balance and has approved the target spender contract.

03

Audit safeTxGas Parameter Setting

When safeTxGas is set to 0, all available gas is forwarded to the inner call. Ensure your RPC or UI does not enforce a restrictive safeTxGas cap.

04

Inspect Target Contract Reentrancy Locks and Pauses

Verify that the target DeFi protocol or bridge is not paused or rejecting calls from contract addresses (non-EOA check).

# Diagnostic Verification Code / Command

bash
trace-safe-gs013.sh
# Trace underlying sub-call revert behind Safe GS013 using Foundry cast
cast call \
  --rpc-url https://eth-mainnet.g.alchemy.com/v2/YOUR_KEY \
  --trace \
  --from 0xSafeOwnerAddress \
  0xYourSafeMultisigAddress \
  "execTransaction(address,uint256,bytes,uint8,uint256,uint256,uint256,address,address,bytes)" \
  $TARGET $VALUE $DATA $OPERATION $SAFE_TX_GAS 0 0 0x0 0x0 $SIGNATURES
Zero-Secrets Client Sandbox

Launch ERC-4337 UserOp Decoder

Execute client-side cryptographic simulation and parameter checks safely in your browser via native WebCrypto without sending private keys or mnemonics over the wire.

Open Sandbox →
Comprehensive In-Depth Guide

Read Full Investigation & Recovery Workflow

Explore complete architectural diagrams, edge-case failure trees, and detailed post-mortem analysis in our verified deep guide.

Read Guide →

# Related Diagnostic Codes in ERC-4337 & Safe

Related Hex Statuses

# Frequently Asked Questions

FAQ Schema

Why does Safe hide the original revert reason behind GS013?

Safe contracts use low-level assembly calls for gas efficiency and modular execution, requiring a simple boolean success check rather than bubbling up custom errors.

Does GS013 mean owner signatures were invalid?

No. Signature validation failures trigger GS020 through GS026. GS013 confirms signatures were valid, but the target contract call itself failed.

Can gas price increases fix error GS013?

No. GS013 is caused by logical reverts in the target contract (e.g. slippage, allowance), not by mempool fee underpricing.