feat: add support for ERC3009, ERC2612, and Permit2 token transfers#1023
Draft
levalleux-ludo wants to merge 6 commits into
Draft
feat: add support for ERC3009, ERC2612, and Permit2 token transfers#1023levalleux-ludo wants to merge 6 commits into
levalleux-ludo wants to merge 6 commits into
Conversation
…update accounts and deployment scripts
…ort and restrict dangerous operations
… ABIs - Introduced MockERC3009Token.json and MockPermit2.json to provide mock implementations for ERC3009 and Permit2 functionalities. - Updated index.ts to export new ABIs for MockERC3009Token and MockPermit2. - Enhanced core-sdk to support signing of ERC3009 authorization with new functions in handler.ts and mixin.ts. - Added tests for ERC3009 authorization signing in handler.test.ts and mixin.test.ts to ensure correct functionality and data structure.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1023 +/- ##
==========================================
+ Coverage 91.49% 91.59% +0.10%
==========================================
Files 179 179
Lines 7451 7544 +93
Branches 1433 1458 +25
==========================================
+ Hits 6817 6910 +93
Misses 634 634
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
… types - Introduced `UnsignedTransferAuthorization` and `TransferAuthorization` types to standardize authorization structures. - Updated functions `signReceiveWithErc3009Authorization`, `signReceiveWithErc2612Permit`, and `signReceiveWithPermit2` to return `TransferAuthorization` objects instead of specific signed types. - Implemented `encodeTransferAuthorizationEntry` and `encodeTransferAuthorizationQueue` to handle encoding of multiple authorization strategies. - Modified `relayMetaTransaction` and related mixins to support transfer authorizations in meta transactions. - Updated tests to reflect changes in return types and ensure proper encoding of authorization data.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
closes #1021
This pull request introduces support for ERC-3009, ERC-2612, and Permit2 token authorization flows in the deployment scripts and end-to-end tests. It adds deployment logic for mock versions of these tokens, updates the test suite to verify their integration, and refactors token deployment for maintainability. Additionally, it expands the available test accounts and updates contract deployment configuration.
Token Support and Deployment Enhancements:
MockERC2612Token,MockERC3009Token, andMockPermit2, and included them in the Hardhat deployment configuration (contracts/scripts/deploy-other-tokens.js,contracts/hardhat.config.js,contracts/scripts/deploy.js). [1] [2] [3] [4]deploy-weth.js(contracts/scripts/deploy-other-tokens.js,contracts/scripts/deploy-weth.js,contracts/scripts/deploy.js). [1] [2] [3]End-to-End Test Improvements:
e2e/tests/core-sdk-token-auth.test.ts).e2e/tests/utils.ts). [1] [2]Accounts and Configuration:
ACCOUNT_25to the test accounts and included it in all relevant exports and arrays (contracts/accounts.js). [1] [2] [3]e2e/docker-compose.yml).