GSN Kit - Transactions related to oz cli questions (Learning)

I’m trying to understand exactly what’s going on when playing with gsn kit with oz create Counter and npx oz-gsn fund-recipient --recipient 0x6F43ad249A11B57C66da54453be8226a722f66B4 regarding transaction’s “point of view”.

oz create Counter creates 3 tx:

  • the first one create Counter logic’s contract
  • the second creates the proxyAdmin contract
  • the third creates the Counter-proxy contract

So far so good, but I did not figure it out how call/read the proxyAdmin. I thought I could do so via oz call or oz send-tx but only Counter looks accessible via these command (or the proxy’s counter more precisely). I found oz set-admin but what if I wanted to do this manually ? What if I wanted to read the current value of admin (address) ?
Is this behaviour normal ?
On top of that, on the build directory there is no ProxyAdmin.json which means no abi in order to get the instance on a truffle console so… I’m wondering how the contract has been deployed in the first place…

npx oz-gsn fund-recipient --recipient 0x6F43ad249A11B57C66da54453be8226a722f66B4 creates also 3 txs:

  • account[0] send 0.42 eth to an “unknown” address (A)
  • (A) creates the Relayhub contract
  • account[0] sent by default 1 eth to the RelayHub

Could you please explain what happening here ?
From my understanding:

I dig a bit here and there and I think a got some pieces of the cake but not the whole, especially regarding the third transaction.
Initially I thought any Recipient would keep some eth “inside” so that it would pay a successfull relayer’s action. But the funds actually go to the RelayHub contract which I guess act a little bit as an escrow in a sense that, it is is responsability to trigger the “payment/reward” on behalf of the recipient, so that guaranteeing both parties.

If it’s correct, how are we suppose to fund one recipient “normally” ? Using the command line oz-gsn fund-recipient or manually with the depositFor fonction ?
Is it possible to achieve a logic in which a relayer get paid with a portion of an ERC20 transfer (the meta tx relayed) ?

1 Like

Hi @grog,

We can interact with the ProxyAdmin contract

There isn’t currently an OpenZeppelin CLI command to get the current value of the admin address.
We can see the ProxyAdmin address in <network.json> in the .openzeppelin directory.

Yes, this is how it currently works.

The json for @openzeppelin/upgrades can be found in the following directory: .node_modules/@openzeppelin/upgrades/build/contracts

The third transaction is funding the recipient contract with 1 Ether in the RelayHub (calling depositFor.

Deposits Ether for a contract, so that it can receive (and pay for) relayed transactions.

We fund the recipient contract using the GSN Dapp Tool
Open in a browser with MetaMask (or other web3 provider) and deposit for the recipient contract.

See the following guide for: Using Gas Station Network starter kit on a public testnet

Let me know if you need more information.

1 Like

Hi @grog,

I realized that I had missed a question.

Not currently. The RelayHub uses Ether for paying relayers.

1 Like