Commit d754891
fix(protocol-kit): handle CONTRACT_SIGNATURE in toSafeTransactionType
`toSafeTransactionType` creates `EthSafeSignature` with
`isContractSignature=false` for all confirmations, including
CONTRACT_SIGNATURE types from the Safe Transaction Service.
This causes `buildSignatureBytes` to concatenate the full stored
signature blob (r+s+v+dynamic data) as-is instead of properly
splitting it into static part (r, s=offset, v=0) and dynamic part
(length + inner data). For multi-owner Safes, this breaks the
combined signatures layout — the second signer's 65-byte constant
part overlaps with the first signer's dynamic data, causing
GS021 ("Invalid contract signature provided") on execution.
The fix detects CONTRACT_SIGNATURE confirmations and:
1. Extracts the inner signature data from the stored format
using the s offset (which points to the length-prefixed data)
2. Creates EthSafeSignature with isContractSignature=true
3. This lets buildSignatureBytes properly compute dynamic offsets
Affects any Safe with EIP-1271 contract signature owners (passkey
signers via SafeWebAuthnSignerProxy, nested Safes, etc.) when
executing transactions that include contract signature confirmations
fetched from the Safe Transaction Service.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>1 parent 8f8d296 commit d754891
1 file changed
Lines changed: 16 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1287 | 1287 | | |
1288 | 1288 | | |
1289 | 1289 | | |
1290 | | - | |
1291 | | - | |
| 1290 | + | |
| 1291 | + | |
| 1292 | + | |
| 1293 | + | |
| 1294 | + | |
| 1295 | + | |
| 1296 | + | |
| 1297 | + | |
| 1298 | + | |
| 1299 | + | |
| 1300 | + | |
| 1301 | + | |
| 1302 | + | |
| 1303 | + | |
| 1304 | + | |
| 1305 | + | |
1292 | 1306 | | |
1293 | 1307 | | |
1294 | 1308 | | |
| |||
0 commit comments