USDT approval flow
USDT requires users to have zero approval before changing it to another value. We should consider this in all approval flows with the token to properly handle this. It will require 2 transactions for a user who needs approve a higher amount.
For example Approval amount needed is 100:
- current approval amount it 10,
- user first needs to approve 0 and then approve 100 for usdt to allow for the change.
AC
- Add messaging to alert user to issues with USDT approval flows
- this is handled in all approval flows where USDT could be used (swaps, TC defi products, other defi products, etc)
related https://github.com/shapeshift/web/issues/7059
Figma reference here: https://www.figma.com/design/ZkRqq0Bk1glXqIW776IAtr/Portals?node-id=538-5320&t=zgFb47wWZnHZ5pVr-0
Confirmed reset functionality is not necessary for THORChain lending.
I was able to approve spend of 790 USDT: https://snowtrace.io/tx/0x51d69ce85c99c0aa9399542140c13016e61a608524653255805e81f2906a1ecf?chainid=43114
And then 793 USDT: https://snowtrace.io/tx/0xfac1bf3846a4ac6a34568afdfa86bb0c557b1047f93e1e0f947fcc9fe0d49087?chainid=43114
All via the ShapeShift UI, allowing the user to then interact with the THORChain contract and successfully repay a loan: https://snowtrace.io/tx/0xaa10385bf7b82e47ff20717e3123b9ace25fec426ea49d2850f00b71ecc924f0?chainid=43114 & https://viewblock.io/thorchain/tx/aa10385bf7b82e47ff20717e3123b9ace25fec426ea49d2850f00b71ecc924f0
Likewise, confirmed not necessary for THORChain LP deposits:
First approval: https://snowtrace.io/tx/0x017cbb04804ab3a16cba68c0edde0ce9d3ba27f21632d1e8b29c5a7c7251f953?chainid=43114
Second, higher approval without reset: https://snowtrace.io/tx/0x7de6767eff42c726012b4ca5a663dfa37f0529e93ff754f50263418876c903e8?chainid=43114
Successful LP deposit: https://snowtrace.io/tx/0x894218bbcf918d0e8e72d2bc230f3fca65dcf129e335b6949cfbb10e2506bee6?chainid=43114 & https://viewblock.io/thorchain/tx/894218bbcf918d0e8e72d2bc230f3fca65dcf129e335b6949cfbb10e2506bee6