Using ETHless meta-txs

Hello, I have a question about ETHless transactions. Imagine there is a Smart Contract with enroll() payable function & user must transfer 1ETH to enroll. Is it possible to use GSN meta-tx for such function? It means, that user does not own ETH on his address, but relay Smart Contract (or some other) must transfer correct msg.value.
Thank you in advance!

Hey Vanija! It’s possible to use meta-txs for this as long as the smart contract that implements enroll is capable of accepting meta-txs, either by using EIP2771 or some other approach. As to whether it is possible to do it specifically with the GSN, I’d suggest you ask on the OpenGSN forum.

Thank’s for the reply.
Can you describe how will that 1 ETH be transferred? Player (msg.sender) has 0 ETH on account. Who and how will pay it?

The relayer, assuming it has enough incentives to do so! In this setup, you’d have a relayer account with enough ETH to pay both for gas fees and for any value transfers. Players (who don’t hold eth) just sign a meta-tx request and send it to the relayer, who wraps it in a tx of its own, and sends it to the network, includign whatever value in ETH was requested.

:+1: Got it, thanks!

1 Like