bcnmy / mexa-sdk

Repository contains mexa sdk code that can be plugged into your dapp and can leverage meta transaction feature.
MIT License
105 stars 41 forks source link

Support for customising EIP 712 signature request #77

Closed bhargav55 closed 3 years ago

bhargav55 commented 3 years ago

Lot of parameters in EIP 712 signature are not required and need to add missing parameters to the signature request, can we have the option to customise the signature request.

tomarsachin2271 commented 3 years ago

Support for custom TrustedForwarder is in the roadmap where developers will be able to deploy and use their own TrustedForwarder hence their own signature request. Can't comment on the timeline right now but it might take couple of months for this customisation feature.

livingrock7 commented 3 years ago

Yes, we will be adding customisation option for signature request and use minimal forwarder of your choice/provided by us.

EIP2771 only has two unnecessary paramters in some scenarios, which are token address and tokenGasPrice. Rest are definitely required. More on this...

Biconomy Forwarder uses ERC20ForwardRequest typehash. so we have generic forwarder eip2771 and forward (pay in erc20 tokens) For forward call is routed to ERC20Forwarder which in turn uses BiconomyForwarder to forward to recipient so thats the flow currently.

But for just using EIP 2771 we can deploy minimal generic forwarder. This would just remove need of passing token address and tokenGasPrice for forwarded transactions that don't need it. Check this for example : https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/metatx/MinimalForwarder.sol

Closing this issue. We will update on the timeline for customisation feature. Feel free to open a PR on https://github.com/bcnmy/mexa for adding any contracts that enable customised typehash for signatures :)