gnosis / cowswap

🐮 CowSwap: First Gnosis Protocol v2 UI
https://gnosis.io
GNU General Public License v3.0
113 stars 55 forks source link

Separate token Approval from Swap function #763

Open NanoOrca opened 3 years ago

NanoOrca commented 3 years ago

Currently token allowance approval happens only once all fields are set and the swap is ready to go, in order to separate the token approval from trading, the system could check for allowance as soon as the user fills the "from" field. This way the user can start approving tokens at any time without any commitment to trading them now.

Testing and if needed asking for approval at this stage image

instead of this stage image

W3stside commented 3 years ago

thanks!

anxolin commented 3 years ago

Good idea!

elena-zh commented 3 years ago

The case to consider for this implementation: sometimes, a user can set a limited spend amount number. So here it will not be enough just a token section in the 'From' field. Amount in the 'From' field should be considered as well. image