How to select a gas policy strategy
This guide demonstrates the steps to create a gas policy.
What's a policy strategy?#
Gas policiy strategies are the first element to define who and how are the transactions sponsored. Openfort let's you create unlimited combination of gas policies to interact with.
There are three types of gas strategies that you can select:
- Pay gas for user: Developers pay the gas fees on behalf of your users (users don't need to hold native tokens on their accounts).
- Charge dynamic amount of ERC-20 tokens: Users pay gas with an ERC-20 token given an exchange rate provided by you. For example, for every 1 unite of a native token I pay with 10 unites of ERC20. Useful if you have a trading ERC20 token.
- Charge fixed amount of ERC-20 tokens: Users pay a gas with a fix amount of ERC-20 tokens per transaction. For example, for every 1 unite of native tokens I pay 0.5 unites of ERC20. Useful if you want to offer a constant gas token price.
Decide the gas policy strategy#
Create a gas policy based on your user flow:
Pay gas for user#
Sponsor your user's gas fees with native tokens or Fiat.
Charge dynamic amount of ERC-20#
Charging a dynamic amount of ERC-20 tokens for gas fees. The amount of tokens is calculated based on the gas price and the exchange rate you provide.
Charge fixed amount of ERC-20#
The user will pay a fixed amount of ERC-20 tokens per transaction. The amount is defined by you.
For a useful resource to calculate Wei online, visit ETH Converter.