project screenshot 1
project screenshot 2
project screenshot 3

gastly

The one wallet to rule them all. Pay for gas using any token from any wallet, across all chains.

gastly

Created At

ETHOnline 2023

Winner of

trophy

🏊 Scroll — Pool Prize

trophy

🥈 Scroll — Best Use

trophy

🥇 Connext — Best Use

Project Description

As web3 users navigate the diverse ecosystems across many chains, they will inevitably accumulate an abundance of disparate wallets, with many different tokens.

The goal of building Gastly is to unify all these wallets & tokens in a task that is ubiquitous across every chain: paying for gas.

Gastly is the glue that enables any of your wallets pay for a transaction, using any token, regardless of the chain.

How it's Made

The frontend demo app is a next.js app with ethersjs. The backend uses nodejs and Safe SDK to relay signed transactions to smart contract wallets. The contracts are written in Solidity. The architecture of the contracts are described below.

diagram This project uses 5 core components: Liquidity pools, Wormhole, Safe accounts, 1Balance relayers, xERC20 LP tokens.

Liquidity pools

These pools exist as a hub-and-spoke model, which consists of a single Root Pool (deployed on Goerli), and multiple cross-chain Branch Pools (deployed on Polygon, Scroll, and others). The idea is that the Root Pool will contain the target gas token (we use gEth on goerli). This is supplied by liquidity providers (LPs) in exchange for fees (currently 0% for this project, but should scale according to utilization).

Wormhole

Wormhole is used as a message relayer to send the credit amount from the Branch pool to the Root Pool. Gastly decided to use messaging instead of a token bridge to save gas i.e., if a user needs to bridge tokens every time, they would incur massive gas overhead costs.

Safe

Accounts are used as a smart contract wallet to initiate transactions. For this project, it is a 1/1 Safe account. The Safe account uses 1Balance as the "paymaster".

Gelato/1Balance

The relayers that are sponsors of the Safe account's transactions. 1Balance accepts a specific token to meter gas use. For example, deposits are made in gEth on goerli testnet. In production, deposits are made in USDC on Polygon. Deposits are made on behalf of a single EOA account. In this case, it is the owner of the 1/1 Safe.

xERC20 Liquidity Provider Tokens

Since it is expected that Pools can get unbalanced, LPs can bridge their tokens to rebalance the pools. They can be incentivized to do so by getting a rebalancing bonus/fee. Gastly takes advantage of xERC20 implementation with xCall on Connext

General User Flow

When a user wants to pay with tokens on another chain, gastly will:

  1. Deposit in their tokens in the Branch Pool.
  2. Wormhole is used to send the credit amount from the Branch Pools to Root Pool.
  3. Upon receiving the credit, the Root pool will deposit to 1Balance on behalf of the user's wallet
  4. User can transact as normal through their Safe.
background image mobile

Join the mailing list

Get the latest news and updates