Skip to content

Sign approve_hash with hardware wallets - #9

Closed
techdigger wants to merge 1 commit into
mainfrom
approve-hash-hardware-wallet
Closed

techdigger wants to merge 1 commit into
mainfrom
approve-hash-hardware-wallet

Conversation

@techdigger

Copy link
Copy Markdown

What

approve_hash signs with the hardware wallet's get_signed_raw_transaction when the sender is a Ledger or Trezor, and with sign_transaction for a local key.

Why

approve_hash calls sender_account.sign_transaction. Local accounts have that method. Ledger and Trezor senders don't, so the call raises AttributeError and a hardware-wallet owner can't approve a Safe transaction hash on chain. On chains without a Safe Transaction Service, owners on separate machines collect signatures through approve_hash.

Tested

A new test runs approve_hash with a sender that has get_signed_raw_transaction and no sign_transaction, as a hardware wallet does:

  • without the change it fails with AttributeError;
  • with it, the Safe records the approval.

The change makes the same get_signed_raw_transaction(tx, chain_id) call that execute_safe_tx makes for Ledger and Trezor. I did not run it with a physical device.


Generated by Claude Code

approve_hash calls sender_account.sign_transaction. Local accounts have
that method. Ledger and Trezor senders don't, so the call raises
AttributeError and a hardware-wallet owner can't approve a Safe
transaction hash on chain.

Sign with the hardware wallet's get_signed_raw_transaction when the
sender has it, as execute_safe_tx does.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant