metamask-mobile icon indicating copy to clipboard operation
metamask-mobile copied to clipboard

Attempting to Pancake swap closed MMM when using Ledger address

Open plasmacorral opened this issue 2 years ago • 2 comments

Description

On the first attempt, the Ledger device had went into screen saver mode. When I attempted to complete a swap, MMM simply closed and returned me to the login page. On second attempt, was able to complete a swap.

This ticket is specifically for step 21 into 22 below: User taps confirm on transaction just after Ledger screensaver starts, and MMM closes and brings user to login page.

iPhone 13 mini Running iOS 15.6.1 MMM build 952 Ledger Nano X firmware 2.0.2

Reproduction steps

  1. Have MMM with Ledger paired
  2. Have some amount of BNB (native) token
  3. unlock Ledger
  4. Unlock MMM and be at wallet view
  5. Be on Mainnet
  6. Navigate to pancakeswap.finance
  7. Tap connect
  8. Tap MetaMask
  9. Tap Connect
  10. Note that the Switch Network modal opens briefly but then closes
  11. Tap connect again
  12. Tap MetaMask again
  13. Tap "Switch Network"
  14. Tap "Trade"
  15. Scroll around in asset selection
  16. Go back to wallet view
  17. From there, return to Browser
  18. Enter amount of BNB to swap
  19. Tap "Swap"
  20. Tap "Confirm Swap"
  21. Tap "Confirm" moments after the Ledger screensaver turns on
  22. Watch MMM reload and bring user to login page
  23. Unlock MMM
  24. Unlock Ledger
  25. Go to Browser
  26. Dismiss ENS error (because I had Uniswap.eth opened in another browser tab but am not on mainnet)
  27. Go to wallet view
  28. Go to drawer and then tap "View on BSCscan"
  29. Go back to browser
  30. Enter amount to swap
  31. Tap "Swap"
  32. Tap "Confirm Swap"
  33. Tap "Confirm"
  34. Review tx and "Accept and send" from Ledger

Acceptance Criteria

  • If user attempts to confirm transaction after Ledger device screensaver begins, an error message should be presented suggesting the user unlock the Ledger device.

Scenario: Swap transaction confirmed just after screensaver begins

  • GIVEN a user has a Ledger device paired with the MMM wallet
  • WHEN a user attempts to swap on pancakeswap.finance
  • AND the Ledger screensaver starts just before the transaction is confirmed on MMM Confirm modal
  • THEN an error should be presented to unlock the Ledger device
  • AND the MMM app does not restart

References

  • https://recordit.co/qcre6ZL1PP

plasmacorral avatar Aug 27 '22 00:08 plasmacorral

Just an update that I was able to reproduce this on a subsequent swap attempt using a non-native asset on BNB network with pancake swap. When I attempt to enable an asset for trading while the Ledger device screensaver is active and the device is locked, MMM simply closes and returns the user to the login page. I am subsequently able to retry and complete these actions after unlocking the device. https://recordit.co/F9KcRpl6ND

I can produce similar behavior in attempting to use Uniswap right after the Ledger screensaver turns on and the device is locked: https://recordit.co/VlzfqPRIek

In a totally different use case where the user is attempting to send ETH on a testnet to another EOA, the transaction seems to disappear if sent to Ledger right after the screensaver/PIN lock occurs: https://recordit.co/IH4pN2RGwt

Finally, when attempting to pair MMM with the Ledger while the Ledger screensaver is enabled and the device is locked, pairing fails and no error is presented. The user is simply returned to "connect a hardware wallet": https://recordit.co/RYepZV9tAz

There is an opportunity to handle a screensaver/locked Ledger device in a way that avoids the mobile wallet closing and support a more informative error to inform the user how to proceed.

plasmacorral avatar Sep 06 '22 20:09 plasmacorral

There might be an issue using Pancake swap when a token spending approval is required to swap out of non-native assets. I am seeing the app close when trying to send the token spending approval to Ledger, without fooling with screen/pin lock.

Android 12 Pixel 3a MMM build 952

Ledger settings - Blind signing: enabled - Debug data: Not displayed - Nonce: Displayed

When I tap "approve" on the spending limit modal, I see the location permission request and then the app closes.

Trying to approve UNI: https://recordit.co/z6fKtFjrzA - at 39s (returns user to Chrome browser) - at 1m26s ("MetaMask keeps stopping") - at 2m15s (returns user to home)

Trying to approve Doge-BNB: https://recordit.co/1o4M8gS84P - 1st attempt at 1m02s results in "Your device got disconnected" - tapping "Try again" appears to work, but was never actually broadcast to network

plasmacorral avatar Sep 15 '22 20:09 plasmacorral

This is a function on a non Ethereum chain so this feature could be unsupported. The Ledger Ethereum app just supports Ethereum, not all EVM chains.

AlexJupiter avatar Sep 23 '22 13:09 AlexJupiter

This issue was closed because it has been stalled for 7 days with no activity. If you feel this was closed in error please reopen and provide evidence on the current production app. Thank you for your contributions.

github-actions[bot] avatar Jun 16 '23 23:06 github-actions[bot]