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
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 ?
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”}]
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?
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?
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
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.
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
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.
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/…