← Back to home

gastly

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

Screenshots

gastly screenshot 1
gastly screenshot 2
gastly screenshot 3

Problem Statement

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.

Solution

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.This project uses 5 core components: Liquidity pools, Wormhole, Safe accounts, 1Balance relayers, xERC20 LP tokens.Liquidity poolsThese 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).WormholeWormhole 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.SafeAccounts 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/1BalanceThe 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 TokensSince 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 ConnextGeneral User FlowWhen a user wants to pay with tokens on another chain, gastly will:Deposit in their tokens in the Branch Pool.Wormhole is used to send the credit amount from the Branch Pools to Root Pool.Upon receiving the credit, the Root pool will deposit to 1Balance on behalf of the user's walletUser can transact as normal through their Safe.

Hackathon

ETHOnline 2023

2023

Prizes

  • 🏆

    🏊 Scroll — Pool Prize

  • 🏆

    🥈 Scroll — Best Use

  • 🏆

    🥇 Connext — Best Use

Contributors

  • ltyu
    ltyu

    12 contributions