Gelato

Gelato gasless transactions support gas sponsorship and compatible token payments

Gelato gasless transactions remove the user's need for native gas tokens when a compatible sponsor or token-payment route covers fees. Applications can absorb those fees or recover them in an accepted token. The payment choice must match the execution route, contract permissions and available funding.

Sponsorship and Token Charging

Gas sponsorship charges the application's funding balance for eligible execution, allowing the user to avoid a separate gas payment. Gas Tank supplies that funding for supported Gelato calls. An application can subsidize the entire fee or combine sponsorship with a charge that its own payment logic collects.

A token-charging paymaster covers network gas and accepts a supported ERC-20 token to recover costs. ERC-20 is the common fungible-token interface. This arrangement requires compatible account, bundler and paymaster implementations. Token acceptance belongs to the selected payment configuration; a token balance alone does not establish compatibility.

Custom contract collection provides another path. Gelato's SyncFee migration pattern sponsors execution through Gas Tank while application code collects the user's token fee. The application controls the collection amount and recipient. Its sponsor balance funds delivery even when a user ultimately reimburses the application.

Legacy SyncFee Requires Migration

The legacy Relay SDK is deprecated in favor of the Gasless SDK, @gelatocloud/gasless. Legacy SyncFee calls used relay-context contracts to extract fee information and transfer a relay fee during execution. Gelato is deprecating that built-in fee-handling model.

The migration path replaces built-in relay-fee collection with sponsored execution and custom collection logic where user charging remains necessary. Updating an SDK import cannot supply the contract logic that collects tokens. Fee calculation, authenticated payer selection and recipient control need explicit treatment in the revised integration. Older SyncFee fee-token lists describe that older route. They do not establish which tokens a replacement paymaster or collection contract accepts.


Gas Tank Funding and Sponsor Costs

Gas Tank provides a shared funding balance for eligible sponsored activity across supported networks. Its mainnet deposit flow uses USDC. The documented Gas Tank route for deposits through Circle's Cross-Chain Transfer Protocol (CCTP) does not support Safe or other smart contract wallets. An externally owned account can fund a team's balance. The deposit network and execution network can differ, allowing the sponsor to manage service funding without maintaining a separate Gas Tank balance for every execution chain.

Spendable funding depends on the deposit being credited. A pending deposit still awaits the required processing and confirmations. The deposit record, credited balance and sponsorship charges describe different movements of funds. A deposit transaction hash alone does not establish that the sponsorship balance has increased.

Gas Tank covers execution costs and applicable service charges. In the custom-collection migration pattern, user tokens go to the application's configured fee recipient. That transfer does not automatically replenish Gas Tank. The application needs enough sponsorship funding even when it expects reimbursement from the user.


Sponsorship Policies and Spending Limits

Sponsorship eligibility follows the application's funding rules, including the restrictions that its configured policy applies. Gelato supports global and per-user limits, allowlists and blocklists. Time-bound campaigns provide a separate way to restrict the period of sponsorship.

Graphic: Gelato gasless transactions: Sponsorship Policies and Spending Limits

View image file

An authorized wallet action can fail sponsor eligibility even when its contract logic is valid. Funding and permission answer different questions. A funded account does not override an address restriction, and a permitted user does not supply an exhausted sponsorship balance. Token payment is a fallback only when the application has implemented and presented that alternative. Sponsor rejection does not itself authorize a user-token charge.


Network Fees and Token Fee Quotes

Fee comparisons need the amount that each payment route charges for the same intended operation. On Ethereum, execution gas cost equals gas used multiplied by the effective gas price. Contract complexity and network gas prices affect that cost. Applicable service charges add another component to the sponsor's bill.

A token-payment quote expresses the fee through the selected payment arrangement. A token-charging paymaster needs a conversion between network costs and its accepted token. A custom collection contract may instead charge an application-defined amount. These arrangements can produce different user charges for the same underlying call.

Gas Tank's successful-transaction billing uses receipts to account for execution costs plus the applicable fee. An advance estimate serves a different purpose: assessing proposed execution before its final cost exists. The quote, spending authorization and settled charge need consistent token units and clearly identified recipients.

Token Permissions and Gasless Approvals

Token collection requires authority over the exact balance that the payment mechanism intends to charge. The payer, spending contract and fee token must match the authorization. Native gas sponsorship does not grant access to a user's ERC-20 balance.

Balances and Allowances

An allowance permits a specific spender to transfer tokens from an owner's balance. The owner also needs sufficient tokens for collection. These are separate conditions: a large balance cannot replace permission, and an allowance cannot create missing funds.

A collection contract using transferFrom must identify the authenticated owner and the intended fee recipient. Broad spending approval can remain available beyond the immediate fee, so the approved amount and spender deserve attention before signing.

Permit-Supported Tokens

An EIP-2612 permit lets a supporting token update an allowance from a valid signed message. The signature includes the owner, spender, amount, nonce and deadline. Token support is essential; an ordinary ERC-20 interface does not imply that this permit extension exists.

A compatible collection contract can call the token's permit function and collect the fee within the same sponsored call. This avoids requiring a separately funded approval transaction for that arrangement. The permit format and signature validation must match the token implementation.

Execution Routes for Different Account Types

Execution routing determines how the target contract receives an authorized action and which payment mechanisms can accompany it.

Direct Contract Relay

Turbo Relayer supports direct gasless contract submission without requiring a smart account. The target contract still needs the authorization logic appropriate to its operation. Relayer delivery alone does not make a call originate from the user's wallet address.

Smart Account Calls

A smart account can encode and authorize application calls through its account logic. Gelato supports a smart-account client alongside direct relaying. This route suits operations that require the account itself to act as caller, subject to its permissions and the receiving contract's rules.

ERC-4337 Operations

An ERC-4337 bundler packages user operations for execution through an EntryPoint contract. A paymaster can supply their gas funding under its validation rules. Gelato's bundler route supports sponsored operations; token charging requires the compatible paymaster arrangement selected by the integration.

EIP-7702 allows an externally owned account to delegate execution to account code on supporting networks. It can participate in compatible account-abstraction arrangements. The account implementation determines available permissions and execution behavior.

Chain Support and Testnet Boundaries

Chain compatibility belongs to the selected execution service and account configuration, including the payment mechanism used for that call. The relayer's getCapabilities() response groups supported chain IDs with token metadata and fee-collector information. An EVM-compatible chain is not automatically available through every route.

Onchain user-token collection needs the relevant balance and allowance on the execution network. Gas Tank's shared service balance operates differently. A token held elsewhere does not satisfy a local collection contract's balance requirement simply because sponsorship supports multiple networks. Testnet settings also need to match the client and contract deployment. Test assets and test sponsorship do not establish mainnet funding. EIP-7702 requires network support, while an ERC-4337 account must match the EntryPoint and paymaster configuration that the bundler accepts.


Caller Identity and Trusted Forwarders

Forwarded calls need a reliable way to identify the user whose balance or permissions govern the operation. In an ERC-2771 arrangement, the trusted forwarder validates the request and conveys the original signer to the receiving contract. The immediate caller and authenticated user can therefore be different addresses.

Graphic: Gelato gasless transactions: Caller Identity and Trusted Forwarders

View image file

An ERC-2771 recipient must trust the forwarder before accepting its appended signer address. Charging tokens from an arbitrary address supplied in calldata would bypass that protection. Contract authentication must bind the action and any fee collection to the intended payer. Gelato's legacy trusted forwarders are subject to deprecation without a Gelato-provided replacement. Continuing that design requires an integration-owned forwarder and updated encoding. Its signature domain must identify the correct forwarder and chain. Replacing the forwarder also requires the recipient contract to trust the new address.


Receipts for Fee-Paying Calls

A transaction receipt records an onchain outcome, including whether execution succeeded or reverted. Application logs and the resulting contract state establish whether the intended action occurred.

Visual summary: Receipts for Fee-Paying Calls (Gelato gasless transactions)

View image file

For direct relayer and smart-account calls, the Gasless SDK can return a reverted receipt without throwing. The throwOnReverted option changes that error behavior.

ERC-4337 integrations need the outcome of the individual user operation. A bundler transaction groups operations, so its outer transaction status alone does not describe every account's execution. Fee collection and the requested application action also need separate interpretation when the payment design handles failures independently.

Successful sponsorship accounting and user-token accounting concern different payers. Matching the sponsor's execution charge to a receipt does not prove that the application's token collection succeeded. The collected token amount and recipient must agree with the intended payment arrangement.


A Pending Sponsored Call Before a Retry

Consider a sponsored call with an existing request identifier that must finish before a dependent action proceeds. Normally the synchronous send returns a receipt. If the SDK reports that its synchronous request timed out and fell back to polling, it has already submitted the transaction.

  • If fallback polling is active, keep tracking the original request; another send can create duplicate execution.
  • If the request remains pending, use its identifier with getStatus() or waitForReceipt() to continue observing it.
  • If simulation failed or the relayer rejected the request before onchain submission, correct the reported cause, including any contract, payment or sponsorship condition, before sending a revised request.
  • If an onchain revert appears, inspect the receipt and refresh any authorization needed for another attempt.
  • If execution succeeds, confirm the intended contract change before continuing with the dependent action.

Prepare a corrected submission only after the failure and relevant state are clear.

Quick answers about Gelato gasless transactions

Which Token Transfer Result Must a Fee-Collection Contract Handle?

A contract collecting ERC-20 fees must handle a token transfer returning false. A call returning normally does not establish payment if the contract ignores that result. The collection logic needs to reject or otherwise handle an unsuccessful transfer before treating the fee as paid.

How Should a Token Fee Amount Be Converted for Display?

For display, divide the raw integer fee amount by 10 raised to the fee token's verified decimal precision. Keep contract amounts in integer units and convert only for display. The ERC-20 decimals method is optional, so an integration must use reliable token metadata instead of assuming a universal precision.

Does Funding Gas Tank Require Native Tokens on Mainnet?

The documented mainnet deposit flow requires USDC and native tokens for the deposit transaction's gas. Sponsoring later application calls does not automatically sponsor this funding transaction. The depositing wallet needs the assets required by its chosen deposit route.

What Happens to Gas Costs If a Sponsored User Operation Reverts?

An ERC-4337 paymaster still pays for gas when an accepted user operation reverts during execution. Whether the user also pays a token fee depends on the paymaster's charging logic or the application's separate collection contract. A failed application action therefore does not imply that every related cost disappears.

Will Replacing a Trusted Forwarder Preserve the Target Contract's State?

Updating a forwarder setting on an existing contract differs from redeploying the target contract. An immutable forwarder can require redeployment, and the new contract does not automatically inherit the old contract's stored state. Forwarder migration must therefore account for both authorization configuration and state continuity.

Is a User Operation Hash Also the Onchain Transaction Hash?

An ERC-4337 user operation hash identifies the operation, while the bundler transaction has a separate transaction hash. The operation receipt connects the operation to its onchain execution. Use the operation's outcome for account-level success and the transaction hash for the containing blockchain transaction.

Does an Onchain Revert Undo an EIP-7702 Delegation?

An execution revert does not roll back an EIP-7702 delegation that the transaction already processed. Authorization processing happens before call execution. A failed application action can leave the delegated account code in place, so the receipt's revert status does not establish that the account returned to its previous configuration.

updated