New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
EIP-681 URL and QRcode for "approve" function does not work #1828
Comments
Hi @omnat, @estebanmino and contributors - May I please request your kind attention to this issue regarding ERC20 "approve" method under EIP-681. The reason I'm troubling you is that our entire mobile app development has hit this wall and we cannot proceed any further. This issue appears to be a break-fix, since it was working earlier this year. I understand that you may have prioritized these issues in a certain order. If that is the case, I'd just stand in line until a kind soul picks it up. If I could do anything to speed it up, please let me know. I'd be most honored. Thank you very much! |
Thanks @estebanmino I'm ready to test! |
@ravisriv do you have any example to test? |
@estebanmino Yes, will use the following deep link for testing: The smart contract 0x3dD...eeCb40 on Rinkeby has created certain ERC20 tokens, which the MetaMask wallet owner will have in their wallet. The MetaMask wallet owner will allow ("approve") the smart contract 0x178...cfc747 (on Rinkeby) to spend 500 of these tokens. If the approval is successful, the smart contract can spend 500 of these ERC20 tokens from the MetaMask owner's wallet in the next step. |
@estebanmino In addition to above, if there is full EIP-681 compatibility, we can send other smart contract functions (for example, our smart contract has non-ERC20 functions like "confirm", "cancel", etc.) through the EIP-681 deep link. Therefore, we have extensive capability to test this function quite thoroughly. Thanks you very much, Esteban. |
this is going to be part of the next release, let's follow other RPC methods here #1872 |
@ravisriv thank you for your insights! |
Bug Description
The following EIP-681 compliant URL for "approve" does not work:
https://metamask.app.link/send/pay-contractAddress/approve?address=receiverAddress&uint256=1e2
Please refer to the discussion on this "closed" issue (#1059). The QR code that is generated in accordance with EIP-681 for "approve" method causes incorrect messages to be displayed on the MetaMask Mobile v1.0.1 and the transactions eventually fail to execute.
This EIP-681 functionality was working in earlier beta releases of MetaMask in January-February 2020 time frame. I had tested it extensively. The functionality probably broke after April of 2020.
To Reproduce
Use the following URL on your iPhone with MetaMask 1.0.1 installed.
https://metamask.app.link/send/pay-0x3dD3DfaAdA4d6765Ae19b8964E2BAC0139eeCb40@4/approve?0x0301dcF5Cf918a6E506AEa3C8FC6c57D8EbB8B92&uint256=50023e2
The purpose of the URL is to approve a smart contract to spend certain amount of an ERC20 token from the user's wallet.
The MetaMask-Mobile should seek user's permission to allow the smart contract permission to spend ERC20 tokens from the user's wallet. However, the MetaMask Mobile screen shows the following erroneous message and fails to process the EIP-681 request correctly.
Next create an "approve" function at the following MetaMask Deep Link Generator:
https://brunobar79.github.io/eip681-link-generator/#
Scan the QRcode. It will fail to process the "approve" transaction.
When you scan the QRcode above using MetaMask Mobile, you get the following screen:
This is incorrect and confusing.
Expected Behavior
The correct message should be that "Authorize xxx to spend yyy ERC20 tokens from your wallet?" "xxx" in the previous sentence refers to the owner of the smart contract and "yyy ERC20" refers to "number of ". If the user approves the transaction, the smart contract is authorized to withdraw ERC20 tokens from the wallet. However, after scanning the QR code, we get the above screen (which is incorrect) and the "approve" transaction fails.
Smart Phone
Noticed this bug on iPhone X, iOS 13.6.1 MetaMask Mobile v1.0.1.
Criticality
"approve" is a highly critical ERC20 method required for several Dapps. Some of the common use cases include, agreeing to submit earnest money for an auction. The auctioneer will withdraw the money only if the user's bid is accepted. Other instances would include when the "approver" wants the "approvee" to withdraw the money under certain circumstances.
This issue is visible to all users and to anyone who is using EIP-681.
Please take note that in the absence of an SDK for MetaMask mobile, EIP-681 is the only way of interfacing with an app on the mobile device. Therefore, this is a highly critical issue, which needs to be resolved quickly.
The text was updated successfully, but these errors were encountered: