Repository containing a gas cost effective standard for meta transaction to be used by any contract to enable native meta transaction feature on any function. The approach support signed typed messages so that while signing the data on client side user see a human readable message instead of scary hex string.
You can see the LIVE DEMO Here(works on Ropsten)
The standard is the result of initiative by metamask here https://medium.com/metamask/announcing-a-generalized-metatransaction-contest-abd4f321470b
Biconomy was selected as one of the finalist in the hackathon. Read here
- Inherit EIP712MetaTransaction contract
- Use msgSender() method where ever you were using msg.sender
- (Optional) Use msgRelayer() method to get the relayer address who paid for transaction gas fees That's it. Pretty simple
userAddress => externally owned address of the user eg the user address in his metamask wallet
functionSignature => ABI encoding of function name with its parameter. Use web3 encodeABI method here
sigR => 32 bytes r part of the signature
sigS => 32 bytes s part of the signature
sigV => integer v part of the signature
r,s,v can be calculated using web3 getSignatureParameters utility method.
Since this standard supports EIP-712 so signature parameters should be generated using eth_signTypedData_v3 or eth_signTypedData_v4 JSON RPC method.
Check out example front-end code here and example solidity code here
This repository is basic implementation of Native Meta Transactions. This reposiory will be updated as per the EIP-1776 to implement native meta transactions with support of batching, transaction expiry etc