home / skills / openclaw / skills / safe-multisig

This skill helps you manage Safe multisig accounts by creating, proposing, approving, and executing on-chain transactions across networks.

npx playbooks add skill openclaw/skills --skill safe-multisig

Review the files below or copy the command above to add this skill to your agents.

Files (24)
SKILL.md
3.4 KB
---
name: safe-multisig-skill
description: Propose, confirm, and execute Safe multisig transactions using the Safe{Core} SDK (protocol-kit v6 / api-kit v4). TypeScript strict. Use when an agent needs to operate a Safe smart account — (1) create/predict a new Safe, (2) fetch Safe owners/threshold/nonce, (3) list pending multisig txs, (4) build + propose a tx, (5) add confirmations, (6) execute a tx onchain, or (7) troubleshoot Safe nonce/signature issues across chains (Base/Ethereum/Optimism/Arbitrum/Polygon/etc.).
---

# Safe Multisig Skill

TypeScript-strict scripts for interacting with Safe multisig accounts via:
- **Safe Transaction Service** (read state, propose txs, submit confirmations)
- **Safe{Core} SDK** (create Safes, create txs, compute hashes, sign, execute)

All scripts use `ethers v6`, validate inputs (addresses, tx hashes), and output JSON.

## Quick start

```bash
cd <this-skill>
./scripts/bootstrap.sh

# sanity check network + service
./scripts/safe_about.sh --chain base
```

## Core scripts

| Script | Description |
|--------|-------------|
| `create-safe.ts` | Predict address + optionally deploy a new Safe |
| `safe-info.ts` | Fetch Safe info (owners/threshold/nonce) |
| `list-pending.ts` | List pending (queued) multisig transactions |
| `safe_txs_list.ts` | List all multisig transactions (queued + executed) |
| `propose-tx.ts` | Create + propose a multisig tx |
| `approve-tx.ts` | Add an off-chain confirmation for a tx hash |
| `execute-tx.ts` | Execute a fully-confirmed tx onchain |

All scripts: `npx tsx scripts/<name>.ts --help`

## Common tasks

### 1) Create a new Safe

```bash
npx tsx scripts/create-safe.ts \
  --chain base \
  --owners 0xOwner1,0xOwner2,0xOwner3 \
  --threshold 2
```

Add `--deploy` + `SAFE_SIGNER_PRIVATE_KEY` to send the deployment tx.

### 2) Get Safe info

```bash
npx tsx scripts/safe-info.ts --chain base --safe 0xYourSafe
```

### 3) List pending transactions

```bash
npx tsx scripts/list-pending.ts --chain base --safe 0xYourSafe
```

### 4) Propose a new transaction

Create a tx request JSON (see `references/tx_request.schema.json` and `references/examples.md`).

```bash
export SAFE_SIGNER_PRIVATE_KEY="..."

npx tsx scripts/propose-tx.ts \
  --chain base \
  --rpc-url "$BASE_RPC_URL" \
  --tx-file ./references/example.tx.json
```

### 5) Confirm (approve) a proposed transaction

```bash
export SAFE_SIGNER_PRIVATE_KEY="..."

npx tsx scripts/approve-tx.ts \
  --chain base \
  --safe 0xYourSafe \
  --safe-tx-hash 0x...
```

### 6) Execute a confirmed transaction (onchain)

```bash
export SAFE_SIGNER_PRIVATE_KEY="..."

npx tsx scripts/execute-tx.ts \
  --chain base \
  --rpc-url "$BASE_RPC_URL" \
  --safe 0xYourSafe \
  --safe-tx-hash 0x...
```

## Configuration

All scripts accept:
- `--chain <slug>` (recommended): e.g. `base`, `base-sepolia`, `mainnet`, `arbitrum`, `optimism`
- `--tx-service-url <url>`: Override the transaction service URL
- `--rpc-url <url>`: RPC endpoint (or `RPC_URL` env var)
- `--api-key <key>`: Safe Transaction Service API key (or `SAFE_TX_SERVICE_API_KEY` env var)

## Security rules

- **Never paste private keys into chat.** Use env vars or files.
- Prefer low-privilege signers and spending limits.
- Always verify Safe address, chainId / RPC, and nonce before signing.

## References

- `references/examples.md` — example requests + workflows
- `references/tx_request.schema.json` — tx request JSON shape
- `references/tx_service_slugs.md` — chain slugs + notes

Overview

This skill provides TypeScript-strict tooling to propose, confirm, and execute Safe multisig transactions using the Safe{Core} SDK (protocol-kit v6 / api-kit v4). It covers Safe creation/prediction, state inspection, building and proposing transactions, collecting confirmations, and onchain execution across EVM chains like Base, Ethereum, Optimism, Arbitrum, and Polygon. All scripts validate inputs, use ethers v6, and emit JSON for easy automation.

How this skill works

The scripts communicate with the Safe Transaction Service for reading Safe state and submitting proposals and confirmations, and use the Safe{Core} SDK for local transaction construction, hash computation, signing, and execution. Common operations are exposed as standalone scripts (create, info, list, propose, approve, execute) that accept chain, RPC, and service URL overrides. Private keys are consumed via environment variables to sign proposals or send deployment/execution transactions.

When to use it

  • You need to predict or deploy a new Safe programmatically and verify its address before funding.
  • You must inspect Safe owners, threshold, or nonce to reconcile multisig state across chains.
  • You want to list pending or historical multisig transactions for auditing or dashboards.
  • You need to build and propose a multisig transaction to the Safe Transaction Service.
  • You must add an off-chain confirmation (signature) and then execute an onchain transaction.
  • You are troubleshooting nonce or signature mismatches across RPCs or transaction services.

Best practices

  • Never paste private keys into chat or code; provide them via secure environment variables or vaults.
  • Verify Safe address, chainId, RPC endpoint, and current nonce before signing or executing.
  • Use low-privilege signers and on-chain spending limits where possible to reduce risk.
  • Run scripts with --help and validate tx request JSON against the provided schema before proposing.
  • Prefer the transaction service API key and explicit tx-service-url when working across networks.

Example use cases

  • Predict a Safe address for a multisig treasury, then deploy it with a designated deployer key.
  • Fetch owners and threshold to display Safe metadata in a wallet or dashboard.
  • Build a multisig tx JSON, propose it to the Safe Transaction Service, and notify owners to sign.
  • Submit an off-chain approval signature from an owner, then execute the confirmed tx onchain.
  • List queued multisig transactions to identify stuck proposals and resolve nonce conflicts.

FAQ

Which chains are supported?

Any EVM-compatible chain supported by the transaction service and SDK, including Base, Ethereum, Optimism, Arbitrum, and Polygon; specify chain slug or RPC URL.

How do I provide private keys securely?

Supply signer keys via environment variables (e.g., SAFE_SIGNER_PRIVATE_KEY) or a secure key manager; do not hardcode or paste keys.