Relay
gasless
transactions
Available on all major EVM compatible networks to supercharge your Web3 UX
Introduction
How it works
- Off chain
- On chain
- Users sign a message off-chain to interact with your Web3 app. This message gets forwarded to Gelato Relayer via a simple API call
- Gelato submits the corresponding transaction to the respective blockchain and pays for the gas
- Off chain
- On chain
- 0
- 1
- 2
- Users sign a message off-chain to interact with your Web3 app.
- This message gets forwarded to Gelato Relayer via a simple API call
- Gelato submits the corresponding transaction to the respective blockchain and pays for the gas
Easy to integrate
Import the Gelato Relay SDK
into your application
1
SolidityMake your target contract compatible with ERC2771
import {
ERC2771Context
} from "@gelatonetwork/relay-context/contracts/vendor/ERC2771Context.sol";
contract GaslessCounter is ERC2771Context {
mapping(address => uint256) public counter;
constructor(address trustedForwarder) ERC2771Context(trustedForwarder) {}
// Target function 🎯
function increment() external {
counter[_msgSender()]++;
}
}
2
JavascriptUsing Gelato Relay SDK, call your target function gaslessly with user signature authentication
import { GelatoRelaySDK } from "@gelatonetwork/relay-sdk";
const counter = "0x...";
const abi = ["function increment()"];
const provider = new ethers.providers.Web3Provider(window.ethereum);
const signer = provider.getSigner();
const user = signer.getAddress();
const contract = new ethers.Contract(counter, abi, signer);
const { payload } = await contract.populateTransaction.increment();
const relayRequest = {
chainId: provider.network.chainId;
target: counter;
data: payload;
user: user;
};
const apiKey = "stracciatella";
// Get user signature and send relay request to Gelato Relay
const relayResponse =
await GelatoRelaySDK.relayWithSponsoredCallERC2771(relayRequest, provider, apiKey);
console.log(relayResponse);
1Balance System
Pay for all of your gasless transactions on all EVM chains with a single balance
Scalable
Gelato adapts to your needs, whether you have 10 or 1,000,000 users
Reliable
Transactions are mined within a couple of blocks, eliminating network reliability issues without sacrificing decentralization
Flexible payments
A variety of whitelisted ERC-20 tokens are accepted as either prepayments or in-execution payments
Multichain
Gelato supports all major networks for gasless transactions, including cross-chain bridging
Explore
Use Cases
Bridge
Gasless Cross-Chain Asset Bridging
NFT
NFT Limit Orders
Social Media
Gasless Social Media Experience
Gaming
Gasless Minting of NFTs
Used by
Safe
Connext
NFTrade
Pudgy Penguins
Supported Networks
Gelato Web3 Functions are available on more than 30 networks, with new networks added every week