Skip to main content

Pay Gas for Users

Demo

Introduction

By default, your users pay for their own gas, but you can choose to sponsor some (or all) transactions for your users. When you do, ZeroDev fronts the gas for your users, and charges your credit card on a monthly basis for the gas your users used.

Since it's unsafe to sponsor all transactions (in which case your users could drain your funds), you need to configure gas policies to determine which transactions to sponsor.

If you want to configure gas policies programmatically, check out the API. Otherwise, go to the Gas Policies section of your dashboard to follow along this tutorial.

Policy Types

There are three types of policies on ZeroDev:

  • Project policies: policies that apply to the entire project.
  • Contract policies: policies that apply to specific contracts.
  • Wallet policies: policies that apply to specific wallet addresses.

Rate Limit Types

When you create a new policy, you set up one or more rate limits.

There are four types of rate limits:

  • Amount: limit by the amount of gas
  • Request: limit by the number of requests
  • Gas Price: limit by the current gas price
  • Amount per txn: limit by the amount of gas per transaction

Policy examples

The policies and rate limits are hopefully intuitive, but here are some common examples in case they are helpful. We will be using Polygon (MATIC) in these examples.

Here we create a project policy:

Here we create a contract policy:

Here we create a contract policy:

Here we create a wallet policy: