feat(evm): implement ERC-7710 delegation support in exact facilitator#22
feat(evm): implement ERC-7710 delegation support in exact facilitator#22rockorama wants to merge 2 commits intocoinbase:mainfrom
Conversation
|
Pulled this locally and One other thing I wanted to sanity-check: |
|
I put together the follow-up patch here in case it's useful to cherry-pick or merge directly into this branch: rockorama#1 It keeps the scope tight to the two things that came up in local validation:
|
|
Thanks for the quick follow-up and for taking the time to pull this locally and validate! The caller context fix is the right call, good catch on the redeemDelegations simulation needing to run as the actual facilitator. 🙏 |
Add
verifyERC7710andsettleERC7710alongside the existing EIP-3009 and Permit2 implementations, completing the three asset transfer methods defined inspecs/schemes/exact/scheme_exact_evm.md.Description
ERC-7710 was fully specced in the repo but had zero TypeScript implementation. This PR closes that gap.
Changes:
src/types.ts:ExactERC7710Payloadtype,isERC7710Payload()guard,AssetTransferMethodextended with'erc7710'src/exact/facilitator/erc7710.ts:verifyERC7710(field validation + eth_call simulation of redeemDelegations) andsettleERC7710(re-verify + writeContract + receipt wait). Calldata uses ERC-7579 packed format with SINGLE_CALL_MODE.src/exact/facilitator/errors.ts: 5 new ERC-7710 error constantssrc/exact/facilitator/scheme.ts: ERC-7710 branch in verify() and settle(), checked firstsrc/exact/facilitator/erc7710.test.ts: full unit test coveragetypescript/.changeset/erc7710-delegation-support.md: changeset fragment (@x402/evm minor)Spec ref:
specs/schemes/exact/scheme_exact_evm.md §3Note: verification is simulation-only per spec design. Gas limit should be set by callers per spec security recommendation.
Tests
pnpm test --filter @x402/evm
Checklist