web icon indicating copy to clipboard operation
web copied to clipboard

ETH sends: Parse EIP-681 QR codes

Open gomesalexandre opened this issue 2 years ago • 0 comments

Overview

Currently, when scanning a QR code from MetaMask mobile, a QR code that doesn't allow continuing with the send flow component is input.

1inch Wallet, MyCrypto (desktop), Coinbase Wallet also seem to generate similar address formats.

This format is perfectly valid and follows the EIP-681 URL format specification.

We should parse them so that they are properly decoded and allow sending to the scanned QR code.

References and additional details

Spec: https://eips.ethereum.org/EIPS/eip-681

We also want to make sure to properly parse the parameters part. Funds loss has occurred in wallets that incorrectly parsed only the target_address part (here, the USDC contract address) and ignored the following parameters https://twitter.com/TalBeerySec/status/1374423353168031746. A safe option would be to simply consider sends that contains parameters as invalid. eth-url-parser can be used as a parser for EIP-681 URLs: https://github.com/brunobar79/eth-url-parser

Acceptance Criteria

  • Ethereum ETH EIP-681 QR codes are parsed, and allow continuing with the flow up to a successful broadcasted Tx
  • Ethereum ERC-20 EIP-681 QR codes, and allow continuing with the flow up to a successful broadcasted Tx

Need By Date

No response

Screenshots/Mockups

(Changed to zero address for the screenshot) image

Estimated effort

No response

gomesalexandre avatar Jun 17 '22 11:06 gomesalexandre