Skip to content

feat(SpokePoolPeriphery): support extended ERC-3009 bytes-signature#1420

Open
mrice32 wants to merge 1 commit into
masterfrom
feat/erc3009-bytes-signature
Open

feat(SpokePoolPeriphery): support extended ERC-3009 bytes-signature#1420
mrice32 wants to merge 1 commit into
masterfrom
feat/erc3009-bytes-signature

Conversation

@mrice32
Copy link
Copy Markdown
Contributor

@mrice32 mrice32 commented May 1, 2026

Summary

  • Adds two new entry points on SpokePoolPeriphery that pull tokens via the extended EIP-3009 receiveWithAuthorization(...,bytes signature) overload (e.g. USDC v2.2):
    • depositWithAuthorizationBytes
    • swapAndBridgeWithAuthorizationBytes
  • Adds the matching IERC20AuthBytes interface alongside IERC20Auth. Selectors differ from the canonical v/r/s receiveWithAuthorization, so a token can implement both — and our periphery now supports either.
  • This unlocks contract-wallet (EIP-1271) signers for ERC-3009 deposit/swap-and-bridge, which the existing v/r/s flows cannot support.
  • Tail logic (witness binding, submission fee payment, dispatch) is shared with the v/r/s variants via small private helpers; only the token-pull call differs.
  • MockERC20 gains the bytes overload (sharing verification logic with the v/r/s overload) so we can exercise both code paths.

Test plan

  • yarn build-evm-foundry
  • yarn test-evm-foundry -- --match-contract SpokePoolPeripheryTest — 33 passed (existing 29 + 4 new)
  • New tests cover:
    • testTransferWithAuthBytesDepositValidWitness — happy path, EOA signer
    • testTransferWithAuthBytesSwapAndBridgeValidWitness — happy path, swap + bridge
    • testTransferWithAuthBytesSwapAndBridgeInvalidWitness — wrong witness reverts (fuzz)
    • testTransferWithAuthBytesDepositEIP1271ContractSigner — proves a contract wallet can deposit, which is impossible via the v/r/s entry points
  • yarn lint-fix

🤖 Generated with Claude Code

Adds depositWithAuthorizationBytes and swapAndBridgeWithAuthorizationBytes
to pull tokens via the extended EIP-3009 receiveWithAuthorization overload
that takes an unstructured bytes signature (e.g. USDC v2.2). This unlocks
contract-wallet (EIP-1271) signers, in addition to the existing v/r/s form
which is restricted to EOA/ECDSA signatures.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@mrice32 mrice32 requested review from bmzig, nicholaspai and pxrl as code owners May 1, 2026 17:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant