Skip to content

Fix Final cancel on LimitOrderHook#128

Open
luiz-lvj wants to merge 4 commits into
OpenZeppelin:masterfrom
luiz-lvj:fix-final-cancel
Open

Fix Final cancel on LimitOrderHook#128
luiz-lvj wants to merge 4 commits into
OpenZeppelin:masterfrom
luiz-lvj:fix-final-cancel

Conversation

@luiz-lvj
Copy link
Copy Markdown
Collaborator

@luiz-lvj luiz-lvj commented Apr 29, 2026

Fixes #127

  • Snapshot currency*Total into a BalanceDelta before zeroing and pass it through CancelCallbackData.
  • In _handleCancelCallback's removingAllLiquidity branch, burn the snapshot's worth of hook-held ERC-6909 claims and fold them into principalDelta, so the canceller receives principal + prior fees in one take to cancelData.to.
  • Fix test_cancelOrder_removingAllLiquidity (its assertion encoded the bug) and add test_cancelOrder_finalCancel_* tests for the basic strand, balance reconciliation, multi-cancel compounding, single canceller, place-callback fee path, separate recipient, and cross-order isolation.

This PR should be merged after #126

@luiz-lvj luiz-lvj requested review from a team, ernestognw and gonzaotc April 29, 2026 22:24
@netlify
Copy link
Copy Markdown

netlify Bot commented Apr 29, 2026

Deploy Preview for uniswap-hooks ready!

Name Link
🔨 Latest commit a75fef2
🔍 Latest deploy log https://app.netlify.com/projects/uniswap-hooks/deploys/69f28816176f27000829ce0d
😎 Deploy Preview https://deploy-preview-128--uniswap-hooks.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@netlify
Copy link
Copy Markdown

netlify Bot commented Apr 29, 2026

Deploy Preview for uniswap-hooks-docs ready!

Name Link
🔨 Latest commit a75fef2
🔍 Latest deploy log https://app.netlify.com/projects/uniswap-hooks-docs/deploys/69f2881674ea800007e7526d
😎 Deploy Preview https://deploy-preview-128--uniswap-hooks-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

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.

Final cancel clears accounting while the hook still holds accrued fee claims

1 participant