Skip to content

Conversation

@k06a
Copy link
Member

@k06a k06a commented Sep 18, 2025

No description provided.

@k06a k06a requested a review from Copilot September 18, 2025 14:36
@k06a k06a changed the base branch from master to fix/new-eth-orders September 18, 2025 14:37
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 introduces a new "Simple native orders" system that replaces the existing ETH orders system with a more streamlined approach using factory pattern and cloned contracts. The key change is shifting from a centralized ETH order management system to individual native order contracts deployed via a factory.

  • Replaces ETHOrders contract with NativeOrderFactory and NativeOrderImpl contracts
  • Implements a factory pattern using cloned contracts for individual orders
  • Simplifies order creation, cancellation, and signature validation processes

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
test/helpers/utils.js Adds helper function to extract event arguments from transaction receipts
test/LimitOrderProtocol.js Updates tests to use new native order system instead of ETH orders
deploy/deploy-NativeOrderFactory.js Adds deployment script for the new NativeOrderFactory contract
contracts/extensions/NativeOrderImpl.sol New implementation contract for individual native orders with ERC1271 signature validation
contracts/extensions/NativeOrderFactory.sol New factory contract for creating deterministic clones of native orders
contracts/extensions/ETHOrders.sol Removes the old ETH orders implementation
contracts/OrderLib.sol Adds memory-based order hashing function for in-memory order structs

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@k06a k06a force-pushed the feature/simple-native-order branch from 15a573e to dd75891 Compare September 18, 2025 14:40
@k06a k06a requested a review from Copilot September 18, 2025 14:45
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 2 out of 2 changed files in this pull request and generated 6 comments.


Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

function isValidSignature(bytes32 hash, bytes calldata /* signature */) external view returns(bytes4) {
uint80 orderHashTail = purpose.orderHashTail;
uint256 expiration = purpose.expiration;
if (uint80(uint256(hash)) != orderHashTail) {
Copy link

Copilot AI Sep 18, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comparing only the lower 80 bits of the order hash is insufficient for security. Hash collisions become much more likely with truncated hashes, potentially allowing malicious actors to create orders with matching tails. Use the full hash for comparison.

Copilot uses AI. Check for mistakes.
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But 80 bits considered as strong enough in crypto

Base automatically changed from fix/new-eth-orders to feature/new-eth-orders September 24, 2025 15:21
Base automatically changed from feature/new-eth-orders to master October 1, 2025 09:14
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