Closed Sap333 closed 2 months ago
Hello, @Sap333. Thanks for reporting! I will assign this to the appropriate team. They will follow up on this as soon as they can. Thanks for your patience and understanding!
I investigated a little bit and found that current mobile Metamask version (for all platforms) doesn't work with "web3-eth" and "web3-eth-contract" npm-package versions higher than 4.0.3, when a DApp is executed form the Metamask's embedded browser. For some reason smart method's parameter encoding becomes completely broken in such case. Desktop version of Metamask and all other mobile wallets work with all versions of "web3-eth" perfectly, which means that the problem is on mobile Metamask's side.
This make current version of mobile Metamask wallet unusable with a big (majority?) number of modern Web3 projects and on all projects that update their code base! Give that the current version "web3-eth" 4.3 the situation becomes worse and worse because Metamask can only work on outdated library version, that has outdated dependencies.
Relates to a discrepancy in the Ethereum Execution APIs: https://github.com/ethereum/execution-apis/issues/507
use data
not input
Based on developments in this thread: https://github.com/ethereum/execution-apis/issues/507, we may consider resolving this issue by changing the spec to support either data
OR input
fields in these method calls.
This issue has been automatically marked as stale because it has not had recent activity in the last 90 days. It will be closed in 7 days. Thank you for your contributions.
This issue was closed because there has been no follow activity in 7 days. If you feel this was closed in error please provide evidence on the current production app in a new issue or comment in the existing issue to a maintainer. Thank you for your contributions.
Describe the bug
The mobile Metamask (at least on Android) in it's embedded browser encodes all calls to a blockchain in a wrong way. Let's say we use Binance Testnet (id = 97) and smart contract's address is 0x19C9B23c79415A558e29297E579FA37FB725453d.
The ABI is:
Then we call "achievementPrices(0)". And it sends what? It sends the next nonsense:
And then fails with wrong reply error. And the very same code (absolutely and literally same) works properly on a desktop (chrome extension) version.
Expected behavior
The correct encoding would be something like:
Screenshots/Recordings
No response
Steps to reproduce
Error messages or log output
No response
Version
7.10.0 (1187)
Build type
None
Device
Android 11 mobile phone
Operating system
Android
Additional context
I didn't test on a Binance Mainnet and my applications adds a networks and switches to it. Probably this may somehow affect behavior. But it also fails on a Binance Testnet so it must be easy to reproduce.
Severity
Major critical bug which makes the whole application unsable. And the very same code works on a desktop version!
I also attach the full ABI of a smart contract ( 0x19C9B23c79415A558e29297E579FA37FB725453d ) on a Binance Testnet so everyone could easily reproduce the bug. Any call to this smart contract fails (even "registrationFee()" which doesn't require any parameters).
abi.txt