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?

1 Like

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 ?

4 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”}]

1 Like

@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?

4 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?

1 Like

@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
3 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

1 Like

@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.

3 Likes

I generated the string according to the eip-681 spec and created the QR code myself.
You can see the components:
ethereum:0x2791Bca1f2de4661ED88A30C99A7a9449Aa84174@137/transfer?address=0xCfc1650da7C961FD82998e7e30ca5f699D0aBf41&uint256=2.5e7

The Chain ID is in bold

1 Like

That isn’t 681 compliant, that is tied to the wallet itself.

1 Like

Why would I give another wallet access to my wallet for a payment? Thats worse than credit cards! the whole point of EIP-681 is to make it super simple to request a certain amount of a token on a specific chain.

1 Like

@russellc

It is not necessary to do this, it is enough to use a transfer, but allowance is a legitimate func of the ERC20 standard, and it is necessary if you are developing a DEX or something else.
Try to generate a transfer function using the MetaMask generator, it has a link prefix not ethereum:…, but MetaMask.app.link/…

3 Likes

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.