feat: add gnosis-safe skill#385
Conversation
Adds a comprehensive skill for interacting with Gnosis Safe multisig wallets via the Safe Transaction Service API and Bankr. Operations covered: - Check Safe info (nonce, threshold, owners, balance) - Propose transactions with EIP-712 hash computation - List pending transactions with confirmation status - Check on-chain hash approvals - Execute transactions when threshold is met Implementation approach: - EIP-712 safeTxHash computed in Python (eth_utils.keccak) - On-chain approveHash() called via Bankr (avoids local key requirement) - Contract signature encoding (v=1) for Safe TX Service compatibility - Supports Base, Ethereum, and Polygon chains Includes: - SKILL.md with full docs and workflow examples - scripts/propose_tx.py - Python CLI for proposing transactions - scripts/safe_info.sh - bash script for Safe status queries - scripts/list_pending.sh - bash script for pending tx listing - references/safe-api.md - Safe Transaction Service API reference
9c174da to
0ee9ee8
Compare
Critical fixes: - C1: Replace non-existent 'bankr key address' with 'bankr whoami' (with --json flag first, plain fallback, then --signer override as last resort) - C2: Replace non-existent 'bankr call --abi --args' with 'bankr agent' natural-language prompt to submit raw approveHash calldata Major fixes: - M1: Change 'data: None' to 'data: "0x"' for empty calldata in post_proposal() - M2: Add validate_address() with checksum validation for --safe and --to args - M3: Remove --rpc flag (Bankr handles chain routing via chain ID) - M4: Remove --key flag (Bankr uses single authenticated key from config/env) - M6: Fix SKILL.md 'bankr address add' -> Bankr dashboard or bankr agent prompt Also updates SKILL.md Operation 4 and 5 to remove non-existent 'bankr call' references and show correct 'bankr agent' approach. Fixes error table entry for approveHash trusted address requirement.
|
Thanks for the thorough review — the critical findings about non-existent Bankr CLI commands are accurate and I've addressed all of them. Here's what changed: 🔴 Critical FixesC1:
|
Summary
Adds a
gnosis-safeskill for interacting with Gnosis Safe multisig wallets via the Safe Transaction Service API and Bankr.Operations
approveHash()+ off-chain proposal postingapprovedHashes(address,bytes32)Implementation approach
Since Bankr holds the private key server-side, we use on-chain
approveHash(bytes32)instead of local ECDSA signing. The Safe Transaction Service then accepts a "contract signature" (v=0x01 type) when the proposal is posted.EIP-712 hash computation (Python, tested on Base):
Contract signature encoding:
Files
SKILL.md— full documentation with workflow and examplesscripts/propose_tx.py— Python CLI (argparse) for proposing txsscripts/safe_info.sh— bash script for Safe statusscripts/list_pending.sh— bash script for pending tx listingreferences/safe-api.md— Safe Transaction Service API referenceChains supported
safe-transaction-base.safe.globalsafe-transaction-mainnet.safe.globalsafe-transaction-polygon.safe.globalNote
Requires the Safe contract address to be added to Bankr's trusted addresses list before
approveHashcalls will succeed.