Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(v4-sdk): swap function accepts pools with all hooks except swap hooks #195

Merged
merged 10 commits into from
Nov 14, 2024

Conversation

ewilz
Copy link
Member

@ewilz ewilz commented Nov 7, 2024

No description provided.

@ewilz ewilz requested review from jsy1218 and a team as code owners November 7, 2024 21:08
return this.hooks === ADDRESS_ZERO
private hookHasSwapPermissions(): boolean {
return (
Hook.hasPermission(this.hooks, HookOptions.BeforeSwap) || Hook.hasPermission(this.hooks, HookOptions.AfterSwap)
Copy link
Member

Choose a reason for hiding this comment

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

do we need to check BeforeSwapReturnsDelta and AfterSwapReturnsDelta?

Copy link
Member Author

Choose a reason for hiding this comment

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

No, because these options only get hit if either beforeSwap or AfterSwap are true. (before/afterSwapReturnsDelta cannot be true if beforeSwap or afterSwap are false)

https://github.com/Uniswap/v4-core/blob/main/src/libraries/Hooks.sol#L265

Copy link
Member Author

@ewilz ewilz Nov 11, 2024

Choose a reason for hiding this comment

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

I can leave a code comment

@jsy1218
Copy link
Member

jsy1218 commented Nov 13, 2024

@ewilz FYI, I merged a PR that fixes sdks CI hardhat consistent failures. Gonna update the branch from main, so that this PR can also have the green github CIs.

Copy link
Member

jsy1218 commented Nov 13, 2024

This stack of pull requests is managed by Graphite. Learn more about stacking.

Join @ewilz and the rest of your teammates on Graphite Graphite

Copy link

graphite-app bot commented Nov 13, 2024

Graphite Automations

"Request reviewers once CI passes on sdks monorepo" took an action on this PR • (11/13/24)

1 assignee was added and 1 reviewer was added to this PR based on 's automation.

@ewilz ewilz merged commit 62d162a into main Nov 14, 2024
8 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