Management API Reference

Dashboard

Sponsorship rules

Policy rules are the conditions that you set to apply the gas policy. The gas policy would be useless without at least setting one rule.

There are three kinds of rule models:

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#

When selecting contract_functions as the policy rule, you can decide what asset contract and functions are allowed to be called by your users.

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#

When selecting account_functions as the policy rule, the policy will allow sponsoring interactions with the smart account. (e.g. transferring ownership of the account, registering/revoking a session key, manual smart account deployment).

Register Session key

Limit rule#

When selecting rate_limit as the policy rule, you'll be able to select three types of rules:

Rule ModelDescription
gas_per_intervalLimit the amount of gas per interval. For example, sponsoring 1000 WEI per minute.
gas_per_transactionLimit the amount of gas per transaction. For example, sponsoring 100 WEI per transaction.
count_per_intervalLimit the number of transactions per interval. For example, sponsoring 10 transactions (value) per minute.
Register Session key