Skip to content
Language: English (United States)

Gas Manager

Sponsor gas for your users

Paymaster-as-a-Service for account abstraction. Sponsor gas fees, set limits per user and per operation, and let users transact without a native token.

Available NowBack to Web3 Overview

Key Capabilities

Everything you need, nothing you don't.

  • Gas Sponsorship

    Pay gas fees on behalf of your users for frictionless UX.

  • Spending Policies

    Set limits per user, per operation, or per time period.

  • User Whitelisting

    Control which users can access sponsored transactions.

  • Multi-chain

    Sponsor gas across Ethereum, Polygon, Arbitrum, and more.

  • Custom Paymasters

    Deploy custom paymaster logic for advanced use cases.

  • ERC-20 Gas Payment

    Let users pay gas in stablecoins or your app token.

  • Real-time Balance

    Monitor sponsor balance and usage in real-time.

  • Auto-refill

    Automatic balance top-up when running low.

  • Usage Analytics

    Track sponsored gas by user, operation, and chain.

Simple to Integrate

Get started with just a few lines of code. SDKs for every language.

GaslessApp.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.24;
 
import "@hanzo/gas/IHanzoPaymaster.sol";
import "@account-abstraction/contracts/core/BasePaymaster.sol";
 
contract HanzoPaymaster is BasePaymaster {
    mapping(address => bool) public whitelistedContracts;
    mapping(address => uint256) public userGasUsed;
    uint256 public maxGasPerUser = 0.01 ether;
 
    constructor(IEntryPoint _entryPoint) BasePaymaster(_entryPoint) {}
 
    // Validate paymaster will sponsor this UserOp
    function _validatePaymasterUserOp(
        UserOperation calldata userOp,
        bytes32 userOpHash,
        uint256 maxCost
    ) internal override returns (bytes memory context, uint256 validationData) {
        address target = address(bytes20(userOp.callData[16:36]));
        require(whitelistedContracts[target], "Contract not whitelisted");
        require(
            userGasUsed[userOp.sender] + maxCost <= maxGasPerUser,
            "User gas limit exceeded"
        );
 
        return (abi.encode(userOp.sender, maxCost), 0);
    }
 
    // Called after UserOp execution
    function _postOp(
        PostOpMode mode,
        bytes calldata context,
        uint256 actualGasCost
    ) internal override {
        (address user, ) = abi.decode(context, (address, uint256));
        userGasUsed[user] += actualGasCost;
    }
 
    // Admin functions
    function whitelistContract(address target, bool allowed) external onlyOwner {
        whitelistedContracts[target] = allowed;
    }
 
    function setMaxGasPerUser(uint256 _max) external onlyOwner {
        maxGasPerUser = _max;
    }
}

SolidityNodePythonGoRustCC++Ruby

Built For

Remove gas friction for new users entering Web3.

Sponsor in-game transactions so players never stop to buy gas.

Cover gas for NFT drops and collection mints.

Abstract blockchain complexity for business users.

Supported Chains

Start Building with Gas Manager

Get your free API key and ship your first request in under 5 minutes. No credit card required.

Get Gas Manager