Gas Policies
You can configure gas policies for ZeroDev paymaster to have fine-grained control over what you sponsor, and how much.
Paymaster policies can be configured through either the dashboard or the API.
Policy Types
There are four types of gas 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.
- Custom policies: if none of the policies above meet your needs, you can program totally custom policies via a webhook.
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.
Sponsor up to 1 MATIC every hour for the entire project
Here we create a project policy:
Sponsor 100 transactions per minute for a specific contract
Here we create a contract policy:
Sponsor transactions for a specific function when gas price is below 50 GWEI
Here we create a contract policy:
Sponsor 100 transactions per hour for a specific address
Here we create a wallet policy: