Grindery's cross-chain gas tank system simplifies transactions across various EVM chains, eliminating the need for users to hold native tokens on all blockchain for gas payments. Instead, Grindery X (GX) tokens, based on the Polygon network, are used.
The proposed system is a centralized solution that we intend to decentralize in the long term future beyond the currently laid our product roadmap. For reference similiar solutions can be found in Avocado and Ambire.
How It Works:
- Price list: In order to simplify calculations and avoid false/wrong/inaccurate estimations each transaction type has a GX token price on different blockchains. For instance, token transfers on Polygon might cost 1 GX, while swaps on Linea could be 10 GX. These prices are initially set based on average gas costs and the GX token's value determined during the Token Generation Event (TGE).
- User Approval: Before a transaction, its GX cost is displayed for user approval. This cost is compared against the user's gas tank balance stored - initially - in a database.
- Reservation of Funds: Upon approval, the required GX amount is reserved from the user's gas tank, with the balance updated to reflect remaining GX.
- Transaction Completion and Adjustments: Post-transaction, the spent GX is deducted from the gas tank in the database. The actual gas cost is recorded for analysis. In case of transaction failure, the reserved GX is returned to the gas tank.
- Gas Payment Processing: Gas expenses on each chain are covered through the Pimlico Paymaster contract, with consolidated payments made by Grindery via credit card or token in each payment cycle.
- Revenue Generation: GX tokens expended by users are moved from the Gas Tank to the Grindery Treasury, categorized as revenue.
- Price List Adjustment: The aggregate payment to Pimlico, alongside individual gas payment data, is used to periodically update the GX price list. This ensures alignment with current gas prices and adjusts for any gains or losses in each cycle.