MetaMask / metamask-extension

:globe_with_meridians: :electric_plug: The MetaMask browser extension enables browsing Ethereum blockchain enabled websites
https://metamask.io
Other
11.85k stars 4.84k forks source link

[Bug]: ETH Mainnet - Unable to deposit to smart contract. #22219

Open catsmells opened 9 months ago

catsmells commented 9 months ago

Describe the bug

When attempting to deposit ETH to a deployed smart contract, MetaMask grays out the ability to create the transaction despite ample balance for the amount being sent, and the gas itself.

Expected behavior

No response

Screenshots/Recordings

https://recordit.co/mhS6eX9NmU

Steps to reproduce

  1. Copy deployed smart contract address (deployed from Trezor-Metamask Bridge).
  2. Paste it in "Send".
  3. Specify amount of ETH you wish to send.

Error messages or log output

No response

Version

11.5.1

Build type

None

Browser

Firefox

Operating system

Windows

Hardware wallet

Trezor

Additional context

No response

Severity

No response

catsmells commented 9 months ago

Hello @catsmells, Visit the Ethereum official page to resolve this issue.

Note: you can also initiate a chat with the support for more assistance and enquires.

That's a phishing link. Reported. The actual ETH link: https://ethereum.org/en/community/support/

bschorchit commented 9 months ago

Thank you for your report @catsmells ! We'll look into it. I'm able to reproduce it as well on v11.6.2 and v11.7

seaona commented 9 months ago

does this contract have a receive function @metamaskbot ? I've encountered this behaviour with contracts which don't have receive function, but I can normally send ETH to contract addresses which have receive.

Example: Sending ETH to this address works normally:

contract Test {
   receive() external payable { }    
}

but sending ETH to this contract does not work:

contract Test {}

The gas is set to 0 and cannot proceed to the next screen (similarly to your recording). I see the error Error#6: Unable to determine contract standard in the console`. This closely relates to this other ticket https://github.com/MetaMask/metamask-extension/issues/21867 and we need a way to better handle those cases.

Screenshot from 2023-12-14 13-55-31

cc @bschorchit

catsmells commented 9 months ago

does this contract have a receive function @metamaskbot ? I've encountered this behaviour with contracts which don't have receive function, but I can normally send ETH to contract addresses which have receive.

Example: Sending ETH to this address works normally:

contract Test {
   receive() external payable { }    
}

but sending ETH to this contract does not work:

contract Test {}

The gas is set to 0 and cannot proceed to the next screen (similarly to your recording). I see the error Error#6: Unable to determine contract standard in the console`. This closely relates to this other ticket #21867 and we need a way to better handle those cases.

Screenshot from 2023-12-14 13-55-31

cc @bschorchit

Interesting tidbit - contracts without the receive function allow for deposits on testnets, but not on the Mainnet.

blackdevelopa commented 8 months ago

Also worth mentioning that MMM handles this differently (gets to the confirm screen) and that both platforms should be consolidated.

@seaona shared two ideas around this.

  1. We should allow to proceed with the flow in Extension as is on mobile (we should not censor anything, and we must empower the user to decide)
  2. We should display a warning for failing transactions in both Mobile and Extension.

@bschorchit

sleepytanya commented 6 months ago

Update: this issue is present in 11.7.5 and develop. Development build from git id: https://github.com/MetaMask/metamask-extension/commit/9a782e169420a6e4eaed80c9afc6a7b82b2780ab, Chrome (same behavior on Firefox):

https://github.com/MetaMask/metamask-extension/assets/104780023/d8a188b1-f3f5-481d-81d2-1da63eeb8e14

sleepytanya commented 6 months ago

Probably related: https://github.com/MetaMask/metamask-extension/issues/21867

github-actions[bot] commented 1 month ago

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 45 days if there is no further activity. The MetaMask team intends on reviewing this issue before close, and removing the stale label if it is still a bug. We welcome new comments on this issue. We do not intend on closing issues if they report bugs that are still reproducible. Thank you for your contributions.

seaona commented 2 days ago

This issue is still present

https://github.com/user-attachments/assets/71f3e285-96c3-430c-9d3c-b4d2f9fc1312