Skip to content

Gas Policy Strategies & Rules

Gas Policy Strategies

Gas policies offer three distinct strategies for handling transaction fees:

1. Sponsored Transactions

Developers cover all gas fees, removing the need for users to hold native tokens.

2. Dynamic ERC20 Payment

Users pay gas fees using ERC20 tokens at a dynamic exchange rate.

3. Fixed ERC20 Payment

Users pay a fixed amount of ERC20 tokens per transaction.

Policy Rules

While strategies determine how gas fees are paid, rules define when and how your gas policy applies. Every policy needs at least one rule to function, and you can choose from three types:

Rule ModelDescription
contract_functionsSponsor interactions with smart contracts.
account_functionsSponsor interactions with the smart account.
limit_rulesLimit the amount of gas or number of transactions over an interval.

Contract functions

These rules let you specify which smart contract interactions your policy covers. You might want to sponsor all interactions with your game contracts but not with external marketplaces, for instance.

Wildcard policy

To create a policy rule, you need first to add a contract to Openfort:

Add a contract

Once you've selected your contract, you can then choose what function you wish to enable sponsorship for. You can select All functions instead to allow sponsoring all functions in that specific contract.

Account functions

These rules cover account-related operations, such as transferring ownership of accounts, managing session keys, or deploying smart accounts. They're essential for maintaining smooth account management operations within your application.

Limit rule

Limit rules help you control usage of your gas policy. You can set limits based on:

Rule TypeDescriptionExample Use Case
Gas per IntervalTotal gas limit in timeframe1000 WEI/minute
Gas per TransactionGas limit per transaction100 WEI/transaction
Count per IntervalTransaction count limit10 transactions/minute