How to call a smart contract function with input parameters from the QR Code Scan by the Metamask mobile app?

Is there a way to call a smart contract function with input parameters by scanning the QR code with the Metamask mobile app?

Hi @Edu.cunha ,

Does the “Mobile Specific RPC Methods” section in this doc get you what you need?

I don’t know if I understood this method correctly. But to clarify a little bit more what I meant: as there is the possibility of automatically setting the value of the transaction when scanning the QR code by passing the string “ethereum:address?value=valueinwei” to build the QR code, is there a way to call smart contract functions and give input parameters in a similar way?

For example, there is a payable function in a smart contract that I would like to also pass a hexcolor selected by a hexpicker in a dApp. The idea would be that I don’t need to connect the wallet and press a button on the dApp to make this transaction, but, instead, the dApp would generate a QR code with all the information (smart contract address, value to transfer, function to call, input hexcolor string) needed and I would have to only scan the QR code with my Metamask mobile app and accept the transaction.

1 Like

i dont know what you say ,but you can communite the metamsak to solve it

yes this is a very good and useful suggestion.

Hm, @Edu.cunha ,

I’m not positive on this so let me see if I can get the answer for you, stay tuned!