coinbase / coinbase/smart-wallet
Discussion: Legacy 1271 Support (to enable signing on a Safe)
- Dominant language
- Solidity
- Stars
- 487
- Forks
- 176
- PR merge metrics
- No merged PRs in 30d
Description
The current smart wallet ERC1271 setup does not allow the account to be used as a signer on a Safe.
Safe [check contract signatures](https://github.com/safe-global/safe-smart-account/blob/bf943f80fec5ac647159d26161446ac5d716a294/contracts/Safe.sol#L315) using the legacy ERC1271 function:
`isValidSignature(bytes,bytes)`. So they expect the legacy return value of `0x20c13b0b`.
Since it's a pretty minimal addition which would enable the smart wallet to be used with the most popular multisig, I added the legacy isValidSignature function on [this test branch](https://github.com/onit-labs/smart-wallet/blob/bc014d606785d68cda64afc827f716fb4754a5f3/test/CoinbaseSmartWallet/IsValidSignature.t.sol#L192).
Do you think it's something worth keeping in the code?
Contributor guide
No contributing guide indexed for this repository
Research direction
Start with the Safe.sol legacy check-contract-signatures code linked in the issue, then inspect test/CoinbaseSmartWallet/IsValidSignature.t.sol around line 192 and compare it with the current ERC1271 tests. Confirm the expected legacy return value and decide whether the test-branch addition should be kept, with passing signature-validation tests as the completion criterion.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- solidity
- Domain
- blockchain
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 40/100