Use gas sponsorship
Overview
This guides walks you through the process of implementing gas sponsorship using Ronin Waypoint. The process involves allowlisting your game's smart contract, obtaining a payer wallet from Sky Mavis, and sending transactions using the Ronin Waypoint SDK.
How gas sponsorship works
Sky Mavis supports two types of gas sponsorship programs: global gas sponsorship and local studio gas sponsorship. The global gas sponsorship program is funded by Sky Mavis, while the local studio gas sponsorship program is funded by the studio and Sky Mavis in a joint effort.
Global gas sponsorship
- Each new Ronin Waypoint user is eligible for a number free gas transactions. A new user is defined as a user who registers Ronin Waypoint service from the date defined by Sky Mavis.
- The five free gas transactions can be used in all games/dApps that integrated and use Ronin Waypoint.
- The funds for global gas sponsorship are provided by Sky Mavis.
- The rules, eligibility criteria, and expiration date of the global gas sponsorship program are determined by Sky Mavis.
- The payer wallet and the private key are controlled by Sky Mavis.
Local studio gas sponsorship
- The funds are jointly provided by Sky Mavis and the studio. For example, Sky Mavis provides 50% of the funds, and the studio provides the other 50%. Or the studio can sponsor 100% of the funds.
- The program applies to all the users who interact with the allowlisted smart contract address and specific functions in the game.
- The rules, eligibility criteria, and expiration date of the local gas sponsorship program are determined by the studio, using a template provided by Sky Mavis.
- The payer wallet and the private key are controlled either by Sky Mavis or the studio, subject to the agreement between the two parties.
Gas sponsorship priority
When a user submits a transaction, Ronin Waypoint checks the user's eligibility for gas sponsorship. The priority of check is as follows:
- Local studio gas sponsorship. The system checks whether the user meets the eligibility criteria defined by the studio, and if yes, automatically applies the gas discount. Note: if the payer wallet balance is less than 0.02 RON, the system switches to global gas sponsorship.
- Global gas sponsorship. The system checks whether the user is eligible for global gas sponsorship based on the following criteria:
- Age of the user account
- Remaining free gas transactions
- No gas sponsorship. If the user does not meet the criteria for local or global gas sponsorship, the system does not apply any gas discount and the user must bear the gas fees.
Prerequisites
Have a smart contract that you want to sponsor gas for deployed to Ronin. For more information, see Deploy a smart contract.
Steps
Step 1. Apply for gas sponsorship
-
Contact your Sky Mavis point of contact to apply for the "Local studio gas sponsorship" program.
-
Using the provided template, provide the following information:
- The number of free gas transactions you want to sponsor.
- The contract address.
- The contract function names that you want to sponsor.
- The start and end date for the sponsorship.
-
Submit the provided template to Sky Mavis so that we can enable gas sponsorship for your smart contract in the system.
-
Depending on the agreement, Sky Mavis will either provide you with a payer wallet, or you will use your own wallet to sponsor gas.
Step 2. Send transactions using the Ronin Waypoint SDK
-
Using the Ronin Waypoint SDK, implement transaction functions to send transactions to your allowlisted smart contract.
-
When a user initiates a transaction to this contract, Ronin Waypoint automatically applies the gas voucher.
Refer to a video demonstration of transaction signing and subsequent view of the transaction in the explorer.