-
Notifications
You must be signed in to change notification settings - Fork 179
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
0x Permit2 send it #7648
Comments
@reallybeard it's simple and we already have this, but a mock or two here would be super helpful. 0x is nagging us about upgrading to v2 so we might as well see where we're going. Just to round it out. |
Questions to answer:
Contracts must be purposely written to support Permit2. We will have to support both flows. |
@woodenfurniture going for extra credit. @reallybeard gonna get mocks . vomited thoughts for now https://excalidraw.com/#room=57937cdcd3d70f535ad4,MgzvO8mKR_lRaC18ncX2-g |
waiting for UI help from @reallybeard |
Was having trouble getting this to run correctly on my local env. But I went through the different jams. Everything looks great, only small feedback is to move the instructions below the label. @woodenfurniture |
0x launched their new API. They sent us all this documentation about saving people gas and making the UX better. This ticket covers picking up a more secure pattern for token allowances on the 0x swapper.
It's basically: replace approval with permit2 for the 0x swapper.
Consider it low priority but worth picking up. Should only use the pattern for permit2 since we already have token-approval signature transaction flows (sign to approve) and then send the transaction. In our current app permit2 upgrades a current onchain siganture to an "offchain signature for limited approval and an onchain signature for the trade." Already better.
☝️ this is what we have to verify and account for.
from smart contract lore, a good overview: https://github.com/dragonfly-xyz/useful-solidity-patterns/tree/main/patterns/permit2
0x docs: https://0x.org/docs/upgrading/upgrading_to_swap_v2#step-1-get-indicative-price
Headless example: https://github.com/0xProject/0x-examples/blob/main/swap-v2-headless-example/index.ts#L62-L83
The text was updated successfully, but these errors were encountered: