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

Add permit2 for init pool #553

Open
wants to merge 10 commits into
base: main
Choose a base branch
from
Open

Add permit2 for init pool #553

wants to merge 10 commits into from

Conversation

MattPereira
Copy link
Member

@MattPereira MattPereira commented Jan 10, 2025

Closes #476

Summary

  • For testing, we could modify doInitPool to handle both v2 and v3, but I'm proposing we favor the more straightforward approach
  • Refactored pool creation example to offer functions for both fork and live network
  • Refactored getDetails of Permit2Helper to allow for type Account so that client.signTypedData can be run with a script

@MattPereira MattPereira marked this pull request as ready for review January 12, 2025 21:18
Comment on lines +332 to +335
const _owner = typeof owner === 'string' ? owner : owner.address;
let _nonce: number;
if (nonce === undefined) {
_nonce = await getNonce(client, token, owner, spender);
_nonce = await getNonce(client, token, _owner, spender);
Copy link
Member Author

@MattPereira MattPereira Jan 13, 2025

Choose a reason for hiding this comment

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

@brunoguerios lmk if you agree with this approach and if we should allow Account for all the other sign helper methods as part of this PR or open a new issue

Copy link
Member

Choose a reason for hiding this comment

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

Sure! It does seem a more robust approach. If it's just a matter of adding that single line for owner type check on each method, I'd go ahead and make the change 👍

@brunoguerios
Copy link
Member

No idea why unrelated swap tests are failing 🤔
Are you able to reproduce locally?
If not, I'd simply re-run tests to see if they pass.

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.

Add permit2 support for pool initialization
3 participants