Skip to content

Feature/zksync native order#394

Closed
Sunnesoft wants to merge 5 commits intofeature/new-eth-ordersfrom
feature/zksync-native-order
Closed

Feature/zksync native order#394
Sunnesoft wants to merge 5 commits intofeature/new-eth-ordersfrom
feature/zksync-native-order

Conversation

@Sunnesoft
Copy link
Contributor

No description provided.

@Sunnesoft Sunnesoft requested a review from Copilot September 26, 2025 17:58
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 implements ZkSync-specific support for native order functionality by adapting the contract system to work with ZkSync's unique CREATE2 implementation and bytecode handling.

  • Adds ZkSync-specific address computation using ZkSync's custom CREATE2 prefix
  • Implements ZkSync-compatible minimal proxy contract for deterministic deployments
  • Creates ZkSync variants of native order contracts that use the custom address computation

Reviewed Changes

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

Show a summary per file
File Description
contracts/libraries/ZkSyncLib.sol New library implementing ZkSync-specific CREATE2 address computation
contracts/helpers/MinimalProxyZkSync.sol ZkSync-compatible minimal proxy contract for delegatecall functionality
contracts/extensions/NativeOrderImplZkSync.sol ZkSync variant of NativeOrderImpl using custom address calculation
contracts/extensions/NativeOrderImpl.sol Modified base contract to support inheritance with virtual methods
contracts/extensions/NativeOrderFactoryZkSync.sol ZkSync factory implementation with bytecode hash management
contracts/extensions/NativeOrderFactory.sol Refactored to support virtual clone implementation method

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

@@ -0,0 +1,37 @@
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.20;
Copy link

Copilot AI Sep 26, 2025

Choose a reason for hiding this comment

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

The pragma version ^0.8.20 is inconsistent with other contracts in this PR that use 0.8.30. Consider using a consistent Solidity version across all contracts for better maintainability.

Suggested change
pragma solidity ^0.8.20;
pragma solidity ^0.8.30;

Copilot uses AI. Check for mistakes.
Comment on lines +24 to +29
MinimalProxyZkSync proxySrc = new MinimalProxyZkSync(IMPLEMENTATION);
bytes32 bytecodeHashSrc;
assembly ("memory-safe") { // solhint-disable-line no-inline-assembly
bytecodeHashSrc := extcodehash(proxySrc)
}
_PROXY_BYTECODE_HASH = bytecodeHashSrc;
Copy link

Copilot AI Sep 26, 2025

Choose a reason for hiding this comment

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

Creating a temporary proxy contract just to get its bytecode hash is inefficient. Consider computing the bytecode hash directly from the proxy's creation code to avoid unnecessary contract deployment in the constructor.

Suggested change
MinimalProxyZkSync proxySrc = new MinimalProxyZkSync(IMPLEMENTATION);
bytes32 bytecodeHashSrc;
assembly ("memory-safe") { // solhint-disable-line no-inline-assembly
bytecodeHashSrc := extcodehash(proxySrc)
}
_PROXY_BYTECODE_HASH = bytecodeHashSrc;
_PROXY_BYTECODE_HASH = keccak256(MinimalProxyZkSync.creationCode(IMPLEMENTATION));

Copilot uses AI. Check for mistakes.
@Sunnesoft Sunnesoft closed this Sep 29, 2025
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