Skip to content

Conversation

@JonathanAmenechi
Copy link
Contributor

@JonathanAmenechi JonathanAmenechi commented Oct 22, 2025

  • Enable 1271 signatures on the CTF Exchange

Note

Enables ERC1271 contract-wallet signatures for orders using solady’s SignatureChecker, with supporting mocks/tests and config updates.

  • Exchange / Signatures:
    • Add POLY_1271 to SignatureType and implement verifyPoly1271Signature using SignatureCheckerLib.isValidSignatureNow in Signatures.sol.
    • Integrate 1271 path into isValidSignature; minor doc updates.
  • Types:
    • Extend SignatureType enum; minor enum formatting in OrderStructs.sol.
  • Tests:
    • New ERC1271Mock contract for signing.
    • Add ERC1271Signature.t.sol covering valid and revert cases (wrong signer, non-contract, wrong type, invalid contract, signer/maker mismatch).
    • Update BaseExchangeTest with 1271 wallet setup and _createAndSign1271Order; adjust imports in tests.
  • Dependencies / Config:
    • Add lib/solady submodule and remapping; lock in foundry.lock.
    • Format tweak in foundry.toml (wrap_comments = true).
    • CI: rename workflow to Tests and minor cleanup in .github/workflows/Tests.yml.

Written by Cursor Bugbot for commit f4e5dac. This will update automatically on new commits. Configure here.

@JonathanAmenechi JonathanAmenechi marked this pull request as ready for review October 22, 2025 03:30
Copilot AI review requested due to automatic review settings October 22, 2025 03:30
Copy link

Copilot AI left a 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_1271 signature type to the SignatureType enum
  • Implemented verifyPoly1271Signature function 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.

cursor[bot]

This comment was marked as outdated.

Copilot AI review requested due to automatic review settings October 22, 2025 04:06
Copy link

Copilot AI left a 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.

cursor[bot]

This comment was marked as outdated.

Copilot AI review requested due to automatic review settings October 22, 2025 19:48
Copy link

Copilot AI left a 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.

Copy link

Copilot AI left a 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.

Copilot AI review requested due to automatic review settings October 22, 2025 20:12
Copy link

Copilot AI left a 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.

@JonathanAmenechi JonathanAmenechi merged commit 1354de6 into main Oct 22, 2025
4 checks passed
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.

2 participants