Can you call contract methods using only Metamask?

I’m wanting to use MetaMask in my app to let users pay a fixed ETH fee (plus gas) to call a method from my Solidity contract. I looked at the documentation, and the “eth_sendTransaction” method seems close to what I need; eth_sendTransaction would certainly allow me to request ETH from a user, but the “data” parameter is a bit confusing.

The Metamask docs say:
“data is optional, but used for defining smart contract creation and interaction”
“also used for specifying contract methods and their parameters.”

So “data” is to be the Keccak representation of my method and its parameters, right? But how does Metamask (or window.ethereum, rather) know the contract whose methods I’m trying to call? Don’t you normally have to provide a contract address and ABI/JSON in order to interact with a deployed contract? In short, is it possible to do what I’ve described with just Metamask, or do you have to do other client-side setup? Thanks in advance.

Reach out to our helpdesk: https://support.metamask.io 1 and
click the blue “Start a Conversation” button. The bot will ask a few questions then get you connected.

I went to the live chat, they sent me to support@metamask; I emailed support@metamask, they told me that they’re no longer taking direct emails, then sent me back to the live chat.

Sorry to hear the issue still continues.
If you would like, you can submit a ticket to our support team at
https://metamask.zendesk.com/hc/en-us and click Start a conversation

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