-
Notifications
You must be signed in to change notification settings - Fork 138
Feat: 1271 #11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feat: 1271 #11
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds support for ERC-1271 signature validation to the CTF Exchange, enabling smart contract wallets to sign and submit orders. The implementation introduces a new signature type POLY_1271 and includes comprehensive test coverage.
Key changes:
- Added
POLY_1271signature type to theSignatureTypeenum - Implemented
verifyPoly1271Signaturefunction to validate ERC-1271 signatures - Created comprehensive test suite for ERC-1271 signature validation scenarios
Reviewed Changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| src/exchange/libraries/OrderStructs.sol | Added POLY_1271 signature type and reformatted enum declarations |
| src/exchange/mixins/Signatures.sol | Implemented ERC-1271 signature verification logic |
| src/exchange/test/ERC1271.t.sol | Added comprehensive test coverage for ERC-1271 signature validation |
| src/exchange/test/BaseExchangeTest.sol | Added ERC1271Mock contract wallet and helper function for creating 1271-signed orders |
| src/dev/mocks/ERC1271Mock.sol | Created mock contract implementing ERC-1271 interface for testing |
| src/exchange/test/MatchOrders.t.sol | Removed unused imports |
| foundry.toml | Added wrap_comments formatting configuration |
| .github/workflows/Tests.yml | Reordered workflow file lines (cosmetic) |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Copilot reviewed 8 out of 8 changed files in this pull request and generated 2 comments.
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Copilot reviewed 11 out of 12 changed files in this pull request and generated no new comments.
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Copilot reviewed 11 out of 12 changed files in this pull request and generated no new comments.
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
Note
Enables ERC1271 contract-wallet signatures for orders using solady’s SignatureChecker, with supporting mocks/tests and config updates.
POLY_1271toSignatureTypeand implementverifyPoly1271SignatureusingSignatureCheckerLib.isValidSignatureNowinSignatures.sol.isValidSignature; minor doc updates.SignatureTypeenum; minor enum formatting inOrderStructs.sol.ERC1271Mockcontract for signing.ERC1271Signature.t.solcovering valid and revert cases (wrong signer, non-contract, wrong type, invalid contract, signer/maker mismatch).BaseExchangeTestwith 1271 wallet setup and_createAndSign1271Order; adjust imports in tests.lib/soladysubmodule and remapping; lock infoundry.lock.foundry.toml(wrap_comments = true).Testsand minor cleanup in.github/workflows/Tests.yml.Written by Cursor Bugbot for commit f4e5dac. This will update automatically on new commits. Configure here.