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 Model | Description |
---|---|
contract_functions | Sponsor interactions with smart contracts. |
account_functions | Sponsor interactions with the smart account. |
limit_rules | Limit 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.
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).
Limit rule#
When selecting rate_limit
as the policy rule, you'll be able to select three types of rules:
Rule Model | Description |
---|---|
gas_per_interval | Limit the amount of gas per interval. For example, sponsoring 1000 WEI per minute. |
gas_per_transaction | Limit the amount of gas per transaction. For example, sponsoring 100 WEI per transaction. |
count_per_interval | Limit the number of transactions per interval. For example, sponsoring 10 transactions (value) per minute. |