How do I structure eip-681 requests so that metamask mobile will successfully process them?

I have been trying to create eip-681 compliant payment links and qr codes for a few months now. It seems like I am creating them correctly and other wallets process them just fine, but MetaMask mobile displays it successfully, sends it, and then the transaction fails.

Below is an example that requests 25 USDC on Polygon. It is compliant with the erc-681 spec

ethereum:0x2791Bca1f2de4661ED88A30C99A7a9449Aa84174@137/transfer?address=0xCfc1650da7C961FD82998e7e30ca5f699D0aBf41&uint256=2.5e7

The transaction always fails when sent from MMMobile, but works from other wallets like AlphaWallet and Rainbow. My matic are also lost in the process :frowning:

You can look at transaction 0x6e1f334a72a9eb27cba62017c069bc185d6e96d780961b44a214183f3e448ef4 on polygon for details.

Thanks for the help, certainly MMMobile supports this basic functionality right?

Hello again @russellc !

Which generator based on EIP-681 standard did you use ?
MetaMask deeplink generator with transfer function ?
If so, did you remember to manually enter the chain ID ?

3 Likes

Hey everyone, I’m trying to create usdt polygon approval deeplinks for MetaMask mobile, whereby a customer can scan the QR code on a POS device and it brings up an approval to sign on their MetaMask mobile wallet.

I’ve looked everywhere and I only see transfer deeplinks and no approval deeplinks for QR codes: MetaMask.app.link/send/0xc2132D05D31c914a87C6611C10748AEb04B58e8F@137?functionName=approve&functionArgs=[{“name”:“spender”,“type”:“address”,“value”:“0x61e129d8b0836F05b64d7c59500F4fa042EA8c5B”},{“name”:“amount”,“type”:“uint256”,“value”:“1000000000000000000”}]

@AerynQ

In this case, no approval is needed to transfer tokens, because the user signs a transaction of a standard type using a deep link.
Or do you have middleware in the POS terminal that off-chain collects additional information?

3 Likes

We have endpoints checking allowances for connected wallets to process payments via external APIs so we don’t need transfer deeplinks but approval deeplinks. Is this something that MetaMask supports?

@AerynQ

It’s possible in MetaMask.

  1. First, generate a translation link using the MetaMask generator. In the example, I used the address of the USDT contract in the mainnet network.

  1. Then replace transfer with approve in your link.

  1. Use any (LEGIT!) QR code generator from the link.

  1. :white_check_mark: Done
2 Likes

Thanks @snwlprd.eth, does that work on Polygon though (137)? This seems to be the right deeplink but doesn’t do anything, only transfer works on Polygon: MetaMask.app.link/send/0xc2132D05D31c914a87C6611C10748AEb04B58e8F@137/approve?address=0xa2F9384d53839b578D148cE2917e95ad69D85521&uint256=1e15

@AerynQ

Can you tell me what device you have, OS version and installed version of MetaMask?
You can open an issue on the MetaMask Github or I can do it for you if you provide more information about the devices on which this is being tested.