Non-Sponsored calls, also known as Sync Fee Calls, are the simplest way to pay for relay services. However, they delegate all security (reentrancy/replay protection etc.) and payment logic to the target smart contract. You can use ERC-2771 to achieve out-of-the-box security and authentication. Relay costs are covered in either native or ERC-20 tokens and they are paid synchronously during the relay call. For ERC-20 tokens that implement the permit function (EIP-2612), you can enable gasless transactions by allowing users to authorize token spending through off-chain signatures instead of requiring an on-chain approval transaction.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.
Implementation Steps
1. Deploy a GelatoRelayContext compatible contract
Import GelatoRelayContext in your target contract to inherit callWithSyncFee functionalities:For ERC2771 Sync Fee Calls (Recommended)
Import GelatoRelayContextERC2771 in your target contract to inherit ERC2771 functionalities with callWithSyncFee:2. Import GelatoRelaySDK into your front-end .js project
For ERC2771 Sync Fee Calls
3. Generate a payload for your target contract
4. Send payload to Gelato
For ERC2771 Sync Fee Calls
Important Considerations for ERC-20 Permit
When implementing permit functionality, keep these points in mind:- Token Compatibility: Not all ERC-20 tokens support permit - always check compatibility first
- Single Transaction Flow: Users can approve and execute in one transaction when permit is supported
- Signature Expiration: Permit signatures have deadlines - ensure adequate time for transaction execution
- Nonce Mechanism: Each permit signature can only be used once due to the nonce mechanism
- Security: Always validate permit parameters in your smart contract to prevent replay attacks