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

feat: break up allowance approval flow in prep for permit2 #7758

Draft
wants to merge 6 commits into
base: develop
Choose a base branch
from

Conversation

woodenfurniture
Copy link
Member

@woodenfurniture woodenfurniture commented Sep 17, 2024

Description

Breaks token allowance approval UI components into reusable ones in prep for permit2 UI flow.

  • Adds default "exact" allowance state per conversation with product (previously this was only the case for LiFi trades).
  • Copy for allowance reset is now "allowance reset", not "approval reset"
  • Copy for allowance approval is not "allowance approval", not "approval"
  • Code renaming to correspond to the above
  • Combine allowance reset and allowance approval steps into a single allowance step. This is in preparation for permit2 which will require similar combining of UX to mitigate "CVS receipt" UX hell
  • includes placeholder states for permit2 flow which will follow on from this PR

Issue (if applicable)

progresses #7648

Risk

High Risk PRs Require 2 approvals

This is a high risk change because it modifies the state management of trades and majorly refactors the UI associated with allowance approvals.

What protocols, transaction types, wallets or contract interactions might be affected by this PR?

All trades, especially those with token allowance approvals.

Testing

  • trades on all chains
  • trades without allowance approvals
  • trades with allowance approvals
  • trades with USDT allowance reset and approval

Engineering

Operations

  • 🏁 My feature is behind a flag and doesn't require operations testing (yet)

Screenshots (if applicable)

No allowance approval

image

With allowance approval

image

With USDT allowance reset and approval

image

@woodenfurniture woodenfurniture changed the title chore: break up approval components into reusable ones feat: implement permit2 flow for 0x swapper Sep 17, 2024
@woodenfurniture woodenfurniture changed the title feat: implement permit2 flow for 0x swapper feat: break up allowance approval flow in prep for permit2 Sep 18, 2024
@woodenfurniture woodenfurniture marked this pull request as ready for review September 18, 2024 01:22
@woodenfurniture woodenfurniture requested a review from a team as a code owner September 18, 2024 01:22
@woodenfurniture woodenfurniture marked this pull request as draft September 19, 2024 22:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant