Meta-transactions allow users to interact with smart contracts without paying gas fees. A relayer (like Gelato) pays the gas fees and executes the transaction on behalf of the user through:Documentation Index
Fetch the complete documentation index at: https://docs.gelato.cloud/llms.txt
Use this file to discover all available pages before exploring further.
- EIP-712 Typed Data Signing: Users sign structured data instead of raw transactions
- Contract Inheritance: Contracts inherit meta-transaction functionality
- Signature Verification: Contracts verify user signatures and execute functions on their behalf
Contract Conversion
Original Contract
Meta-Transaction Enabled Contract
To enable meta-transactions:- Inherit from
EIP712MetaTransaction - Replace
msg.senderwithmsgSender()
Key Changes
| Original | Meta-Transaction Enabled |
|---|---|
contract SimpleCounter | contract SimpleCounter is EIP712MetaTransaction("SimpleCounter", "1") |
msg.sender | msgSender() |
- Inheritance: Passes contract name and version for EIP-712 domain separation
msgSender(): Returns the original user address (not the relayer address)
What EIP712MetaTransaction Provides
executeMetaTransaction(): Main function to execute meta-transactionsgetNonce(address user): Get user’s nonce for replay protectionmsgSender(): Returns the original user address- EIP-712 domain separation to prevent signature collisions
Client Implementation
Setup EIP-712 Types and Domain
Complete Example
EIP712MetaTransaction.sol
Create this base contract in your project to inherit meta-transaction functionality:ECDSA library for signature recovery. Install it with: