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

permit2 diagram #28

Open
ryanorendorff opened this issue Apr 5, 2024 · 2 comments
Open

permit2 diagram #28

ryanorendorff opened this issue Apr 5, 2024 · 2 comments

Comments

@ryanorendorff
Copy link

Thank you for these excellent descriptions! They are super helpful.

I wanted to mention that the following image for the permit2 system is, for me, a tad hard to parse. I believe that Alice doesn't need to perform an interaction with a protocol contract; anyone with her permit can pass off her message and signature as long as they match to perform permitTransferFrom.

image

I believe a more accurate photo should look something like the following to show that Alice doesn't need to perform any more on-chain interactions herself.

permit2-interaction

@merklejerk
Copy link
Collaborator

Yeahhh, if the app supports something like meta-transactions then that's probably how it would go. When I originally wrote the guide, it was framed as an incremental improvement on token allowances and permit() and my expectation was that apps would mostly use it to avoid the extra transaction involved in the older approaches. But maybe now this is a bigger value prop for systems that integrate Permit2. UniswapX is an example, obviously, but would be curious if you've witnessed other applications of permit2 for gasless/meta-transactions.

In any case, it's a good suggestion and I'll extend the guide a bit to mention how permit2 fits into the meta-transaction paradigm, which would certainly incorporate that diagram.

@ryanorendorff
Copy link
Author

More protocols are using some variant of permits/EIP-712 signed data for an "intent" based system where some trading is collected off-chain before being batched together. CoW Swap and IntentX do something kinda like this although they do not use permit2 (CoW Swap doesn't at least); they just get an unlimited ERC20 permit or use approve once for the maximum amount and then implement their own signed data on top.

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

No branches or pull requests

2 participants