MetaMask / MetaMask/metamask-mobile

[Bug]: Lending withdrawal transaction shows $0.00 and 0 ETH on Activity screen instead of actual withdrawn amount

Open
#27,158 0 comments 0 reactions 0 assignees View on GitHub
regression-RC-7.69.0 Sev2-normal team-earn type-bug
Dominant language
TypeScript
Stars
3k
Forks
1.7k
Avg merge
1d 14h
Merged PRs (30d)
669

Description

### Describe the bug

Lending withdrawal transactions on the Activity screen show $0.00 and 0 ETH instead of the actual withdrawn token amount. This is the same root cause as #27157 (lending deposit) — the `lendingWithdraw` transaction type is not handled in the `decodeTransaction()` switch statement in `app/components/UI/TransactionElement/utils.js`, so it falls through to `decodeConfirmTx()` which reads `txParams.value` (always `'0'` for ERC-20 lending withdrawals).

### Expected behavior

The Lending withdrawal transaction on the Activity screen should display the correct amount withdrawn with the correct asset (e.g. USDC), not $0.00 / 0 ETH.

### Screenshots/Recordings

_No response_

### Steps to reproduce

1. Open MetaMask on a network with Earn lending support (e.g. Arbitrum)
2. Navigate to Earn
3. Withdraw a token (e.g. USDC) from a Lending position
4. Transaction completes successfully
5. Go to main Activity screen
6. View the Lending withdrawal transaction
7. Transaction shows $0.00 and 0 ETH instead of the correct token amount

### Error messages or log output

```

```

### Where was this bug found?

Internal release testing

### Version

7.69.0

### Build number

3910

### Build type

_No response_

### Device

Samsung Galaxy A42

### Operating system

Android

### Additional context

Related to #27157 (lending deposit same issue). See root cause analysis comment on that issue: https://github.com/MetaMask/metamask-mobile/issues/27157#issuecomment-4014147720

The fix is the same — add `tx_review_lending_withdraw` as a case in the `decodeTransaction()` switch statement in `app/components/UI/TransactionElement/utils.js:1050`, routing to `decodeTransferTx()`.

### Severity

_To be added after bug submission by internal support / PM:_

Contributor guide

Open the contributing guide

Research direction

Start in app/components/UI/TransactionElement/utils.js at the decodeTransaction() switch around line 1050, and compare the related lending deposit issue #27157. Confirm the lending withdrawal transaction is decoded using the withdrawn token amount and asset, then verify the Activity screen no longer shows $0.00 and 0 ETH for a lending withdrawal.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, react-native
Domain
frontend, mobile-dev
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
58/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.