MetaMask / MetaMask/metamask-mobile
[Bug]: Batch Swap - Approval amount in Mobile (0.5USDC) differs from Extension (0.5USDC +0.5USDC = Total $1)
- Dominant language
- TypeScript
- Stars
- 3k
- Forks
- 1.7k
- Avg merge
- 1d 14h
- Merged PRs (30d)
- 669
Description
### Describe the bug
Whenever we are performing a Batch Swap (multiple tx's), the exact same transaction for Extension and Mobile leads to different results in the Estimated balance changes:
- Extension:
- You approve 0.5 USDC + 0.5 USDC -> Total 1$
- You send 0.5 USDC
- You receive 0.000143 ETH
- Nobile:
- You approve 0.5 USDC
- You send 0.5 USDC
- You receive 0.000143 ETH
### Expected behavior
Same result for Extension and Mobile
### Screenshots/Recordings
https://github.com/user-attachments/assets/5acf98c5-4840-48b4-b2aa-60569ebef52d
### Steps to reproduce
1. Go to the test dapp
2. Connect with Ethereum Mainnet
3. Trigger a Execute Batch Swap for Extension and Mobile
4. See differences in the approve
### Error messages or log output
```shell
```
### Where was this bug found?
Internal release testing
### Version
7.80.0 and extension 13.37 , but the miss-match seems it might be an older issue (unsure if the issue is in the Mobile or in Extension side)
### Build number
5617
### Build type
None
### Device
Pixel 6
### Operating system
Android
### Additional context
_No response_
### Severity
_No response_
Contributor guide
Research direction
Start with the test dapp and the batch-swap transaction flow described in the reproduction steps, then compare how Mobile and Extension calculate approval amounts for the same batch. Confirm which side produces the mismatch and verify that both clients show the same approval total while preserving the stated send and receive amounts.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- blockchain, react-native, typescript
- Domain
- blockchain, mobile
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100