Uniswap / Uniswap/interface

Allow use token contract approve method instead of permit2 for aa wallet

Open
#7,341 1 comment 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
TypeScript
Stars
5.5k
Forks
5.4k
PR merge metrics
No merged PRs in 30d

Description

Bug Description
https://github.com/Uniswap/interface/blob/91c20135227b13dc8d75b6be974fb261e9ab6cfd/src/pages/RemoveLiquidity/index.tsx#L121
in onAttemptToApprove method uniswap allow using token approve instead of permit2 when error occur.
https://github.com/Uniswap/interface/blob/91c20135227b13dc8d75b6be974fb261e9ab6cfd/src/hooks/usePermit2Allowance.ts#L113
in isePermit2Allowance the only way to approve token is using permit2

Steps to Reproduce

Remove Liquidity Flow
  1. open wallet connect modal in uniswap, then connect in cobo argus
  2. remove lbr/eth in uniswap, uniswap will send eth_signTypedData_v4 to cobo argus
  3. cobo argus will response the request with '0x' as data
  4. uniswap will send a transaction with token approve
  5. now cobo argus can execute the transaction
Swap Flow
  1. open wallet connect modal in uniswap, then connect in cobo argus
  2. swap a erc20 token to another, uniswap will send eth_signTypedData_v4 to cobo argus
  3. cobo argus will response the request with '0x' as data
  4. uniswap shows error in console

Expected Behavior
same behaviour between Swap Flow and Remove Liquidity Flow. and all usage of permit2 behave same

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with src/pages/RemoveLiquidity/index.tsx at onAttemptToApprove and src/hooks/usePermit2Allowance.ts at isPermit2Allowance. Reproduce the Cobo Argus remove-liquidity and swap flows, then trace how the failed eth_signTypedData_v4 response is handled. Done means token approval fallback behavior is consistent across both flows and Permit2 usage.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
blockchain, frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.