Closed dong77 closed 4 years ago
Without much knowledge in GSN, I have the following questions:
msg.sender
s internally, ERC1271? This seems transparent to us though.how can we specify which token to charge the user as the meta-transaction fee? An example will be really helpful. In our case, we'd like to specify:
@Brechtpd I have this feeling that GSN will probably make our smart wallet module design simpler...
I created a PR to demonstrate how our meta-transaction modules can be re-implemented using GSN. The only part that's missing from this demo is the Paymaster contract that charges fees from each wallet.
One of the reasons Agents exist is to support GSN or other meta transactions. I would say we want to keep these specific implementations out of the main protocol. If we do want to support one of these out of the box we can just whitelist some agents on the protocol contract so they are enabled for all users without them having to enable it specifically.
So I would say:
For payments, well, if we want people to keep their funds inside the rollup, we kind of also have to charge people for meta transactions inside the rollup I would think, that's where their funds are available. So meta txs done by us using conditional transfers for fee payments makes sense to me, and is as easy as calling approveOffchainTransfer
. On the other hand, not everyone will store all their funds there, so some other way to pay may be useful as well. But I have to look more into how the Paymaster works.
I have this feeling that GSN will probably make our smart wallet module design simpler...
Probably, but on the other hand it's also one of the most important parts of a smart wallet. So if you create a smart wallet from scratch it kind of makes sense to have this built in. But I'm all for using existing services/smart contract where we can!
Brecht, if we create a Meta-transaction Agent, does each user has to enable that Agent before using it? The user may not have any Ether at all...
I would allow Agents to be whitelisted by either the protocol contract and/or by the exchange owner. This way some Agent implementations can be a standard feature available to all users, so we don't have to worry about any initial gas costs for enabling those features.
Great, in that case, please come up with a draft implementation to support metadata tx when the time is right.
I would allow Agents to be whitelisted by either the protocol contract and/or by the exchange owner. This way some Agent implementations can be a standard feature available to all users, so we don't have to worry about any initial gas costs for enabling those features.
To me, this is similiar to the modules in our smart contracts.
I was trying to implement an Agent for GNS - OpenGSN2Agent, but I get this design problem:
Suppose Alice and Bob both trust this agent, then Bob will be able to call the exchange contract by specifying Alice as the 'from' address. Therefore, for each invocation, the OpenGSN2Agent must notify the exchange contract that the real caller is Bob, not Alice.
The idea I have is to append the real caller to the end of the call data, as we did in Hebao 1.1's ForwarderModule
https://docs.opengsn.org/tutorials/
As of now, if a user must have some Ether to perform any exchange related layer-1 actions. If we support gas-less transactions relayed by GSN, users can perform those actions without Ether.