Uniswap / widgets

widgets-uniswap.vercel.app
GNU General Public License v3.0
125 stars 180 forks source link

Permit2 is missing transaction details #599

Closed L03TJ3 closed 11 months ago

L03TJ3 commented 1 year ago

Is your feature request related to a problem? Please describe. The uniswap widget allows enabling permit2 currently, the amount to approve is set to maxAllowance: https://github.com/Uniswap/widgets/blob/b981a051ebb35f7fb0edc44ea44d4e7703cbcbc4/src/hooks/usePermitAllowance.ts#L77

The whole idea for permit2 (afaik) is to make it not this easy for malicious contracts/tokens to spend all a user has in its holdings. Only metamask has a built-in feature where a user can choose the allowance amount. this is not yet a standard in a lot of other wallets.

Describe the solution you'd like Send the amount of the original transaction where the allowance is requested for along with the permit-details so that a wallet can make a choice on how to handle the to-approve amount

and extended solution would be to add an extra step before the permit2 approval/sign flow is started, and ask directly from widget how much a user wishes to allow for its spending. Not rely on all the wallets out there to start implementing new sign flows, but tackle it a couple of steps before

Would be nice-to-have to also have token-symbol added to details

Describe alternatives you've considered see above

L03TJ3 commented 11 months ago

misunderstood permit2 utility, so closing