Management API Reference

Dashboard

Gas Policy Strategies & Rules

Covers the detailed configuration of gas policies, including available strategies and rule types

Gas Policy Strategies#

Gas policies offer three distinct strategies for handling transaction fees:

PolicyGas

1. Sponsored Transactions#

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

PolicyERC20Payment

2. Dynamic ERC20 Payment#

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

PolicyERC20Payment

3. Fixed ERC20 Payment#

Users pay a fixed amount of ERC20 tokens per transaction.

PolicyERC20Payment

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

Wildcard policies allow you to sponsor any transaction for any contract without the need to add them in the policy. Enable "Catch-all sponsorship".

Wildcard policy

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

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

policyRules

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.

Register Session key

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
Register Session key