Skip to content

Week2#6

Draft
aniket866 wants to merge 3 commits into
StabilityNexus:mainfrom
aniket866:week3
Draft

Week2#6
aniket866 wants to merge 3 commits into
StabilityNexus:mainfrom
aniket866:week3

Conversation

@aniket866

@aniket866 aniket866 commented Jun 13, 2026

Copy link
Copy Markdown
Contributor

01: Batch Order Matching

  • Objective: Save gas and allow keepers to clear liquidity efficiently by matching a single primary order (either buy or sell) against an array of opposing counter-orders.
  • Implementation Plan:
    • Implement matchBatch(uint256 primaryOrderId, uint256[] calldata counterOrderIds, uint256 deadline).
    • Optimize storage writes by reading and updating the primary order once (or writing the updated state at the end of the loop).

02: Native ETH Integration

  • Objective: Native ETH deposits automatically wrap to WETH, and WETH unwraps back to native ETH on cancels or settlements.
  • Implementation Plan:
    • Represent native ETH using address(0).
    • Accept msg.value in createOrder when tokenIn == address(0). Wrap ETH using WETH.deposit{value: msg.value}().
    • During cancelOrder, if tokenIn == address(0), call WETH.withdraw(refund) and transfer native ETH back to the maker.
    • During matches, if the receiver expects address(0) as the output token, unwrap WETH and send native ETH instead of WETH.
    • Add receive() external payable {} to accept native ETH from the WETH contract.

03: Protocol Fees

04: Access & Pausing Safety

  • Objective: Guard against locked user funds and access control vulnerabilities.
  • Implementation Plan:
    • Remove whenNotPaused modifier from cancelOrder to ensure users can withdraw/cancel orders at any time.
    • Ensure all updates to treasury and fees emit explicit tracking events.
    • Validate inputs for all new admin settings (non-zero treasury address, fee ceilings).

@coderabbitai

coderabbitai Bot commented Jun 13, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 20441d4e-c0ae-4a0a-be64-db8bb8658856

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

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