sygmaprotocol / sygma-widget

Transfer widget for the sygmaprotocol
5 stars 2 forks source link

Widget spending request explained #154

Open LyonSsS opened 3 months ago

LyonSsS commented 3 months ago

Context: When a user wants to transfer a Token Type that uses the Percentage Fee Handler, it is requested to allow spending, more than once. It takes a request for a portion of the token to be spent as fee, by a contract, and the rest ( as the transfer amount) to be spend by another contract ( triggering a new request for allow spending).

On EVM chains, this is some how common behavior, but usually everything comes in one spending request. ( signing a single allowance). Our current behavior might be confusing, so we need to inform the user of the allow spending steps/requests, so it is a clear behavior.

See the below GIF to understand how it is now:

SignSpending

CC: @itsbobbyzzz168

mpetrunic commented 3 months ago

A note here, there is a near term goal of integrating permit2 contract which would reduce that to 0 approval requests in most cases (if you used uniswap or some other dapp utilizing it) and would just sign signature. But even in that case it would make sense to explain it like uniswap does: https://support.uniswap.org/hc/en-us/articles/8120520483085-What-is-an-approval-transaction

itsbobbyzzz168 commented 3 months ago

@haochizzle fyi sir - just something that we would need to add as part of the documentation for the widget the approval request (similar in the example Marin provided above for uniswap)

haochizzle commented 3 months ago

here's a doc with the explainer: https://docs.google.com/document/d/1BVna94-KzwVfar0zr8ousES63Pt2OBKLh3Av5y1e1zo/edit @MakMuftic @LyonSsS pls review.

my suggestion is that we don't add this to the docs and where possible, we add this as a tooltip denoted by a tiny question mark

MakMuftic commented 3 months ago

Based on the discussion, Taha provided a design suggestion for displaying the short version of the approval description that we all liked. @sweetpea22, let us know if you want to change something with this UI suggestion.

Confirm in Wallet

Higher resolution :point_down: Confirm in Wallet Approvals.pdf

haochizzle commented 2 months ago

will EIP-3074 inclusion affect the approval flow in the widget in the future? https://x.com/josephdelong/status/1778441691860553991