Understanding Gas Sponsorship
Gas sponsorship in Openfort offer a flexible way to manage gas payments. These policies are crucial for those looking to customize user experiences, especially when it comes to in-game items and currencies.
What's a gas manager?#
Gas managers are policies defined by companies that govern how and when a application will sponsor a user's gas fees using the Openfort's paymaster. You can design your user's experiences, such as:
- Encouraging game adoption by abstracting gas fees for new users.
- Letting users pay gas fees using ERC20 tokens, including in-game tokens or stablecoins like USDC.
- Promoting in-game actions while having users pay for actions that take them out of your ecosystem.
How to get started#
You can use gas policies to specify the contracts and functions that you want your users to interact with without paying gas fees in native tokens. Learn how the how the gas sponsorship works.
- Visit the Gas Manager tab.
- Click the
Add Policybutton to define your policy details.
- When ready to go live, add funds to your account. We'll explain how in the next section.
How to sponsor gas fees#
Developers can sponsor gas on behalf of your users in two ways:
Paying with fiat#
Add balance credit to your account and use it to pay for gas fees. With each transaction, the gas cost will be deducted from your balance automatically.
This is the default in Openfort, and you need it when going
livemode with your project.
Paying with native tokens#
With Openfort, you can network native tokens to pay for gas fees (ie. ETH in Ethereum).
Openfort deploys a smart contract in the chains it supports called
Paymaster. This contract is responsible for all gas related operations and its address is the same across blockchains.
- In testnets the contract address is 0x3210deD2e50363eF645C4eA15339Bec8Ac88e0F5 (e.g. this one is in Polygon Mumbai).
- In mainnets the contract address is 0xd71E61dde321dCDe58886479A47f1142bBF0C6d6 (e.g. this one is in Polygon Mainnet).
Visit the entity addresses page to learn more about the addresses in each blockchain network.
Tokens deposited in this contract can always be withdrawn by the owner and you can control its balance at any time checking the its balance.