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 send 0.42 eth to an “unknown” address (A)
- (A) creates the Relayhub contract
- account sent by default 1 eth to the RelayHub
Could you please explain what happening here ?
From my understanding:
- the first just “load” an openzeppelin’s EOA called “deployer” (https://github.com/OpenZeppelin/openzeppelin-gsn-helpers/blob/master/src/data.js)
- the second just use the deployer to creates the RelayHub contract, okay
- but the third one…I’m not sure.
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) ?